added a test for existing datasets to write calls
This commit is contained in:
@@ -1411,6 +1411,9 @@ _H5Block_write_data (
|
||||
struct H5BlockStruct *b = f->block;
|
||||
|
||||
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||
htri_t exists = H5Lexists ( b->field_group_id, name, H5P_DEFAULT );
|
||||
if ( exists > 0 ) return HANDLE_H5D_EXISTS_ERR ( name, f->timestep );
|
||||
|
||||
dataset = H5Dcreate2 (
|
||||
b->field_group_id,
|
||||
name,
|
||||
|
||||
+9
-3
@@ -57,7 +57,7 @@
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
|
||||
#define HALO_EXCHANGE_METHOD _halo_exchange_buffers
|
||||
#define HALO_EXCHANGE_METHOD _halo_exchange_vectors
|
||||
|
||||
/*******************************************************************************
|
||||
* Static functions
|
||||
@@ -176,8 +176,8 @@ _nth_root_int_divisor (const int m, const int n)
|
||||
int i, root;
|
||||
double p;
|
||||
|
||||
p = 1.0 / (double) n;
|
||||
root = (int) ceil ( pow ((double) m, p) );
|
||||
p = 1.0 / (double)n;
|
||||
root = (int) ceil ( pow ( (double)m, p ) );
|
||||
for (i=root; i<=m; i++)
|
||||
{
|
||||
if (m % i == 0) return i;
|
||||
@@ -541,6 +541,9 @@ _halo_exchange_buffers (
|
||||
|
||||
struct H5MultiBlockStruct *mb = f->multiblock;
|
||||
|
||||
if ( f->myproc == 0 ) _H5Part_print_info (
|
||||
"Using halo exchange method _halo_exchange_buffers");
|
||||
|
||||
bufsize = count * blocklen;
|
||||
ibufsize = (int)bufsize;
|
||||
if ( (h5part_int64_t)ibufsize != bufsize ) return HANDLE_MPI_INT64_ERR;
|
||||
@@ -599,6 +602,9 @@ _halo_exchange_vectors (
|
||||
h5part_int64_t herr;
|
||||
MPI_Datatype halo_vector;
|
||||
|
||||
if ( f->myproc == 0 ) _H5Part_print_info (
|
||||
"Using halo exchange method _halo_exchange_vectors");
|
||||
|
||||
icount = (int)count;
|
||||
if ( (h5part_int64_t)icount != count ) return HANDLE_MPI_INT64_ERR;
|
||||
|
||||
|
||||
@@ -744,6 +744,9 @@ _write_data (
|
||||
name, (long long)f->timestep );
|
||||
|
||||
#if H5_VERS_MAJOR == 1 && H5_VERS_MINOR == 8
|
||||
htri_t exists = H5Lexists ( f->timegroup, name, H5P_DEFAULT );
|
||||
if ( exists > 0 ) return HANDLE_H5D_EXISTS_ERR ( name, f->timestep );
|
||||
|
||||
dataset_id = H5Dcreate2 (
|
||||
f->timegroup,
|
||||
name,
|
||||
|
||||
@@ -165,6 +165,13 @@
|
||||
"Cannot create dataset for name \"%s\", step \"%lld\".", \
|
||||
s, (long long) n );
|
||||
|
||||
#define HANDLE_H5D_EXISTS_ERR( s, n ) \
|
||||
(*_err_handler) ( \
|
||||
_H5Part_get_funcname(), \
|
||||
H5PART_ERR_HDF5, \
|
||||
"Dataset already exists with name \"%s\", step \"%lld\".", \
|
||||
s, (long long) n );
|
||||
|
||||
#define HANDLE_H5D_GET_SPACE_ERR \
|
||||
(*_err_handler) ( \
|
||||
_H5Part_get_funcname(), \
|
||||
|
||||
Reference in New Issue
Block a user