mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
This commit is contained in:
commit
97f80ae3f8
@ -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 */
|
||||
|
@ -27,9 +27,13 @@ IF(LARGE_FILE_TESTS)
|
||||
ENDIF()
|
||||
|
||||
IF(BUILD_DISKLESS)
|
||||
SET(TESTS ${TESTS} tst_diskless tst_diskless3 tst_diskless4)
|
||||
#SET(TESTS ${TESTS} tst_diskless tst_diskless3 tst_diskless4)
|
||||
add_bin_test_no_prefix(tst_diskless)
|
||||
add_bin_test_no_prefix(tst_diskless3)
|
||||
add_bin_test_no_prefix(tst_diskless4)
|
||||
IF(USE_NETCDF4)
|
||||
SET(TESTS ${TESTS} tst_diskless2)
|
||||
add_bin_test_no_prefix(tst_diskless2)
|
||||
#SET(TESTS ${TESTS} tst_diskless2)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@ -47,3 +51,7 @@ IF(BUILD_DISKLESS)
|
||||
add_sh_test(nc_test run_diskless)
|
||||
#ADD_TEST(run_diskless ${CMAKE_CURRENT_SOURCE_DIR}/run_diskless.sh ${CMAKE_CFG_INTDIR}/run_diskless)
|
||||
ENDIF()
|
||||
|
||||
FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.sh ${CMAKE_CURRENT_SOURCE_DIR}/*.nc ${CMAKE_CURRENT_SOURCE_DIR}/*.cdl ${CMAKE_CURRENT_SOURCE_DIR}/*.trs)
|
||||
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/ FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user