Skip to content

Commit 1c7231f

Browse files
committed
toint fixes
thanks to dalcinl ! Signed-off-by: Howard Pritchard <[email protected]>
1 parent 14a52c6 commit 1c7231f

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

ompi/mpi/c/comm_toint_ompi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int MPI_Comm_toint(MPI_Comm comm)
4242

4343
if ( MPI_PARAM_CHECK ) {
4444
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
45-
if (ompi_comm_invalid(comm)) {
45+
if ((comm != MPI_COMM_NULL) && ompi_comm_invalid(comm)) {
4646
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COMM, FUNC_NAME);
4747
}
4848
}

ompi/mpi/c/file_toint_abi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ int MPI_File_toint(MPI_File_ABI_INTERNAL file)
4343
{
4444
int o_index;
4545
ompi_file_t *file_ptr;
46+
MPI_File file_tmp;
4647

4748
if ( MPI_PARAM_CHECK ) {
4849
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
49-
if (NULL == file) {
50+
file_tmp = ompi_convert_abi_file_intern_file(file);
51+
if ((file_tmp != MPI_FILE_NULL) && ompi_file_invalid(file_tmp)) {
5052
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_FILE, FUNC_NAME);
5153
}
5254
}

ompi/mpi/c/file_toint_ompi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int MPI_File_toint(MPI_File file)
4242

4343
if ( MPI_PARAM_CHECK ) {
4444
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
45-
if (NULL == file) {
45+
if ((file != MPI_FILE_NULL) && ompi_file_invalid(file)) {
4646
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_FILE, FUNC_NAME);
4747
}
4848
}

ompi/mpi/c/win_toint_ompi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ int MPI_Win_toint(MPI_Win win)
4242

4343
if ( MPI_PARAM_CHECK ) {
4444
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
45-
if (ompi_win_invalid(win) && MPI_WIN_NULL != win) {
46-
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_WIN, FUNC_NAME);
45+
if ((MPI_WIN_NULL != win) && ompi_win_invalid(win)) {
46+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_WIN, FUNC_NAME);
4747
}
4848
}
4949

0 commit comments

Comments
 (0)