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
2d1ba914
Verified
Commit
2d1ba914
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_mpi_world_rank()`
parent
f6755f6a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show 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
+13
-0
13 additions, 0 deletions
src/fmpi_mpi.c
with
20 additions
and
0 deletions
include/internal/fmpi_mpi.h
+
7
−
0
View file @
2d1ba914
...
@@ -160,6 +160,13 @@ _Bool fmpi_mpi_check_error(
...
@@ -160,6 +160,13 @@ _Bool fmpi_mpi_check_error(
* }
* }
*/
*/
void
fmpi_mpi_ctx_print
(
const
struct
fmpi_mpi_ctx
*
ctx
);
void
fmpi_mpi_ctx_print
(
const
struct
fmpi_mpi_ctx
*
ctx
);
/*------------------------------------------------------------------------------
fmpi_mpi_world_rank()
------------------------------------------------------------------------------*/
/**
* TODO
*/
int
fmpi_mpi_world_rank
(
const
struct
fmpi_mpi_ctx
*
ctx
);
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_mpi.c
+
13
−
0
View file @
2d1ba914
...
@@ -139,3 +139,16 @@ void fmpi_mpi_ctx_print(const struct fmpi_mpi_ctx * const ctx)
...
@@ -139,3 +139,16 @@ void fmpi_mpi_ctx_print(const struct fmpi_mpi_ctx * const ctx)
printf
(
"MPI futhark error class: %d
\n
"
,
ctx
->
futhark_err_class
);
printf
(
"MPI futhark error class: %d
\n
"
,
ctx
->
futhark_err_class
);
printf
(
"MPI futhark error code: %d
\n
"
,
ctx
->
futhark_err_code
);
printf
(
"MPI futhark error code: %d
\n
"
,
ctx
->
futhark_err_code
);
}
}
/*------------------------------------------------------------------------------
fmpi_mpi_world_rank()
------------------------------------------------------------------------------*/
int
fmpi_mpi_world_rank
(
const
struct
fmpi_mpi_ctx
*
const
ctx
)
{
assert
(
ctx
!=
NULL
);
int
rank
=
-
1
;
int
err_id
=
MPI_Comm_rank
(
MPI_COMM_WORLD
,
&
rank
);
if
(
fmpi_mpi_check_error
(
ctx
,
err_id
,
"MPI_Comm_rank"
)
==
true
)
{
return
-
1
;
}
return
rank
;
}
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