Skip to content

Commit

Permalink
Merge branch 'patch-1' of https://github.com/gsjaardema/netcdf-c into…
Browse files Browse the repository at this point in the history
… par-hang-fix
  • Loading branch information
WardF committed Oct 16, 2017
2 parents 4ac39ab + 6fb871f commit 98c169a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libdispatch/dvarput.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,19 @@ NCDEFAULT_put_vars(int ncid, int varid, const size_t * start,
if(mystride[i] != 1) isstride1 = 0;
nels *= myedges[i];
}
if(nels == 0)
return NC_NOERR; /* cannot write anything */

if(isstride1) {
return NC_put_vara(ncid, varid, mystart, myedges, value, memtype);
}

if(nels == 0) {
/* This should be here instead of before NC_put_vara call to
* avoid hang in parallel write for single stride.
* Still issue with parallel hang if stride > 1
*/
return NC_NOERR; /* cannot write anything */
}

/* Initial version uses and odometer to walk the variable
and read each value one at a time. This can later be optimized
to read larger chunks at a time.
Expand Down

0 comments on commit 98c169a

Please sign in to comment.