Skip to content

Commit

Permalink
implement MPI_Finalized
Browse files Browse the repository at this point in the history
  • Loading branch information
aumuell committed Jan 3, 2024
1 parent a1a8934 commit 27be8f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/****************************************************************************/

static int initialized=0;
static int finalized=0;


/* Store fortran pointer values here */
Expand Down Expand Up @@ -185,6 +186,7 @@ int MPI_Init(int *argc, char **argv[])
FC_FUNC(mpi_get_fort_pointers,MPI_GET_FORT_POINTERS)(); // the () are important

initialized=1;
finalized=0;
return(MPI_SUCCESS);
}

Expand All @@ -211,6 +213,7 @@ int FC_FUNC( mpi_finalize, MPI_FINALIZE )(int *ierror)
int MPI_Finalize(void)
{
initialized=0;
finalized=1;

mpi_destroy_handles();

Expand All @@ -220,6 +223,13 @@ int MPI_Finalize(void)

/*********/

int MPI_Finalized( int *flag )
{
*flag = finalized;
return(MPI_SUCCESS);
}



int FC_FUNC( mpi_abort , MPI_ABORT )(int *comm, int *errorcode, int *ierror)
{
Expand Down
1 change: 1 addition & 0 deletions mpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ extern MPI_Fint MPI_Group_c2f(MPI_Group group);

extern int MPI_Init(int *argc, char **argv[]) ;
extern int MPI_Finalize(void);
extern int MPI_Finalized(int *flag);
extern int MPI_Abort(MPI_Comm comm, int errorcode);
extern int MPI_Error_string(int errorcode, char *string, int *resultlen);
extern int MPI_Get_processor_name(char *name, int *resultlen);
Expand Down

0 comments on commit 27be8f8

Please sign in to comment.