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
e6f39a0c
Verified
Commit
e6f39a0c
authored
3 years ago
by
raphael.bach
Browse files
Options
Downloads
Patches
Plain Diff
Add `fmpi_mpi_finalized()`
parent
bafe246c
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
+17
-0
17 additions, 0 deletions
include/internal/fmpi_mpi.h
src/fmpi_mpi.c
+13
-1
13 additions, 1 deletion
src/fmpi_mpi.c
with
30 additions
and
1 deletion
include/internal/fmpi_mpi.h
+
17
−
0
View file @
e6f39a0c
...
@@ -167,6 +167,23 @@ void fmpi_mpi_ctx_print(const struct fmpi_mpi_ctx * ctx);
...
@@ -167,6 +167,23 @@ void fmpi_mpi_ctx_print(const struct fmpi_mpi_ctx * ctx);
* TODO
* TODO
*/
*/
int
fmpi_mpi_world_rank
(
const
struct
fmpi_mpi_ctx
*
ctx
);
int
fmpi_mpi_world_rank
(
const
struct
fmpi_mpi_ctx
*
ctx
);
/*------------------------------------------------------------------------------
fmpi_mpi_finalized()
------------------------------------------------------------------------------*/
/**
* Checks if `MPI_Finalize()` has been called.
*
* @param[in] ctx : A pointer to a fmpi_mpi_ctx.
*
* @return
* - `true` if `MPI_Finalize()` has been called.
* - `false` if `MPI_Finalize()` has not been called.
*
* @example{
* TODO
* }
*/
_Bool
fmpi_mpi_finalized
(
const
struct
fmpi_mpi_ctx
*
ctx
);
/*==============================================================================
/*==============================================================================
GUARD
GUARD
==============================================================================*/
==============================================================================*/
...
...
This diff is collapsed.
Click to expand it.
src/fmpi_mpi.c
+
13
−
1
View file @
e6f39a0c
...
@@ -93,7 +93,7 @@ int fmpi_mpi_exit(struct fmpi_mpi_ctx ** const ctx)
...
@@ -93,7 +93,7 @@ int fmpi_mpi_exit(struct fmpi_mpi_ctx ** const ctx)
if
(
fmpi_mpi_check_error
(
*
ctx
,
err_id
,
"MPI_Finalize"
)
==
true
)
{
if
(
fmpi_mpi_check_error
(
*
ctx
,
err_id
,
"MPI_Finalize"
)
==
true
)
{
err_id
=
-
1
;
err_id
=
-
1
;
}
}
free
(
*
ctx
);
*
ctx
=
NULL
;
//
free(*ctx); *ctx = NULL;
return
err_id
;
return
err_id
;
}
}
/*------------------------------------------------------------------------------
/*------------------------------------------------------------------------------
...
@@ -150,3 +150,15 @@ int fmpi_mpi_world_rank(const struct fmpi_mpi_ctx * const ctx)
...
@@ -150,3 +150,15 @@ int fmpi_mpi_world_rank(const struct fmpi_mpi_ctx * const ctx)
}
}
return
rank
;
return
rank
;
}
}
/*------------------------------------------------------------------------------
fmpi_mpi_finalized()
------------------------------------------------------------------------------*/
_Bool
fmpi_mpi_finalized
(
const
struct
fmpi_mpi_ctx
*
const
ctx
)
{
int
finalized
=
0
;
int
err_id
=
MPI_Finalized
(
&
finalized
);
if
(
ctx
!=
NULL
)
{
fmpi_mpi_check_error
(
ctx
,
err_id
,
"MPI_Finalized"
);
}
return
finalized
;
}
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