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
b319f125
Verified
Commit
b319f125
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Make `fmpi_task_run_sync()` retrieve output data from futhark
parent
29d0db24
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
+1
-0
1 addition, 0 deletions
include/fmpi_task.h
include/internal/generic/fmpi_task_generic.h
+5
-3
5 additions, 3 deletions
include/internal/generic/fmpi_task_generic.h
src/fmpi_task.c
+20
-2
20 additions, 2 deletions
src/fmpi_task.c
with
26 additions
and
5 deletions
include/fmpi_task.h
+
1
−
0
View file @
b319f125
...
@@ -59,6 +59,7 @@
...
@@ -59,6 +59,7 @@
typedef
struct
fmpi_task_args
{
typedef
struct
fmpi_task_args
{
struct
fmpi_data
in
[
FMPI_TASK_ARGS_MAX
];
//!< TODO
struct
fmpi_data
in
[
FMPI_TASK_ARGS_MAX
];
//!< TODO
struct
fmpi_data
out
;
//!< TODO
struct
fmpi_data
out
;
//!< TODO
void
*
out_raw
;
size_t
cnt
;
//!< TODO
size_t
cnt
;
//!< TODO
}
fmpi_task_args
;
}
fmpi_task_args
;
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
include/internal/generic/fmpi_task_generic.h
+
5
−
3
View file @
b319f125
...
@@ -51,15 +51,15 @@ _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")\
...
@@ -51,15 +51,15 @@ _Pragma("GCC diagnostic ignored \"-Wcast-qual\"")\
if(args->out.type.derived == FMPI_TYPE_ARRAY) { \
if(args->out.type.derived == FMPI_TYPE_ARRAY) { \
if(args->out.dim_cnt == 1) { \
if(args->out.dim_cnt == 1) { \
CPL_MAP_FIXED(FMPI_PRIV_TASK_RET_FUNC, CPL_EMPTY, \
CPL_MAP_FIXED(FMPI_PRIV_TASK_RET_FUNC, CPL_EMPTY, \
(FUNC, N, 1, ctx->fut->ctx, args->out
.start
, args->in), FMPI_TYPE_REAL) \
(FUNC, N, 1, ctx->fut->ctx, args->out
_raw
, args->in), FMPI_TYPE_REAL) \
} \
} \
if(args->out.dim_cnt == 2) { \
if(args->out.dim_cnt == 2) { \
CPL_MAP_FIXED(FMPI_PRIV_TASK_RET_FUNC, CPL_EMPTY, \
CPL_MAP_FIXED(FMPI_PRIV_TASK_RET_FUNC, CPL_EMPTY, \
(FUNC, N, 2, ctx->fut->ctx, args->out
.start
, args->in), FMPI_TYPE_REAL) \
(FUNC, N, 2, ctx->fut->ctx, args->out
_raw
, args->in), FMPI_TYPE_REAL) \
} \
} \
if(args->out.dim_cnt == 3) { \
if(args->out.dim_cnt == 3) { \
CPL_MAP_FIXED(FMPI_PRIV_TASK_RET_FUNC, CPL_EMPTY, \
CPL_MAP_FIXED(FMPI_PRIV_TASK_RET_FUNC, CPL_EMPTY, \
(FUNC, N, 3, ctx->fut->ctx, args->out
.start
, args->in), FMPI_TYPE_REAL) \
(FUNC, N, 3, ctx->fut->ctx, args->out
_raw
, args->in), FMPI_TYPE_REAL) \
} \
} \
} \
} \
return futhark_entry_##FUNC(ctx->fut->ctx, args->out.start, FMPI_PRIV_TASK_ARGS_##N(args->in)); \
return futhark_entry_##FUNC(ctx->fut->ctx, args->out.start, FMPI_PRIV_TASK_ARGS_##N(args->in)); \
...
@@ -80,6 +80,7 @@ _Pragma("GCC diagnostic warning \"-Wincompatible-pointer-types\"")\
...
@@ -80,6 +80,7 @@ _Pragma("GCC diagnostic warning \"-Wincompatible-pointer-types\"")\
#define FMPI_PRIV_TASK_REGISTER_1(FUNC, ctx, type, stencil, arg_out) \
#define FMPI_PRIV_TASK_REGISTER_1(FUNC, ctx, type, stencil, arg_out) \
fmpi_task_register((ctx), FUNC##_0, #FUNC, (type), (stencil), &(struct fmpi_task_args){ \
fmpi_task_register((ctx), FUNC##_0, #FUNC, (type), (stencil), &(struct fmpi_task_args){ \
.out = (arg_out), \
.out = (arg_out), \
.out_raw = NULL, \
.cnt = 0 \
.cnt = 0 \
})
})
...
@@ -87,6 +88,7 @@ _Pragma("GCC diagnostic warning \"-Wincompatible-pointer-types\"")\
...
@@ -87,6 +88,7 @@ _Pragma("GCC diagnostic warning \"-Wincompatible-pointer-types\"")\
fmpi_task_register((ctx), FUNC##_##N, #FUNC, (type), (stencil), &(struct fmpi_task_args){ \
fmpi_task_register((ctx), FUNC##_##N, #FUNC, (type), (stencil), &(struct fmpi_task_args){ \
.in = {__VA_ARGS__}, \
.in = {__VA_ARGS__}, \
.out = (arg_out), \
.out = (arg_out), \
.out_raw = NULL, \
.cnt = N \
.cnt = N \
})
})
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_task.c
+
20
−
2
View file @
b319f125
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include
"internal/fmpi_error.h"
#include
"internal/fmpi_error.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/fmpi_futhark.h"
#include
"internal/fmpi_mpi.h"
#include
"internal/fmpi_mpi.h"
#include
"internal/fmpi_type.h"
/*==============================================================================
/*==============================================================================
PUBLIC FUNCTION DEFINITION
PUBLIC FUNCTION DEFINITION
==============================================================================*/
==============================================================================*/
...
@@ -110,8 +111,25 @@ int fmpi_task_run_sync(
...
@@ -110,8 +111,25 @@ int fmpi_task_run_sync(
assert
(
task
!=
NULL
);
assert
(
task
!=
NULL
);
const
int
err_id
=
task
->
func
(
ctx
,
&
task
->
args
);
const
int
err_id
=
task
->
func
(
ctx
,
&
task
->
args
);
fmpi_futhark_sync
(
ctx
->
fut
);
fmpi_futhark_sync
(
ctx
->
fut
);
if
(
fmpi_futhark_check_error
(
ctx
->
fut
,
task
->
name
)
==
true
)
{
if
(
task
->
args
.
out
.
type
.
derived
==
FMPI_TYPE_ARRAY
)
{
return
-
1
;
void
*
out
=
fmpi_futhark_get_data_sync
(
ctx
->
fut
,
task
->
args
.
out_raw
,
task
->
args
.
out
.
start
,
task
->
args
.
out
.
type
.
base
,
task
->
args
.
out
.
dim_cnt
);
if
(
out
==
NULL
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_futhark_get_data_sync() failed!"
);
}
const
int
err
=
fmpi_futhark_free_data_sync
(
ctx
->
fut
,
task
->
args
.
out_raw
,
task
->
args
.
out
.
type
.
base
,
task
->
args
.
out
.
dim_cnt
);
if
(
err
!=
0
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_futhark_free_data_sync() failed!"
);
}
}
}
return
err_id
;
return
err_id
;
}
}
...
...
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