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
6ab78295
Verified
Commit
6ab78295
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_run_task()`
parent
3d7c9d31
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/array_sum/main.c
+1
-1
1 addition, 1 deletion
examples/array_sum/main.c
include/fmpi_core.h
+4
-0
4 additions, 0 deletions
include/fmpi_core.h
src/fmpi_core.c
+14
-0
14 additions, 0 deletions
src/fmpi_core.c
with
19 additions
and
1 deletion
examples/array_sum/main.c
+
1
−
1
View file @
6ab78295
...
@@ -36,7 +36,7 @@ int main(int argc, char * argv[])
...
@@ -36,7 +36,7 @@ int main(int argc, char * argv[])
fmpi_data_out
(
ctx
,
&
out
),
fmpi_data_out
(
ctx
,
&
out
),
fmpi_data_1d_in
(
ctx
,
in
,
in_size
)
fmpi_data_1d_in
(
ctx
,
in
,
in_size
)
);
);
fmpi_task
_run_sync
(
ctx
,
&
array_sum_task
);
fmpi_
run_
task
(
ctx
,
&
array_sum_task
);
printf
(
"rank=%d sum=%ld
\n
"
,
fmpi_world_rank
(
ctx
),
out
);
printf
(
"rank=%d sum=%ld
\n
"
,
fmpi_world_rank
(
ctx
),
out
);
fmpi_exit
(
&
ctx
);
fmpi_exit
(
&
ctx
);
return
EXIT_SUCCESS
;
return
EXIT_SUCCESS
;
...
...
This diff is collapsed.
Click to expand it.
include/fmpi_core.h
+
4
−
0
View file @
6ab78295
...
@@ -126,6 +126,10 @@ int fmpi_world_rank(const struct fmpi_ctx * ctx);
...
@@ -126,6 +126,10 @@ int fmpi_world_rank(const struct fmpi_ctx * ctx);
fmpi_world_barrier()
fmpi_world_barrier()
------------------------------------------------------------------------------*/
------------------------------------------------------------------------------*/
int
fmpi_world_barrier
(
const
struct
fmpi_ctx
*
ctx
);
int
fmpi_world_barrier
(
const
struct
fmpi_ctx
*
ctx
);
/*------------------------------------------------------------------------------
fmpi_run_task()
------------------------------------------------------------------------------*/
int
fmpi_run_task
(
const
struct
fmpi_ctx
*
ctx
,
const
struct
fmpi_task
*
task
);
/*==============================================================================
/*==============================================================================
MACRO
MACRO
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_core.c
+
14
−
0
View file @
6ab78295
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include
<stdio.h>
// fprintf()
#include
<stdio.h>
// fprintf()
#include
<stdlib.h>
// NULL, abort()
#include
<stdlib.h>
// NULL, abort()
// Internal
// Internal
#include
"fmpi_task.h"
#include
"internal/fmpi_ctx.h"
#include
"internal/fmpi_ctx.h"
#include
"internal/fmpi_error.h"
#include
"internal/fmpi_error.h"
#include
"internal/fmpi_mpi.h"
#include
"internal/fmpi_mpi.h"
...
@@ -94,3 +95,16 @@ int fmpi_world_barrier(const struct fmpi_ctx * const ctx)
...
@@ -94,3 +95,16 @@ int fmpi_world_barrier(const struct fmpi_ctx * const ctx)
}
}
return
err_id
;
return
err_id
;
}
}
/*------------------------------------------------------------------------------
fmpi_run_task()
------------------------------------------------------------------------------*/
int
fmpi_run_task
(
const
struct
fmpi_ctx
*
const
ctx
,
const
struct
fmpi_task
*
const
task
){
assert
(
ctx
!=
NULL
);
assert
(
task
!=
NULL
);
if
(
task
->
type
==
FMPI_TASK_TYPE_SYNC
)
{
return
fmpi_task_run_sync
(
ctx
,
task
);
}
return
fmpi_task_run_async
(
ctx
,
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