Skip to content
Snippets Groups Projects
Commit 6f781521 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel: Committed by Sergey Kosukhin
Browse files

Improve parallel access implementation error handling.

* Also fixes too late initialization of pointer.
parent 14ade388
No related branches found
No related tags found
2 merge requests!34Version 2.2.0,!13Consolidation with CDI-PIO (develop)
......@@ -35,18 +35,18 @@ cdiPio_nc__create(const char *path, int cmode, size_t initialsz, size_t *chunksi
int status, ioMode = commInqIOMode();
if (ioMode != PIO_NONE)
{
#ifdef NC_PNETCDF
#if !defined TLS && defined HAVE_PTHREAD
struct cdiPioNcCreateLongJmpRetBuf *cdiPioCdfJmpBuf = pthread_getspecific(cdiPioCdfJmpKey);
#endif
if (cmode & NC_NETCDF4)
{
cmode |= NC_MPIPOSIX;
status = nc_create_par(path, cmode, commInqCommColl(), MPI_INFO_NULL, ncidp);
cdiPioCdfJmpBuf->openRank = CDI_PIO_COLLECTIVE_OPEN;
if (status == NC_NOERR) cdiPioCdfJmpBuf->openRank = CDI_PIO_COLLECTIVE_OPEN;
}
else
{
#ifdef NC_PNETCDF
#if !defined TLS && defined HAVE_PTHREAD
struct cdiPioNcCreateLongJmpRetBuf *cdiPioCdfJmpBuf = pthread_getspecific(cdiPioCdfJmpKey);
#endif
/* which combination of cmode flags has already been tested? */
static bool pnetcdfWontWork[] = {
false, /* CDF-1 */
......@@ -58,9 +58,9 @@ cdiPio_nc__create(const char *path, int cmode, size_t initialsz, size_t *chunksi
if (cmode & NC_64BIT_OFFSET)
cdfIdx = 1;
else if (cmode & NC_CLASSIC_MODEL)
cdfIdx = 2;
else
cdfIdx = 0;
else
cdfIdx = 2;
MPI_Comm collComm = commInqCommColl();
int rank = commInqRankColl();
cmode |= NC_PNETCDF;
......@@ -76,7 +76,7 @@ cdiPio_nc__create(const char *path, int cmode, size_t initialsz, size_t *chunksi
cdfVers[cdfIdx]);
pnetcdfWontWork[cdfIdx] = true;
}
else
else if (status == NC_NOERR)
cdiPioCdfJmpBuf->openRank = CDI_PIO_COLLECTIVE_OPEN;
}
if (pnetcdfWontWork[cdfIdx])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment