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
4f5c99b1
Verified
Commit
4f5c99b1
authored
2 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_mpi_world_size()`
parent
a1672665
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
+4
-0
4 additions, 0 deletions
include/internal/fmpi_mpi.h
src/fmpi_mpi.c
+14
-0
14 additions, 0 deletions
src/fmpi_mpi.c
with
18 additions
and
0 deletions
include/internal/fmpi_mpi.h
+
4
−
0
View file @
4f5c99b1
...
@@ -243,6 +243,10 @@ int fmpi_mpi_world_reduce_in_place(
...
@@ -243,6 +243,10 @@ int fmpi_mpi_world_reduce_in_place(
int
fmpi_mpi_dims_create
(
int
fmpi_mpi_dims_create
(
const
struct
fmpi_mpi_ctx
*
ctx
,
size_t
*
const
dim_len
,
size_t
dim_cnt
const
struct
fmpi_mpi_ctx
*
ctx
,
size_t
*
const
dim_len
,
size_t
dim_cnt
);
);
/*------------------------------------------------------------------------------
fmpi_mpi_world_size()
------------------------------------------------------------------------------*/
int
fmpi_mpi_world_size
(
const
struct
fmpi_mpi_ctx
*
ctx
);
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_mpi.c
+
14
−
0
View file @
4f5c99b1
...
@@ -336,3 +336,17 @@ int fmpi_mpi_dims_create(
...
@@ -336,3 +336,17 @@ int fmpi_mpi_dims_create(
}
}
return
fmpi_mpi_check_error
(
ctx
,
err
,
"MPI_Dims_create"
);
return
fmpi_mpi_check_error
(
ctx
,
err
,
"MPI_Dims_create"
);
}
}
/*------------------------------------------------------------------------------
fmpi_mpi_world_size()
------------------------------------------------------------------------------*/
int
fmpi_mpi_world_size
(
const
struct
fmpi_mpi_ctx
*
const
ctx
)
{
assert
(
ctx
!=
NULL
);
int
size
=
FMPI_ERROR
;
int
err
=
MPI_Comm_size
(
ctx
->
world
,
&
size
);
err
=
fmpi_mpi_check_error
(
ctx
,
err
,
"MPI_Comm_size"
);
if
(
err
!=
FMPI_SUCCESS
)
{
return
err
;
}
return
size
;
}
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