We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cf1a0b8 + 9ffc8d6 commit b533d4aCopy full SHA for b533d4a
libdispatch/dinfermodel.c
@@ -1254,6 +1254,7 @@ openmagic(struct MagicFile* file)
1254
else
1255
#endif
1256
status = NC_EPARINIT;
1257
+ file->fh = MPI_FILE_NULL;
1258
goto done;
1259
}
1260
/* Get its length */
@@ -1390,7 +1391,8 @@ closemagic(struct MagicFile* file)
1390
1391
#ifdef USE_PARALLEL
1392
if (file->use_parallel) {
1393
int retval;
- if((retval = MPI_File_close(&file->fh)) != MPI_SUCCESS)
1394
+ if(file->fh != MPI_FILE_NULL
1395
+ && (retval = MPI_File_close(&file->fh)) != MPI_SUCCESS)
1396
{status = NC_EPARINIT; return status;}
1397
} else
1398
0 commit comments