Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fmpi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raphael.bach
fmpi
Commits
f2c5b7fd
Verified
Commit
f2c5b7fd
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add array of `fmpi_domain` to `fmpi_task`
parent
c58faaa3
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/fmpi_task.h
+4
-3
4 additions, 3 deletions
include/fmpi_task.h
src/fmpi_data.c
+0
-1
0 additions, 1 deletion
src/fmpi_data.c
src/fmpi_task.c
+18
-1
18 additions, 1 deletion
src/fmpi_task.c
with
22 additions
and
5 deletions
include/fmpi_task.h
+
4
−
3
View file @
f2c5b7fd
...
...
@@ -27,10 +27,10 @@
INCLUDE
==============================================================================*/
// C Standard Library
#include
<stddef.h>
#include
<stddef.h>
// size_t
// Internal
#include
"fmpi_data.h"
#include
"
internal/fmpi_ctx
.h"
#include
"
fmpi_domain
.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/generic/fmpi_task_generic.h"
/*==============================================================================
...
...
@@ -93,6 +93,7 @@ typedef void (*fmpi_task_func)(
typedef
struct
fmpi_task
{
fmpi_task_func
func
;
//!< TODO
struct
fmpi_task_args
args
;
//!< TODO
struct
fmpi_domain
domains
[
FMPI_TASK_ARGS_CNT_MAX
];
//!< TODO
}
fmpi_task
;
/*==============================================================================
PUBLIC FUNCTION
...
...
@@ -119,7 +120,7 @@ typedef struct fmpi_task {
* }
*/
struct
fmpi_task
fmpi_task_register
(
const
struct
fmpi_ctx
*
ctx
,
const
fmpi_task_func
func
,
struct
fmpi_ctx
*
ctx
,
const
fmpi_task_func
func
,
const
struct
fmpi_task_args
*
args
);
/*------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_data.c
+
0
−
1
View file @
f2c5b7fd
...
...
@@ -64,7 +64,6 @@ struct fmpi_data fmpi_data_##D##d_in_new_##T( \
assert(ctx != NULL); \
assert(data != NULL); \
const size_t cnt = (x * y * z); \
struct futhark_##T##_##D##d * const start = fmpi_futhark_new_##D##d_##T(ctx->fut, data, x, y, z); \
return (struct fmpi_data){ \
.type = FMPI_TYPE_##T, \
.type_size = sizeof(T), \
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_task.c
+
18
−
1
View file @
f2c5b7fd
...
...
@@ -27,8 +27,12 @@
#include
<assert.h>
#include
<stdint.h>
// int64_t
// Internal
#include
"fmpi_domain.h"
#include
"internal/fmpi_ctx.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/fmpi_futhark_entry.h"
#include
"internal/fmpi_mpi.h"
#include
"internal/generic/fmpi_type.h"
/*==============================================================================
PUBLIC FUNCTION DEFINITION
==============================================================================*/
...
...
@@ -36,14 +40,27 @@
fmpi_task_run()
------------------------------------------------------------------------------*/
struct
fmpi_task
fmpi_task_register
(
const
struct
fmpi_ctx
*
const
ctx
,
const
fmpi_task_func
func
,
struct
fmpi_ctx
*
const
ctx
,
const
fmpi_task_func
func
,
const
struct
fmpi_task_args
*
const
args
){
assert
(
ctx
!=
NULL
);
assert
(
args
!=
NULL
);
struct
fmpi_task
task
=
{
.
func
=
func
,
.
args
=
*
args
};
const
size_t
rank
=
(
size_t
)
ctx
->
mpi
->
rank
;
for
(
size_t
i
=
0
;
i
<
task
.
args
.
cnt
;
i
++
)
{
task
.
domains
[
i
]
=
fmpi_new_domain
(
ctx
,
args
->
in
[
i
]);
void
*
start
=
fmpi_futhark_new_data
(
ctx
->
fut
,
task
.
domains
[
i
].
parts
[
rank
].
start
,
task
.
domains
[
i
].
data
.
type
,
task
.
domains
[
i
].
data
.
dim_cnt
,
task
.
domains
[
i
].
parts
[
rank
].
dim_len
[
0
],
task
.
domains
[
i
].
parts
[
rank
].
dim_len
[
1
],
task
.
domains
[
i
].
parts
[
rank
].
dim_len
[
2
]
);
task
.
args
.
in
[
i
].
start
=
start
;
}
futhark_context_sync
(
ctx
->
fut
->
ctx
);
return
task
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment