diff --git a/src/mpi/f77/group_free_f.c b/src/mpi/f77/group_free_f.c index 5b3c7aa04f..f803a28687 100644 --- a/src/mpi/f77/group_free_f.c +++ b/src/mpi/f77/group_free_f.c @@ -52,11 +52,12 @@ void mpi_group_free_f(MPI_Fint *group, MPI_Fint *ierr) ompi_group_t *c_group; /* Make the fortran to c representation conversion */ + c_group = MPI_Group_f2c(*group); - *ierr = MPI_Group_free( &c_group ); - if(*ierr == OMPI_SUCCESS) - *group = 0; + /* This value comes from the MPI_GROUP_NULL value in mpif.h. Do not + change without consulting mpif.h! */ + *group = 0; } diff --git a/src/mpi/f77/is_thread_main_f.c b/src/mpi/f77/is_thread_main_f.c index b301fce3f2..71e3a6f543 100644 --- a/src/mpi/f77/is_thread_main_f.c +++ b/src/mpi/f77/is_thread_main_f.c @@ -48,5 +48,5 @@ OMPI_GENERATE_F77_BINDINGS (MPI_IS_THREAD_MAIN, void mpi_is_thread_main_f(MPI_Fint *flag, MPI_Fint *ierr) { - *ierr = MPI_Is_thread_main( (int)flag ); + *ierr = MPI_Is_thread_main( flag ); } diff --git a/src/mpi/f77/request_free_f.c b/src/mpi/f77/request_free_f.c index 57b1040404..f72e5cbdbd 100644 --- a/src/mpi/f77/request_free_f.c +++ b/src/mpi/f77/request_free_f.c @@ -49,8 +49,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_REQUEST_FREE, void mpi_request_free_f(MPI_Fint *request, MPI_Fint *ierr) { MPI_Request c_req = MPI_Request_f2c( *request ); - *ierr = MPI_Request_free( &c_req ); - *request = (MPI_Fint)MPI_REQUEST_NULL; + /* This value comes from the MPI_REQUEST_NULL value in mpif.h. + Do not change without consulting mpif.h! */ + + *request = -1; } diff --git a/src/mpi/f77/type_free_f.c b/src/mpi/f77/type_free_f.c index 221bf5c0d1..7520c6894b 100644 --- a/src/mpi/f77/type_free_f.c +++ b/src/mpi/f77/type_free_f.c @@ -49,9 +49,10 @@ OMPI_GENERATE_F77_BINDINGS (MPI_TYPE_FREE, void mpi_type_free_f(MPI_Fint *type, MPI_Fint *ierr) { MPI_Datatype c_type = MPI_DATATYPE_NULL; - *ierr = MPI_Type_free(&c_type); - if( *ierr == MPI_SUCCESS ) - type = (MPI_Fint)MPI_DATATYPE_NULL; + /* This value comes from the MPI_DATATYPE_NULL value in mpif.h. + Do not change without consulting mpif.h! */ + + *type = -1; }