finished fixes
@@ -195,23 +195,16 @@ nc4_create_file(const char *path, int cmode, size_t initialsz,
H5P_CRT_ORDER_INDEXED)) < 0)
BAIL(NC_EHDFERR);
- /* Create the file. */
#ifdef HDF5_HAS_COLL_METADATA_OPS
- H5Pset_all_coll_metadata_ops(fapl_id, 1 );
- H5Pset_coll_metadata_write(fapl_id, 1);
+ /* If HDF5 supports collective metadata operations, turn them
+ * on. This is only relevant for parallel I/O builds of HDF5. */
+ if (H5Pset_all_coll_metadata_ops(fapl_id, 1) < 0)
+ BAIL(NC_EHDFERR);
+ if (H5Pset_coll_metadata_write(fapl_id, 1) < 0)
+ BAIL(NC_EHDFERR);
#endif
if(nc4_info->mem.inmemory) {
-#if 0
- if(nc4_info->mem.memio.size == 0)
- nc4_info->memio.size = DEFAULT_CREATE_MEMSIZE; /* last ditch fix */
- if(nc4_info->memio.memory == NULL) { /* last ditch fix */
- nc4_info->memio.memory = malloc(nc4_info->memio.size);
- if(nc4_info->memio.memory == NULL)
- BAIL(NC_ENOMEM);
- }
- assert(nc4_info->memio.size > 0 && nc4_info->memio.memory != NULL);
-#endif
retval = NC4_create_image_file(nc4_info,initialsz);
if(retval)
BAIL(retval);
@@ -251,8 +244,10 @@ exit: /*failure exit*/
if (comm_duped) MPI_Comm_free(&nc4_info->comm);
if (info_duped) MPI_Info_free(&nc4_info->info);
#endif
- if (fapl_id != H5P_DEFAULT) H5Pclose(fapl_id);
- if(!nc4_info) return retval;
+ if (fapl_id != H5P_DEFAULT)
+ H5Pclose(fapl_id);
+ if (!nc4_info)
+ return retval;
nc4_close_netcdf4_file(nc4_info, 1, 0); /* treat like abort */
return retval;
}
