summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-03-17 21:40:23 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-03-17 21:40:23 (GMT)
commitaa5578c53a47f75c29a8199fd17be51e96325e32 (patch)
treeb65ba22cc78ca7b5dbb9bd7005b1aeb69e6c65ec
parent570271da6ab1504bb9b86e8fbb6d839277ec3aa8 (diff)
downloadhdf5-aa5578c53a47f75c29a8199fd17be51e96325e32.zip
hdf5-aa5578c53a47f75c29a8199fd17be51e96325e32.tar.gz
hdf5-aa5578c53a47f75c29a8199fd17be51e96325e32.tar.bz2
[svn-r24815] Skip over TR0 in file_create.
Use TR1 to create root group and co. update examples (still missing demo programs).
-rw-r--r--examples/h5ff_client_analysis.c12
-rw-r--r--examples/h5ff_client_attr.c24
-rw-r--r--examples/h5ff_client_dset.c22
-rw-r--r--examples/h5ff_client_evict_deltas.c26
-rw-r--r--examples/h5ff_client_links.c18
-rw-r--r--examples/h5ff_client_map.c38
-rw-r--r--examples/h5ff_client_multiple_cont.c26
-rw-r--r--examples/h5ff_client_obj.c20
-rw-r--r--examples/h5ff_client_prefetch.c36
-rw-r--r--examples/h5ff_client_view.c18
-rw-r--r--examples/h5ff_client_vl_data.c16
-rw-r--r--src/H5VLiod_file.c19
12 files changed, 145 insertions, 130 deletions
diff --git a/examples/h5ff_client_analysis.c b/examples/h5ff_client_analysis.c
index df375f1..8b7bd1e 100644
--- a/examples/h5ff_client_analysis.c
+++ b/examples/h5ff_client_analysis.c
@@ -80,13 +80,13 @@ write_dataset(const char *file_name, const char *dataset_name,
assert(0 == ret);
#ifndef USE_NATIVE
- /* acquire container version 0 - EXACT. */
- version = 0;
+ /* acquire container version 1 - EXACT. */
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
trspl_id = H5Pcreate(H5P_TR_START);
@@ -186,11 +186,11 @@ write_dataset(const char *file_name, const char *dataset_name,
assert(0 == ret);
#ifndef USE_NATIVE
- /* Finish transaction 1. */
+ /* Finish transaction 2. */
ret = H5TRfinish(tid1, H5P_DEFAULT, NULL, H5_EVENT_STACK_NULL);
assert(0 == ret);
- /* release container version 0. */
+ /* release container version 1. */
ret = H5RCrelease(rid1, H5_EVENT_STACK_NULL);
assert(0 == ret);
diff --git a/examples/h5ff_client_attr.c b/examples/h5ff_client_attr.c
index 095d1bd..572c721 100644
--- a/examples/h5ff_client_attr.c
+++ b/examples/h5ff_client_attr.c
@@ -95,21 +95,21 @@ int main(int argc, char **argv) {
ret = H5Tset_strpad(stype_id, H5T_STR_NULLTERM ); assert( ret == 0 );
ret = H5Tset_size(stype_id, 128); assert( ret == 0 );
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
- /* start transaction 1 with default Leader/Delegate model. Leader
+ /* start transaction 2 with default Leader/Delegate model. Leader
which is rank 0 here starts the transaction. It can be
asynchronous, but we make it synchronous here so that the
Leader can tell its delegates that the transaction is
started. */
if(0 == my_rank) {
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -182,7 +182,7 @@ int main(int argc, char **argv) {
assert(0 == ret);
}
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -193,7 +193,7 @@ int main(int argc, char **argv) {
if(0 == my_rank) {
/* create transaction object */
- tid2 = H5TRcreate(file_id, rid2, (uint64_t)2);
+ tid2 = H5TRcreate(file_id, rid2, (uint64_t)3);
assert(tid1);
ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -227,11 +227,11 @@ int main(int argc, char **argv) {
ret = H5TRclose(tid2);
assert(0 == ret);
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid2, e_stack);
assert(0 == ret);
- version = 2;
+ version = 3;
}
H5ESget_count(e_stack, &num_events);
@@ -239,13 +239,13 @@ int main(int argc, char **argv) {
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
- /* Tell other procs that container version 2 is acquired */
+ /* Tell other procs that container version 3 is acquired */
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
/* other processes just create a read context object; no need to
acquire it */
if(0 != my_rank) {
- assert(2 == version);
+ assert(3 == version);
rid3 = H5RCcreate(file_id, version);
assert(rid3 > 0);
}
@@ -287,7 +287,7 @@ int main(int argc, char **argv) {
MPI_Barrier(MPI_COMM_WORLD);
if(my_rank == 0) {
- /* release container version 2. This is async. */
+ /* release container version 3. This is async. */
ret = H5RCrelease(rid3, e_stack);
assert(0 == ret);
}
diff --git a/examples/h5ff_client_dset.c b/examples/h5ff_client_dset.c
index 181a619..5b36c79 100644
--- a/examples/h5ff_client_dset.c
+++ b/examples/h5ff_client_dset.c
@@ -131,15 +131,15 @@ int main(int argc, char **argv) {
dtid = H5Tcopy(H5T_STD_I32LE);
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
/* start transaction 1 with default Leader/Delegate model. Leader
@@ -148,7 +148,7 @@ int main(int argc, char **argv) {
Leader can tell its delegates that the transaction is
started. */
if(0 == my_rank) {
- trans_num = 1;
+ trans_num = 2;
ret = H5TRstart(tid1, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
@@ -216,11 +216,11 @@ int main(int argc, char **argv) {
MPI_Ibcast(dset_token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[5]);
}
- /* Leader can continue writing to transaction 1,
+ /* Leader can continue writing to transaction 2,
while others wait for the ibcast to complete */
if(0 != my_rank) {
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
- assert(1 == trans_num);
+ assert(2 == trans_num);
/* recieve the token sizes */
MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]);
@@ -318,7 +318,7 @@ int main(int argc, char **argv) {
ret = H5TRclose(tid1);
assert(0 == ret);
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -328,8 +328,8 @@ int main(int argc, char **argv) {
H5ESclear(e_stack);
assert(status == H5ES_STATUS_SUCCEED);
- /* Tell other procs that container version 1 is acquired */
- version = 1;
+ /* Tell other procs that container version 2 is acquired */
+ version = 2;
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
/* other processes just create a read context object; no need to
@@ -558,7 +558,7 @@ int main(int argc, char **argv) {
MPI_Barrier(MPI_COMM_WORLD);
if(my_rank == 0) {
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid2, e_stack);
assert(0 == ret);
}
diff --git a/examples/h5ff_client_evict_deltas.c b/examples/h5ff_client_evict_deltas.c
index 65347a4..b6afd3c 100644
--- a/examples/h5ff_client_evict_deltas.c
+++ b/examples/h5ff_client_evict_deltas.c
@@ -88,12 +88,12 @@ int main(int argc, char **argv) {
sid = H5Screate_simple(1, dims, NULL);
dtid = H5Tcopy(H5T_STD_I32LE);
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* start transaction 1 with default Leader/Delegate model. Leader
which is rank 0 here starts the transaction. It can be
@@ -104,7 +104,7 @@ int main(int argc, char **argv) {
hid_t rid_temp;
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -153,7 +153,7 @@ int main(int argc, char **argv) {
assert(0 == ret);
/* create transaction object */
- tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)2);
+ tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)3);
assert(tid2);
ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -169,16 +169,16 @@ int main(int argc, char **argv) {
assert(H5Tclose_ff(dtid, e_stack) == 0);
assert(H5Dclose_ff(did, e_stack) == 0);
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid_temp, e_stack);
assert(0 == ret);
ret = H5RCclose(rid_temp);
assert(0 == ret);
- version = 2;
+ version = 3;
}
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -198,7 +198,7 @@ int main(int argc, char **argv) {
/* Process 0 tells other procs that container version 2 is acquired */
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
- assert(2 == version);
+ assert(3 == version);
/* other processes just create a read context object; no need to
acquire it */
@@ -227,13 +227,13 @@ int main(int argc, char **argv) {
if((my_size > 1 && 1 == my_rank) ||
(my_size == 1 && 0 == my_rank)) {
- ret = H5Tevict_ff(dtid, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ ret = H5Tevict_ff(dtid, 3, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
- ret = H5Devict_ff(did, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ ret = H5Devict_ff(did, 3, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
- ret = H5Mevict_ff(map, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ ret = H5Mevict_ff(map, 3, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
/* see if we can read after evicting */
@@ -254,7 +254,7 @@ int main(int argc, char **argv) {
MPI_Barrier(MPI_COMM_WORLD);
if(my_rank == 0) {
- /* release container version 2. This is async. */
+ /* release container version 3. This is async. */
ret = H5RCrelease(rid2, e_stack);
assert(0 == ret);
}
diff --git a/examples/h5ff_client_links.c b/examples/h5ff_client_links.c
index 390bbd4..44fe902 100644
--- a/examples/h5ff_client_links.c
+++ b/examples/h5ff_client_links.c
@@ -84,12 +84,12 @@ int main(int argc, char **argv) {
sid = H5Screate_simple(1, dims, NULL);
dtid = H5Tcopy(H5T_STD_I32LE);
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* start transaction 1 with default Leader/Delegate model. Leader
which is rank 0 here starts the transaction. It can be
@@ -98,7 +98,7 @@ int main(int argc, char **argv) {
started. */
if(0 == my_rank) {
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -130,7 +130,7 @@ int main(int argc, char **argv) {
assert(0 == ret);
/* create transaction object */
- tid2 = H5TRcreate(file_id, rid2, (uint64_t)2);
+ tid2 = H5TRcreate(file_id, rid2, (uint64_t)3);
assert(tid2);
ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -194,10 +194,10 @@ int main(int argc, char **argv) {
assert(H5Gclose_ff(gid5, e_stack) == 0);
assert(H5Dclose_ff(did1, e_stack) == 0);
assert(H5Dclose_ff(did3, e_stack) == 0);
- version = 2;
+ version = 3;
}
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -214,7 +214,7 @@ int main(int argc, char **argv) {
/* other processes just create a read context object; no need to
acquire it */
if(0 != my_rank) {
- assert(2 == version);
+ assert(3 == version);
rid3 = H5RCcreate(file_id, version);
assert(rid3 > 0);
}
@@ -263,7 +263,7 @@ int main(int argc, char **argv) {
}
if(0 == my_rank) {
- /* release container version 1. This is async. */
+ /* release container version 3. This is async. */
ret = H5RCrelease(rid3, H5_EVENT_STACK_NULL);
assert(0 == ret);
diff --git a/examples/h5ff_client_map.c b/examples/h5ff_client_map.c
index a1fa6f0..c248ab0 100644
--- a/examples/h5ff_client_map.c
+++ b/examples/h5ff_client_map.c
@@ -111,26 +111,26 @@ int main(int argc, char **argv) {
file_id = H5Fcreate_ff(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id, H5_EVENT_STACK_NULL);
assert(file_id > 0);
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
MPI_Barrier(MPI_COMM_WORLD);
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
- /* start transaction 1 with default Leader/Delegate model. Leader
+ /* start transaction 2 with default Leader/Delegate model. Leader
which is rank 0 here starts the transaction. It can be
asynchronous, but we make it synchronous here so that the
Leader can tell its delegates that the transaction is
started. */
if(0 == my_rank) {
- trans_num = 1;
+ trans_num = 2;
ret = H5TRstart(tid1, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
@@ -228,7 +228,7 @@ int main(int argc, char **argv) {
/* this wait if for the transaction start */
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
- assert(1 == trans_num);
+ assert(2 == trans_num);
/* recieve the token sizes */
MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]);
@@ -282,7 +282,7 @@ int main(int argc, char **argv) {
ret = H5TRclose(tid1);
assert(0 == ret);
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -291,9 +291,9 @@ int main(int argc, char **argv) {
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
- /* Leader process tells delegates that container version 1 is acquired */
- version = 1;
- MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
+ /* Leader process tells delegates that container version 2 is acquired */
+ version = 2;
+ MPI_Bcast(&version, 2, MPI_UINT64_T, 0, MPI_COMM_WORLD);
/* delegates just create a read context object; no need to acquire
it, since it has been acquired by the leader. */
@@ -315,8 +315,8 @@ int main(int argc, char **argv) {
ret = H5Mexists_ff(map1, H5T_STD_I32LE, &key, &exists, rid2, e_stack);
assert(ret == 0);
- /* create & start transaction 2 with Multiple Leader - No Delegate Model. */
- tid2 = H5TRcreate(file_id, rid2, (uint64_t)2);
+ /* create & start transaction 3 with Multiple Leader - No Delegate Model. */
+ tid2 = H5TRcreate(file_id, rid2, (uint64_t)3);
assert(tid2);
trspl_id = H5Pcreate (H5P_TR_START);
ret = H5Pset_trspl_num_peers(trspl_id, my_size);
@@ -342,7 +342,7 @@ int main(int argc, char **argv) {
assert(H5Gclose_ff(temp_id, H5_EVENT_STACK_NULL) ==0);
}
- /* finish transaction 2 */
+ /* finish transaction 3 */
if(my_rank == 0) {
ret = H5TRabort(tid2, H5_EVENT_STACK_NULL);
assert(0 == ret);
@@ -372,8 +372,8 @@ int main(int argc, char **argv) {
/* Barrier so all processes are guranteed to have finished/aborted transaction 2 */
MPI_Barrier(MPI_COMM_WORLD);
- /* acquire container version 2 - EXACT (Should Fail since 2 is aborted) */
- version = 2;
+ /* acquire container version 3 - EXACT (Should Fail since 2 is aborted) */
+ version = 3;
rid3 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(rid3 < 0);
@@ -442,7 +442,7 @@ int main(int argc, char **argv) {
assert(H5Mclose_ff(map3, e_stack) == 0);
if(my_rank == 0) {
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid2, e_stack);
assert(0 == ret);
}
@@ -458,9 +458,9 @@ int main(int argc, char **argv) {
on the container. */
assert(H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL) == 0);
- fprintf(stderr, "\n*****************************************************************************************************************\n");
+ fprintf(stderr, "\n*******************************************************************\n");
fprintf(stderr, "Wait on everything in ES and check Results of operations in ES\n");
- fprintf(stderr, "*****************************************************************************************************************\n");
+ fprintf(stderr, "\n*******************************************************************\n");
H5ESget_count(e_stack, &num_events);
diff --git a/examples/h5ff_client_multiple_cont.c b/examples/h5ff_client_multiple_cont.c
index d7d54f1..42b32a0 100644
--- a/examples/h5ff_client_multiple_cont.c
+++ b/examples/h5ff_client_multiple_cont.c
@@ -108,19 +108,19 @@ int main(int argc, char **argv) {
fid2 = H5Fcreate(file_name2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
assert(fid2);
- /* acquire container version 0 on both containers - EXACT
+ /* acquire container version 1 on both containers - EXACT
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(fid1, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
rid2 = H5RCacquire(fid2, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* create transaction objects */
- tid1 = H5TRcreate(fid1, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(fid1, rid1, (uint64_t)2);
assert(tid1);
- tid2 = H5TRcreate(fid2, rid2, (uint64_t)1);
+ tid2 = H5TRcreate(fid2, rid2, (uint64_t)2);
assert(tid2);
/* start transaction 1 with default Leader/Delegate model. Leader
@@ -154,7 +154,7 @@ int main(int argc, char **argv) {
H5Dwrite_ff(did1, dtid1, sid, sid, H5P_DEFAULT, wdata1, tid1, e_stack);
H5Dwrite_ff(did2, dtid2, sid, sid, H5P_DEFAULT, wdata2, tid2, e_stack);
- trans_num = 1;
+ trans_num = 2;
}
/* Tell other procs that transaction 1 is started */
@@ -228,7 +228,7 @@ int main(int argc, char **argv) {
/* this wait if for the transaction start */
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
- assert(1 == trans_num);
+ assert(2 == trans_num);
/* recieve the token sizes */
MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]);
@@ -297,7 +297,7 @@ int main(int argc, char **argv) {
ret = H5TRclose(tid2);
assert(0 == ret);
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, H5_EVENT_STACK_NULL);
assert(0 == ret);
ret = H5RCrelease(rid2, H5_EVENT_STACK_NULL);
@@ -308,11 +308,11 @@ int main(int argc, char **argv) {
ret = H5RCclose(rid2);
assert(0 == ret);
- version = 1;
+ version = 2;
rid1 = H5RCacquire(fid1, &version, H5P_DEFAULT, e_stack);
- assert(1 == version);
+ assert(2 == version);
rid2 = H5RCacquire(fid2, &version, H5P_DEFAULT, e_stack);
- assert(1 == version);
+ assert(2 == version);
{
hid_t dxpl_id;
@@ -348,7 +348,7 @@ int main(int argc, char **argv) {
}
MPI_Barrier(MPI_COMM_WORLD);
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
ret = H5RCrelease(rid2, e_stack);
diff --git a/examples/h5ff_client_obj.c b/examples/h5ff_client_obj.c
index 59e64f6..a47f7f2 100644
--- a/examples/h5ff_client_obj.c
+++ b/examples/h5ff_client_obj.c
@@ -82,11 +82,11 @@ int main(int argc, char **argv) {
/* acquire container version 0 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
- /* start transaction 1 with default Leader/Delegate model. Leader
+ /* start transaction 2 with default Leader/Delegate model. Leader
which is rank 0 here starts the transaction. It can be
asynchronous, but we make it synchronous here so that the
Leader can tell its delegates that the transaction is
@@ -96,7 +96,7 @@ int main(int argc, char **argv) {
hid_t anon_did;
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -140,7 +140,7 @@ int main(int argc, char **argv) {
assert(0 == ret);
/* create transaction object */
- tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)2);
+ tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)3);
assert(tid2);
ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -162,10 +162,10 @@ int main(int argc, char **argv) {
ret = H5RCclose(rid_temp);
assert(0 == ret);
- version = 2;
+ version = 3;
}
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -184,9 +184,9 @@ int main(int argc, char **argv) {
MPI_Barrier(MPI_COMM_WORLD);
- /* Process 0 tells other procs that container version 1 is acquired */
+ /* Process 0 tells other procs that container version 3 is acquired */
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
- assert(2 == version);
+ assert(3 == version);
/* other processes just create a read context object; no need to
acquire it */
@@ -259,7 +259,7 @@ int main(int argc, char **argv) {
assert(ret == 0);
if(my_rank == 0) {
- /* release container version 1. This is async. */
+ /* release container version 3. This is async. */
ret = H5RCrelease(rid2, e_stack);
assert(0 == ret);
}
diff --git a/examples/h5ff_client_prefetch.c b/examples/h5ff_client_prefetch.c
index 50a627b..a808c1f 100644
--- a/examples/h5ff_client_prefetch.c
+++ b/examples/h5ff_client_prefetch.c
@@ -88,14 +88,14 @@ int main(int argc, char **argv) {
sid = H5Screate_simple(1, dims, NULL);
dtid = H5Tcopy(H5T_STD_I32LE);
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
- /* start transaction 1 with default Leader/Delegate model. Leader
+ /* start transaction 2 with default Leader/Delegate model. Leader
which is rank 0 here starts the transaction. It can be
asynchronous, but we make it synchronous here so that the
Leader can tell its delegates that the transaction is
@@ -104,7 +104,7 @@ int main(int argc, char **argv) {
hid_t rid_temp;
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -153,7 +153,7 @@ int main(int argc, char **argv) {
assert(0 == ret);
/* create transaction object */
- tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)2);
+ tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)3);
assert(tid2);
ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
assert(0 == ret);
@@ -169,16 +169,16 @@ int main(int argc, char **argv) {
assert(H5Tclose_ff(dtid, e_stack) == 0);
assert(H5Dclose_ff(did, e_stack) == 0);
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid_temp, e_stack);
assert(0 == ret);
ret = H5RCclose(rid_temp);
assert(0 == ret);
- version = 2;
+ version = 3;
}
- /* release container version 0. This is async. */
+ /* release container version 1. This is async. */
ret = H5RCrelease(rid1, e_stack);
assert(0 == ret);
@@ -188,9 +188,9 @@ int main(int argc, char **argv) {
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
- /* Process 0 tells other procs that container version 2 is acquired */
+ /* Process 0 tells other procs that container version 3 is acquired */
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
- assert(2 == version);
+ assert(3 == version);
/* other processes just create a read context object; no need to
acquire it */
@@ -223,13 +223,13 @@ int main(int argc, char **argv) {
if((my_size > 1 && 1 == my_rank) ||
(my_size == 1 && 0 == my_rank)) {
- ret = H5Tevict_ff(dtid, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ ret = H5Tevict_ff(dtid, 3, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
- ret = H5Devict_ff(did, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ ret = H5Devict_ff(did, 3, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
- ret = H5Mevict_ff(map, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ ret = H5Mevict_ff(map, 3, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
}
@@ -280,21 +280,21 @@ int main(int argc, char **argv) {
tapl_id = H5Pcreate (H5P_DATATYPE_ACCESS);
ret = H5Pset_evict_replica(tapl_id, dt_replica);
assert(0 == ret);
- ret = H5Tevict_ff(dtid, 2, tapl_id, H5_EVENT_STACK_NULL);
+ ret = H5Tevict_ff(dtid, 3, tapl_id, H5_EVENT_STACK_NULL);
assert(0 == ret);
H5Pclose(tapl_id);
dapl_id = H5Pcreate (H5P_DATASET_ACCESS);
ret = H5Pset_evict_replica(dapl_id, dset_replica);
assert(0 == ret);
- ret = H5Devict_ff(did, 2, dapl_id, H5_EVENT_STACK_NULL);
+ ret = H5Devict_ff(did, 3, dapl_id, H5_EVENT_STACK_NULL);
assert(0 == ret);
H5Pclose(dapl_id);
mapl_id = H5Pcreate (H5P_MAP_ACCESS);
ret = H5Pset_evict_replica(mapl_id, map_replica);
assert(0 == ret);
- ret = H5Mevict_ff(map, 2, mapl_id, H5_EVENT_STACK_NULL);
+ ret = H5Mevict_ff(map, 3, mapl_id, H5_EVENT_STACK_NULL);
assert(0 == ret);
H5Pclose(mapl_id);
}
@@ -302,7 +302,7 @@ int main(int argc, char **argv) {
MPI_Barrier(MPI_COMM_WORLD);
if(my_rank == 0) {
- /* release container version 2. */
+ /* release container version 3. */
ret = H5RCrelease(rid2, H5_EVENT_STACK_NULL);
assert(0 == ret);
}
diff --git a/examples/h5ff_client_view.c b/examples/h5ff_client_view.c
index 0cf0169..2f843aa 100644
--- a/examples/h5ff_client_view.c
+++ b/examples/h5ff_client_view.c
@@ -55,13 +55,13 @@ test_view(const char *file_name, const char *dataset_name,
ret = H5Pclose(fapl_id);
assert(0 == ret);
- /* acquire container version 0 - EXACT. */
- version = 0;
+ /* acquire container version 1 - EXACT. */
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
trspl_id = H5Pcreate(H5P_TR_START);
@@ -194,16 +194,16 @@ test_view(const char *file_name, const char *dataset_name,
ret = H5Sclose(mem_space_id);
assert(0 == ret);
- /* Finish transaction 1. */
+ /* Finish transaction 2. */
ret = H5TRfinish(tid1, H5P_DEFAULT, NULL, H5_EVENT_STACK_NULL);
assert(0 == ret);
MPI_Barrier(MPI_COMM_WORLD);
- /* acquire container version 1 - EXACT. */
- version = 1;
+ /* acquire container version 2 - EXACT. */
+ version = 2;
rid2 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(rid2 > 0);
- assert(1 == version);
+ assert(2 == version);
/* release container version 0. */
ret = H5RCrelease(rid1, H5_EVENT_STACK_NULL);
@@ -384,7 +384,7 @@ test_view(const char *file_name, const char *dataset_name,
ret = H5Sclose(file_space_id);
assert(0 == ret);
- /* release container version 1. */
+ /* release container version 2. */
ret = H5RCrelease(rid2, H5_EVENT_STACK_NULL);
assert(0 == ret);
diff --git a/examples/h5ff_client_vl_data.c b/examples/h5ff_client_vl_data.c
index c08230d..264f7df 100644
--- a/examples/h5ff_client_vl_data.c
+++ b/examples/h5ff_client_vl_data.c
@@ -78,15 +78,15 @@ int main(int argc, char **argv) {
file_id = H5Fcreate_ff(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id, H5_EVENT_STACK_NULL);
assert(file_id > 0);
- /* acquire container version 0 - EXACT.
+ /* acquire container version 1 - EXACT.
This can be asynchronous, but here we need the acquired ID
right after the call to start the transaction so we make synchronous. */
- version = 0;
+ version = 1;
rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
+ assert(1 == version);
/* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)2);
assert(tid1);
/* Create datatypes */
@@ -105,7 +105,7 @@ int main(int argc, char **argv) {
Leader can tell its delegates that the transaction is
started. */
if(0 == my_rank) {
- trans_num = 1;
+ trans_num = 2;
ret = H5TRstart(tid1, H5P_DEFAULT, H5_EVENT_STACK_NULL);
assert(0 == ret);
@@ -161,7 +161,7 @@ int main(int argc, char **argv) {
while others wait for the ibcast to complete */
if(0 != my_rank) {
MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
- assert(1 == trans_num);
+ assert(2 == trans_num);
/* recieve the token sizes */
MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]);
@@ -247,7 +247,7 @@ int main(int argc, char **argv) {
H5ESclear(e_stack);
/* Tell other procs that container version 1 is acquired */
- version = 1;
+ version = 2;
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
/* other processes just create a read context object; no need to
@@ -267,7 +267,7 @@ int main(int argc, char **argv) {
MPI_Barrier(MPI_COMM_WORLD);
if(my_rank == 0) {
- /* release container version 1. This is async. */
+ /* release container version 2. This is async. */
ret = H5RCrelease(rid2, e_stack);
assert(0 == ret);
}
diff --git a/src/H5VLiod_file.c b/src/H5VLiod_file.c
index 7380f65..5d7c88c 100644
--- a/src/H5VLiod_file.c
+++ b/src/H5VLiod_file.c
@@ -108,6 +108,18 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine,
if(ret < 0)
HGOTO_ERROR_IOD(ret, FAIL, "can't create container");
+ /* MSC - skip transaction 0 since it can't be persisted */
+ ret = iod_trans_start(coh, &first_tid, NULL, num_peers, IOD_TRANS_W, NULL);
+ if(ret < 0)
+ HGOTO_ERROR_IOD(ret, FAIL, "can't start transaction 0");
+ /* Finish the transaction */
+ ret = iod_trans_finish(coh, first_tid, NULL, 0, NULL);
+ if(ret < 0)
+ HGOTO_ERROR_IOD(ret, FAIL, "can't finish transaction 0");
+
+ first_tid = 1;
+
+ /* Take transaction 1 to create root group */
ret = iod_trans_start(coh, &first_tid, NULL, num_peers, IOD_TRANS_W, NULL);
if(ret < 0)
HGOTO_ERROR_IOD(ret, FAIL, "can't start transaction");
@@ -246,7 +258,7 @@ H5VL_iod_server_file_create_cb(AXE_engine_t UNUSED axe_engine,
/* Finish the transaction */
ret = iod_trans_finish(coh, first_tid, NULL, 0, NULL);
if(ret < 0)
- HGOTO_ERROR_IOD(ret, FAIL, "can't finish transaction 0");
+ HGOTO_ERROR_IOD(ret, FAIL, "can't finish transaction 1");
output.coh.cookie = coh.cookie;
output.root_oh.rd_oh = root_oh.rd_oh;
@@ -362,9 +374,12 @@ H5VL_iod_server_file_open_cb(AXE_engine_t UNUSED axe_engine,
fprintf(stderr, "%d (%s).\n", ret, strerror(-ret));
HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't open root object for write");
}
+
/* get scratch pad of root group */
- if(iod_obj_get_scratch(root_oh.rd_oh, rtid, &sp, &sp_cs, NULL) < 0)
+ if((ret = iod_obj_get_scratch(root_oh.rd_oh, rtid, &sp, &sp_cs, NULL)) < 0) {
+ fprintf(stderr, "%d (%s).\n", ret, strerror(-ret));
HGOTO_ERROR2(H5E_FILE, H5E_CANTINIT, FAIL, "can't get scratch pad for root object");
+ }
if(sp_cs && (cs_scope & H5_CHECKSUM_IOD)) {
/* verify scratch pad integrity */