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
2acb166b
Verified
Commit
2acb166b
authored
2 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_mpi_world_gather_in_place()`
parent
96e2c187
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/internal/fmpi_mpi.h
+7
-0
7 additions, 0 deletions
include/internal/fmpi_mpi.h
src/fmpi_mpi.c
+24
-1
24 additions, 1 deletion
src/fmpi_mpi.c
with
31 additions
and
1 deletion
include/internal/fmpi_mpi.h
+
7
−
0
View file @
2acb166b
...
@@ -216,6 +216,13 @@ int fmpi_mpi_gather_in_place(
...
@@ -216,6 +216,13 @@ int fmpi_mpi_gather_in_place(
const
struct
fmpi_mpi_ctx
*
ctx
,
void
*
buf
,
MPI_Datatype
type
,
const
struct
fmpi_mpi_ctx
*
ctx
,
void
*
buf
,
MPI_Datatype
type
,
size_t
send_cnt
,
size_t
recv_cnt
,
int
root
,
MPI_Comm
comm
size_t
send_cnt
,
size_t
recv_cnt
,
int
root
,
MPI_Comm
comm
);
);
/*------------------------------------------------------------------------------
fmpi_mpi_world_gather_in_place()
------------------------------------------------------------------------------*/
int
fmpi_mpi_world_gather_in_place
(
const
struct
fmpi_mpi_ctx
*
ctx
,
void
*
buf
,
MPI_Datatype
type
,
size_t
send_cnt
,
size_t
recv_cnt
);
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_mpi.c
+
24
−
1
View file @
2acb166b
...
@@ -239,7 +239,7 @@ int fmpi_mpi_gather_in_place(
...
@@ -239,7 +239,7 @@ int fmpi_mpi_gather_in_place(
if
(
ctx
->
rank
==
root
)
{
if
(
ctx
->
rank
==
root
)
{
err
=
MPI_Gather
(
err
=
MPI_Gather
(
MPI_IN_PLACE
,
(
int
)
send_cnt
,
type
,
MPI_IN_PLACE
,
(
int
)
send_cnt
,
type
,
buf
,
(
int
)
recv_cnt
,
type
,
buf
,
(
int
)
recv_cnt
,
type
,
root
,
comm
root
,
comm
);
);
}
else
{
}
else
{
...
@@ -251,3 +251,26 @@ int fmpi_mpi_gather_in_place(
...
@@ -251,3 +251,26 @@ int fmpi_mpi_gather_in_place(
}
}
return
fmpi_mpi_check_error
(
ctx
,
err
,
"MPI_Gather"
);
return
fmpi_mpi_check_error
(
ctx
,
err
,
"MPI_Gather"
);
}
}
/*------------------------------------------------------------------------------
fmpi_mpi_world_gather_in_place()
------------------------------------------------------------------------------*/
int
fmpi_mpi_world_gather_in_place
(
const
struct
fmpi_mpi_ctx
*
const
ctx
,
void
*
const
buf
,
MPI_Datatype
type
,
const
size_t
send_cnt
,
const
size_t
recv_cnt
){
assert
(
ctx
!=
NULL
);
assert
(
buf
!=
NULL
);
assert
(
send_cnt
<=
INT_MAX
);
assert
(
recv_cnt
<=
INT_MAX
);
assert
(
send_cnt
<=
recv_cnt
);
const
int
err
=
fmpi_mpi_gather_in_place
(
ctx
,
buf
,
type
,
send_cnt
,
recv_cnt
,
ctx
->
root
,
ctx
->
world
);
if
(
err
!=
FMPI_SUCCESS
)
{
FMPI_RAISE_ERROR
(
ctx
->
err_handler
,
"FMPI"
,
"fmpi_mpi_gather_in_place() failed!"
);
}
return
err
;
}
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