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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raphael.bach
fmpi
Commits
b1dbd3af
Verified
Commit
b1dbd3af
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_stencil` to `fmpi_task`
parent
a780b17b
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
+5
-3
5 additions, 3 deletions
include/fmpi_task.h
include/internal/generic/fmpi_task_generic.h
+37
-37
37 additions, 37 deletions
include/internal/generic/fmpi_task_generic.h
src/fmpi_task.c
+5
-3
5 additions, 3 deletions
src/fmpi_task.c
with
47 additions
and
43 deletions
include/fmpi_task.h
+
5
−
3
View file @
b1dbd3af
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
// Internal
// Internal
#include
"fmpi_data.h"
#include
"fmpi_data.h"
#include
"fmpi_domain.h"
#include
"fmpi_domain.h"
#include
"fmpi_stencil.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/generic/fmpi_task_generic.h"
#include
"internal/generic/fmpi_task_generic.h"
/*==============================================================================
/*==============================================================================
...
@@ -92,6 +93,7 @@ typedef struct fmpi_task {
...
@@ -92,6 +93,7 @@ typedef struct fmpi_task {
fmpi_task_func
func
;
//!< TODO
fmpi_task_func
func
;
//!< TODO
struct
fmpi_task_args
args
;
//!< TODO
struct
fmpi_task_args
args
;
//!< TODO
struct
fmpi_domain
domains
[
FMPI_TASK_ARGS_MAX
];
//!< TODO
struct
fmpi_domain
domains
[
FMPI_TASK_ARGS_MAX
];
//!< TODO
struct
fmpi_stencil
stencil
;
//!< TODO
}
fmpi_task
;
}
fmpi_task
;
/*==============================================================================
/*==============================================================================
PUBLIC FUNCTION
PUBLIC FUNCTION
...
@@ -119,7 +121,7 @@ typedef struct fmpi_task {
...
@@ -119,7 +121,7 @@ typedef struct fmpi_task {
*/
*/
struct
fmpi_task
fmpi_task_register
(
struct
fmpi_task
fmpi_task_register
(
struct
fmpi_ctx
*
ctx
,
const
fmpi_task_func
func
,
struct
fmpi_ctx
*
ctx
,
const
fmpi_task_func
func
,
const
struct
fmpi_task_args
*
args
struct
fmpi_stencil
stencil
,
const
struct
fmpi_task_args
*
args
);
);
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
fmpi_task_run()
fmpi_task_run()
...
@@ -147,8 +149,8 @@ void fmpi_task_run(const struct fmpi_ctx * ctx, const struct fmpi_task * task);
...
@@ -147,8 +149,8 @@ void fmpi_task_run(const struct fmpi_ctx * ctx, const struct fmpi_task * task);
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
FMPI_TASK_REGISTER()
FMPI_TASK_REGISTER()
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
#define FMPI_TASK_REGISTER(ctx, func, ...) \
#define FMPI_TASK_REGISTER(ctx, func,
stencil,
...) \
FMPI_TASK_REGISTER_IMPL(ctx, func, __VA_ARGS__)
FMPI_TASK_REGISTER_IMPL(ctx, func,
stencil,
__VA_ARGS__)
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
FMPI_TASK_FUTHARK_SYNC()
FMPI_TASK_FUTHARK_SYNC()
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
...
...
This diff is collapsed.
Click to expand it.
include/internal/generic/fmpi_task_generic.h
+
37
−
37
View file @
b1dbd3af
...
@@ -46,18 +46,18 @@ void FUNC##_##N( \
...
@@ -46,18 +46,18 @@ void FUNC##_##N( \
fmpi_futhark_sync(ctx->fut); \
fmpi_futhark_sync(ctx->fut); \
}
}
#define FMPI_TASK_REGISTER_IMPL(ctx, func, ...) \
#define FMPI_TASK_REGISTER_IMPL(ctx, func,
stencil,
...) \
FMPI_PRIV_TASK_CONCAT(FMPI_TASK_REGISTER_, CPL_ARG_COUNT(__VA_ARGS__)) \
FMPI_PRIV_TASK_CONCAT(FMPI_TASK_REGISTER_, CPL_ARG_COUNT(__VA_ARGS__)) \
(ctx, func, __VA_ARGS__)
(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_1(ctx, func, arg_out) \
#define FMPI_TASK_REGISTER_1(ctx, func,
stencil,
arg_out) \
fmpi_task_register((ctx), func##_0, &(struct fmpi_task_args){ \
fmpi_task_register((ctx), func##_0,
stencil,
&(struct fmpi_task_args){ \
.out = (arg_out), \
.out = (arg_out), \
.cnt = 0 \
.cnt = 0 \
})
})
#define FMPI_TASK_REGISTER_N(ctx, func, arg_out, ...) \
#define FMPI_TASK_REGISTER_N(ctx, func,
stencil,
arg_out, ...) \
fmpi_task_register((ctx), FMPI_PRIV_TASK_CONCAT(func##_, CPL_ARG_COUNT(__VA_ARGS__)), &(struct fmpi_task_args){ \
fmpi_task_register((ctx), FMPI_PRIV_TASK_CONCAT(func##_, CPL_ARG_COUNT(__VA_ARGS__)),
stencil,
&(struct fmpi_task_args){ \
.in = {__VA_ARGS__}, \
.in = {__VA_ARGS__}, \
.out = (arg_out), \
.out = (arg_out), \
.cnt = CPL_ARG_COUNT(__VA_ARGS__) \
.cnt = CPL_ARG_COUNT(__VA_ARGS__) \
...
@@ -350,37 +350,37 @@ void FUNC##_##N( \
...
@@ -350,37 +350,37 @@ void FUNC##_##N( \
args->in[30].start, args->in[31] \
args->in[30].start, args->in[31] \
)
)
#define FMPI_TASK_REGISTER_2(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_2(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_3(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_3(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_4(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_4(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_5(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_5(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_6(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_6(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_7(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_7(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_8(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_8(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_9(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_9(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_10(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_10(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_11(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_11(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_12(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_12(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_13(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_13(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_14(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_14(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_15(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_15(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_16(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_16(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_17(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_17(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_18(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_18(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_19(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_19(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_20(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_20(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_21(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_21(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_22(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_22(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_23(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_23(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_24(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_24(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_25(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_25(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_26(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_26(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_27(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_27(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_28(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_28(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_29(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_29(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_30(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_30(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_31(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_31(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
#define FMPI_TASK_REGISTER_32(ctx, func, ...) FMPI_TASK_REGISTER_N(ctx, func, __VA_ARGS__)
#define FMPI_TASK_REGISTER_32(ctx, func,
stencil,
...) FMPI_TASK_REGISTER_N(ctx, func,
stencil,
__VA_ARGS__)
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_task.c
+
5
−
3
View file @
b1dbd3af
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include
<stdint.h>
// int64_t
#include
<stdint.h>
// int64_t
// Internal
// Internal
#include
"fmpi_domain.h"
#include
"fmpi_domain.h"
#include
"fmpi_stencil.h"
#include
"internal/fmpi_ctx.h"
#include
"internal/fmpi_ctx.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/fmpi_futhark_entry.h"
#include
"internal/fmpi_futhark_entry.h"
...
@@ -40,15 +41,16 @@
...
@@ -40,15 +41,16 @@
fmpi_task_run()
fmpi_task_run()
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
struct
fmpi_task
fmpi_task_register
(
struct
fmpi_task
fmpi_task_register
(
struct
fmpi_ctx
*
const
ctx
,
const
fmpi_task_func
func
,
struct
fmpi_ctx
*
ctx
,
const
fmpi_task_func
func
,
const
struct
fmpi_task_args
*
const
args
const
struct
fmpi_stencil
stencil
,
const
struct
fmpi_task_args
*
args
){
){
assert
(
ctx
!=
NULL
);
assert
(
ctx
!=
NULL
);
assert
(
ctx
->
task_cnt
<
FMPI_TASK_MAX
);
assert
(
ctx
->
task_cnt
<
FMPI_TASK_MAX
);
assert
(
args
!=
NULL
);
assert
(
args
!=
NULL
);
struct
fmpi_task
task
=
{
struct
fmpi_task
task
=
{
.
func
=
func
,
.
func
=
func
,
.
args
=
*
args
.
args
=
*
args
,
.
stencil
=
stencil
};
};
const
size_t
rank
=
(
size_t
)
ctx
->
mpi
->
rank
;
const
size_t
rank
=
(
size_t
)
ctx
->
mpi
->
rank
;
for
(
size_t
i
=
0
;
i
<
task
.
args
.
cnt
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
task
.
args
.
cnt
;
i
++
)
{
...
...
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