Corrected an issue I introduced which broke a particular parallel test.

This commit is contained in:
Ward Fisher 2013-02-12 21:27:52 +00:00
parent 70186d5329
commit 5703c0979e

View File

@ -1262,8 +1262,7 @@ nc4_put_vara_tc(int ncid, int varid, nc_type mem_type, int mem_type_is_long,
#ifdef USE_PNETCDF
NC_HDF5_FILE_INFO_T *h5;
#endif
int res = -1;
LOG((2, "nc4_put_vara_tc: ncid 0x%x varid %d mem_type %d mem_type_is_long %d",
ncid, varid, mem_type, mem_type_is_long));
@ -1281,8 +1280,8 @@ nc4_put_vara_tc(int ncid, int varid, nc_type mem_type, int mem_type_is_long,
MPI_Offset *mpi_count;
int d;
mpi_start = (MPI_Offset*)malloc(sizeof(MPI_Offset)*h5->pnetcdf_ndims[varid]);
mpi_count = (MPI_Offset*)malloc(sizeof(MPI_Offset)*h5->pnetcdf_ndims[varid]);
mpi_start = (MPI_Offset*)alloca(sizeof(MPI_Offset)*h5->pnetcdf_ndims[varid]);
mpi_count = (MPI_Offset*)alloca(sizeof(MPI_Offset)*h5->pnetcdf_ndims[varid]);
/* No NC_LONGs for parallel-netcdf library! */
if (mem_type_is_long)
@ -1301,22 +1300,22 @@ nc4_put_vara_tc(int ncid, int varid, nc_type mem_type, int mem_type_is_long,
switch(mem_type)
{
case NC_BYTE:
res = ncmpi_put_vara_schar(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_schar(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_UBYTE:
res = ncmpi_put_vara_uchar(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_uchar(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_CHAR:
res = ncmpi_put_vara_text(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_text(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_SHORT:
res = ncmpi_put_vara_short(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_short(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_INT:
res = ncmpi_put_vara_int(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_int(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_FLOAT:
res = ncmpi_put_vara_float(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_float(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_DOUBLE:
res = ncmpi_put_vara_double(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_double(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_NAT:
default:
res = NC_EBADTYPE;
return NC_EBADTYPE;
}
}
else
@ -1324,27 +1323,26 @@ nc4_put_vara_tc(int ncid, int varid, nc_type mem_type, int mem_type_is_long,
switch(mem_type)
{
case NC_BYTE:
res = ncmpi_put_vara_schar_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_schar_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_UBYTE:
res = ncmpi_put_vara_uchar_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_uchar_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_CHAR:
res = ncmpi_put_vara_text_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_text_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_SHORT:
res = ncmpi_put_vara_short_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_short_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_INT:
res = ncmpi_put_vara_int_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_int_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_FLOAT:
res = ncmpi_put_vara_float_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_float_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_DOUBLE:
res = ncmpi_put_vara_double_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
return ncmpi_put_vara_double_all(nc->int_ncid, varid, mpi_start, mpi_count, op);
case NC_NAT:
default:
res = NC_EBADTYPE;
return NC_EBADTYPE;
}
}
free(mpi_start); mpi_start = NULL;
free(mpi_count); mpi_count = NULL;
return res;
return NC_EBADTYPE;
}
#endif /* USE_PNETCDF */