Commit 395256e4 authored by Keith Bennett's avatar Keith Bennett

Fix bug when calling MPI_INFO_GET_NKEYS

The error code from MPI_FILE_GET_INFO has to be checked before
attempting to call MPI_INFO_GET_NKEYS
parent 844ee935
......@@ -905,17 +905,19 @@ CONTAINS
IF (filehandle > 0) THEN
CALL MPI_FILE_GET_INFO(filehandle, info, ierr)
CALL MPI_INFO_GET_NKEYS(info, nkeys, ierr)
IF (nkeys > 0) THEN
WRITE(0,*) 'Info:'
DO i = 0,nkeys-1
CALL MPI_INFO_GET_NTHKEY(info, i, key, ierr)
CALL MPI_INFO_GET(info, key, MPI_MAX_INFO_VAL, info_value, &
found, ierr)
WRITE(0,'(10X,A,": ",A)') TRIM(key), TRIM(info_value)
END DO
IF (ierr == 0) THEN
CALL MPI_INFO_GET_NKEYS(info, nkeys, ierr)
IF (nkeys > 0) THEN
WRITE(0,*) 'Info:'
DO i = 0,nkeys-1
CALL MPI_INFO_GET_NTHKEY(info, i, key, ierr)
CALL MPI_INFO_GET(info, key, MPI_MAX_INFO_VAL, info_value, &
found, ierr)
WRITE(0,'(10X,A,": ",A)') TRIM(key), TRIM(info_value)
END DO
END IF
CALL MPI_INFO_FREE(info, ierr)
END IF
CALL MPI_INFO_FREE(info, ierr)
END IF
END IF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment