summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2014-03-13 17:00:44 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2014-03-13 17:00:44 (GMT)
commitae8560333bf57ef4e86cdcc80a04ecddedc7ce27 (patch)
tree577cf82019c6f5c78bcb980413b27f639400ebb0
parent9f23fb291d2a21d676d0d17823b5290654f2a4f2 (diff)
downloadhdf5-ae8560333bf57ef4e86cdcc80a04ecddedc7ce27.zip
hdf5-ae8560333bf57ef4e86cdcc80a04ecddedc7ce27.tar.gz
hdf5-ae8560333bf57ef4e86cdcc80a04ecddedc7ce27.tar.bz2
[svn-r24790] sync testff
-rw-r--r--testff/CMakeLists.txt10
-rw-r--r--testff/h5ff_client_M6.2_demo.c4
-rw-r--r--testff/h5ff_client_analysis.c2
-rw-r--r--testff/h5ff_client_attr.c4
-rw-r--r--testff/h5ff_client_dset.c5
-rw-r--r--testff/h5ff_client_evict_deltas.c295
-rw-r--r--testff/h5ff_client_links.c6
-rw-r--r--testff/h5ff_client_map.c2
-rw-r--r--testff/h5ff_client_multiple_cont.c4
-rw-r--r--testff/h5ff_client_obj.c13
-rw-r--r--testff/h5ff_client_open.c119
-rw-r--r--testff/h5ff_client_paths.c249
-rw-r--r--testff/h5ff_client_prefetch.c346
-rw-r--r--testff/h5ff_client_view.c459
-rw-r--r--testff/h5ff_client_vl_data.c2
15 files changed, 1135 insertions, 385 deletions
diff --git a/testff/CMakeLists.txt b/testff/CMakeLists.txt
index d087992..bd85255 100644
--- a/testff/CMakeLists.txt
+++ b/testff/CMakeLists.txt
@@ -70,18 +70,20 @@ BUILD_H5FF_TEST(h5ff_query)
# h5ff
# ADD_H5FF_DRIVER_TEST(<target>)
BUILD_H5FF_TEST(h5ff_server)
+BUILD_H5FF_TEST(h5ff_client_analysis)
BUILD_H5FF_TEST(h5ff_client_attr)
BUILD_H5FF_TEST(h5ff_client_dset)
+BUILD_H5FF_TEST(h5ff_client_evict_deltas)
+#BUILD_H5FF_TEST(h5ff_client_index)
BUILD_H5FF_TEST(h5ff_client_links)
BUILD_H5FF_TEST(h5ff_client_M6.2_demo)
BUILD_H5FF_TEST(h5ff_client_map)
BUILD_H5FF_TEST(h5ff_client_multiple_cont)
BUILD_H5FF_TEST(h5ff_client_obj)
-BUILD_H5FF_TEST(h5ff_client_open)
-BUILD_H5FF_TEST(h5ff_client_paths)
+BUILD_H5FF_TEST(h5ff_client_prefetch)
BUILD_H5FF_TEST(h5ff_client_trans)
+BUILD_H5FF_TEST(h5ff_client_view)
BUILD_H5FF_TEST(h5ff_client_vl_data)
-BUILD_H5FF_TEST(h5ff_client_analysis)
IF (HDF5_ENABLE_PYTHON)
BUILD_H5FF_TEST(h5ff_python_exec)
@@ -102,8 +104,6 @@ ADD_H5FF_DRIVER_TEST(h5ff_links h5ff_server h5ff_client_links)
ADD_H5FF_DRIVER_TEST(h5ff_map h5ff_server h5ff_client_map)
ADD_H5FF_DRIVER_TEST(h5ff_multiple_count h5ff_server h5ff_client_multiple_cont)
ADD_H5FF_DRIVER_TEST(h5ff_obj h5ff_server h5ff_client_obj)
-ADD_H5FF_DRIVER_TEST(h5ff_open h5ff_server h5ff_client_open)
-ADD_H5FF_DRIVER_TEST(h5ff_paths h5ff_server h5ff_client_paths)
ADD_H5FF_DRIVER_TEST(h5ff_trans h5ff_server h5ff_client_trans)
# ADD_H5FF_DRIVER_TEST(h5ff_container_open h5ff_server h5ff_client_container_open)
diff --git a/testff/h5ff_client_M6.2_demo.c b/testff/h5ff_client_M6.2_demo.c
index 03a9e0f..f36892c 100644
--- a/testff/h5ff_client_M6.2_demo.c
+++ b/testff/h5ff_client_M6.2_demo.c
@@ -464,7 +464,7 @@ int main( int argc, char **argv ) {
/* Close the file, then barrier to make sure all have closed it. */
fprintf( stderr, "M6.2-r%d: close the container (Step 17)\n", my_rank );
- ret = H5Fclose_ff( file_id, H5_EVENT_STACK_NULL ); ASSERT_RET;
+ ret = H5Fclose_ff( file_id, 1, H5_EVENT_STACK_NULL ); ASSERT_RET;
MPI_Barrier( MPI_COMM_WORLD );
@@ -510,7 +510,7 @@ int main( int argc, char **argv ) {
/* Close 2 H5 Objects that are still open */
fprintf( stderr, "M6.2-r%d: close all h5 objects that are still open\n", my_rank );
- ret = H5Fclose_ff( file_id, H5_EVENT_STACK_NULL ); ASSERT_RET;
+ ret = H5Fclose_ff( file_id, 1, H5_EVENT_STACK_NULL ); ASSERT_RET;
ret = H5Pclose( fapl_id ); ASSERT_RET;
fprintf( stderr, "M6.2-r%d: Finalize EFF stack\n", my_rank );
diff --git a/testff/h5ff_client_analysis.c b/testff/h5ff_client_analysis.c
index 26ff8a7..df375f1 100644
--- a/testff/h5ff_client_analysis.c
+++ b/testff/h5ff_client_analysis.c
@@ -208,7 +208,7 @@ write_dataset(const char *file_name, const char *dataset_name,
ret = H5Fclose(file_id);
assert(0 == ret);
#else
- ret = H5Fclose_ff(file_id, H5_EVENT_STACK_NULL);
+ ret = H5Fclose_ff(file_id, 0, H5_EVENT_STACK_NULL);
assert(0 == ret);
#endif
}
diff --git a/testff/h5ff_client_attr.c b/testff/h5ff_client_attr.c
index e812e8c..095d1bd 100644
--- a/testff/h5ff_client_attr.c
+++ b/testff/h5ff_client_attr.c
@@ -287,7 +287,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(rid3, e_stack);
assert(0 == ret);
}
@@ -301,7 +301,7 @@ int main(int argc, char **argv) {
ret = H5Pclose(fapl_id);
assert(ret == 0);
- H5Fclose_ff(file_id, H5_EVENT_STACK_NULL);
+ H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL);
H5ESget_count(e_stack, &num_events);
H5ESwait_all(e_stack, &status);
diff --git a/testff/h5ff_client_dset.c b/testff/h5ff_client_dset.c
index 207ab90..181a619 100644
--- a/testff/h5ff_client_dset.c
+++ b/testff/h5ff_client_dset.c
@@ -205,6 +205,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
/* bcast the token sizes and the tokens */
MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD, &mpi_reqs[0]);
@@ -294,6 +295,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
}
/* Barrier to make sure all processes are done writing so Process
@@ -324,6 +326,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
printf("%d events in event stack. H5ESwait_all Completion status = %d\n", num_events, status);
H5ESclear(e_stack);
+ assert(status == H5ES_STATUS_SUCCEED);
/* Tell other procs that container version 1 is acquired */
version = 1;
@@ -570,7 +573,7 @@ int main(int argc, char **argv) {
ret = H5Gclose_ff(gid1, e_stack);
assert(ret == 0);
- H5Fclose_ff(file_id, H5_EVENT_STACK_NULL);
+ H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL);
H5ESget_count(e_stack, &num_events);
diff --git a/testff/h5ff_client_evict_deltas.c b/testff/h5ff_client_evict_deltas.c
new file mode 100644
index 0000000..65347a4
--- /dev/null
+++ b/testff/h5ff_client_evict_deltas.c
@@ -0,0 +1,295 @@
+/*
+ * test_client_obj.c: Client side of H5O routines
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "mpi.h"
+#include "hdf5.h"
+
+int main(int argc, char **argv) {
+ const char file_name[]="eff_file_deltas.h5";
+ hid_t file_id;
+ hid_t gid;
+ hid_t did, map;
+ hid_t sid, dtid;
+ hid_t tid1, tid2, rid1, rid2;
+ hid_t fapl_id, dxpl_id;
+ hid_t e_stack;
+ hbool_t exists = -1;
+
+ const unsigned int nelem=60;
+ hsize_t dims[1];
+
+ uint64_t version;
+ uint64_t trans_num;
+
+ int my_rank, my_size;
+ int provided;
+ MPI_Request mpi_req;
+
+ int32_t *wdata1 = NULL, *rdata1 = NULL;
+ int key, value, i;
+ H5ES_status_t status;
+ size_t num_events = 0;
+ herr_t ret;
+
+ MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
+ if(MPI_THREAD_MULTIPLE != provided) {
+ fprintf(stderr, "MPI does not have MPI_THREAD_MULTIPLE support\n");
+ exit(1);
+ }
+
+ /* Call EFF_init to initialize the EFF stack.
+ As a result of this call, the Function Shipper client is started,
+ and HDF5 VOL calls are registered with the function shipper.
+ An "IOD init" call is forwarded from the FS client to the FS server
+ which should already be running. */
+ EFF_init(MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &my_size);
+ fprintf(stderr, "APP processes = %d, my rank is %d\n", my_size, my_rank);
+
+ wdata1 = malloc (sizeof(int32_t)*nelem);
+ rdata1 = malloc (sizeof(int32_t)*nelem);
+ for(i=0;i<nelem;++i) {
+ wdata1[i] = i;
+ rdata1[i] = 0;
+ }
+
+ fprintf(stderr, "Create the FAPL to set the IOD VOL plugin and create the file\n");
+ /* Choose the IOD VOL plugin to use with this file.
+ First we create a file access property list. Then we call a new routine to set
+ the IOD plugin to use with this fapl */
+ fapl_id = H5Pcreate (H5P_FILE_ACCESS);
+ H5Pset_fapl_iod(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ /* create an event Queue for managing asynchronous requests.
+
+ Event Queues will releive the use from managing and completing
+ individual requests for every operation. Instead of passing a
+ request for every operation, the event queue is passed and
+ internally the HDF5 library creates a request and adds it to
+ the event queue.
+
+ Multiple Event queue can be created used by the application. */
+ e_stack = H5EScreate();
+ assert(e_stack);
+
+ /* create the file. */
+ file_id = H5Fcreate_ff(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id, H5_EVENT_STACK_NULL);
+ assert(file_id > 0);
+
+ /* create 1-D dataspace with 60 elements */
+ dims [0] = nelem;
+ sid = H5Screate_simple(1, dims, NULL);
+ dtid = H5Tcopy(H5T_STD_I32LE);
+
+ /* 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;
+ rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == version);
+
+ /* start transaction 1 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) {
+ hid_t rid_temp;
+
+ /* create transaction object */
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ assert(tid1);
+ ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
+ assert(0 == ret);
+
+ /* create objects */
+ gid = H5Gcreate_ff(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(gid >= 0);
+
+ did = H5Dcreate_ff(gid, "D1", dtid, sid, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(did >= 0);
+
+ ret = H5Dwrite_ff(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata1, tid1, e_stack);
+ assert(ret == 0);
+
+ ret = H5Tcommit_ff(file_id, "DT1", dtid, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(ret == 0);
+
+ map = H5Mcreate_ff(file_id, "MAP1", H5T_STD_I32LE, H5T_STD_I32LE,
+ H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, tid1, e_stack);
+ assert(map >= 0);
+
+ /* write some KV pairs to each map object. */
+ {
+ key = 1;
+ value = 1000;
+ ret = H5Mset_ff(map, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(ret == 0);
+
+ }
+
+ ret = H5TRfinish(tid1, H5P_DEFAULT, &rid_temp, e_stack);
+ assert(0 == ret);
+
+ /* wait on all requests and print completion status */
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ /* Close transaction object. Local op */
+ ret = H5TRclose(tid1);
+ assert(0 == ret);
+
+ /* create transaction object */
+ tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)2);
+ assert(tid2);
+ ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
+ assert(0 == ret);
+
+ ret = H5Oset_comment_ff(gid, "Testing Object Comment", tid2, e_stack);
+ assert(ret == 0);
+
+ ret = H5TRfinish(tid2, H5P_DEFAULT, &rid2, e_stack);
+ assert(0 == ret);
+
+ assert(H5Gclose_ff(gid, e_stack) == 0);
+ assert(H5Mclose_ff(map, e_stack) == 0);
+ assert(H5Tclose_ff(dtid, e_stack) == 0);
+ assert(H5Dclose_ff(did, e_stack) == 0);
+
+ /* release container version 1. This is async. */
+ ret = H5RCrelease(rid_temp, e_stack);
+ assert(0 == ret);
+ ret = H5RCclose(rid_temp);
+ assert(0 == ret);
+
+ version = 2;
+ }
+
+ /* release container version 0. This is async. */
+ ret = H5RCrelease(rid1, e_stack);
+ assert(0 == ret);
+
+ /* wait on all requests and print completion status */
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ if(0 == my_rank) {
+ /* Close transaction object. Local op */
+ ret = H5TRclose(tid2);
+ assert(0 == ret);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* 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);
+
+ /* other processes just create a read context object; no need to
+ acquire it */
+ if(0 != my_rank) {
+ rid2 = H5RCcreate(file_id, version);
+ assert(rid2 > 0);
+ }
+
+ gid = H5Oopen_ff(file_id, "G1", H5P_DEFAULT, rid2);
+ assert(gid);
+ dtid = H5Oopen_ff(file_id, "DT1", H5P_DEFAULT, rid2);
+ assert(dtid);
+ did = H5Oopen_ff(gid,"D1", H5P_DEFAULT, rid2);
+ assert(did);
+ map = H5Oopen_ff(file_id,"MAP1", H5P_DEFAULT, rid2);
+ assert(did);
+
+ if(0 == my_rank) {
+ ret = H5RCpersist(rid2, H5_EVENT_STACK_NULL);
+ assert(ret == 0);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if((my_size > 1 && 1 == my_rank) ||
+ (my_size == 1 && 0 == my_rank)) {
+ ret = H5Tevict_ff(dtid, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Devict_ff(did, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Mevict_ff(map, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ /* see if we can read after evicting */
+ ret = H5Dread_ff(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata1, rid2, H5_EVENT_STACK_NULL);
+ assert(ret == 0);
+ printf("Read Data1: ");
+ for(i=0;i<nelem;++i)
+ printf("%d ",rdata1[i]);
+ printf("\n");
+
+ key = 1;
+ value = -1;
+ ret = H5Mget_ff(map, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value,
+ H5P_DEFAULT, rid2, H5_EVENT_STACK_NULL);
+ printf("Value recieved = %d\n", value);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if(my_rank == 0) {
+ /* release container version 2. This is async. */
+ ret = H5RCrelease(rid2, e_stack);
+ assert(0 == ret);
+ }
+
+ assert(H5Oclose_ff(gid, e_stack) == 0);
+ assert(H5Oclose_ff(did, e_stack) == 0);
+ assert(H5Oclose_ff(dtid, e_stack) == 0);
+ assert(H5Oclose_ff(map, e_stack) == 0);
+
+ ret = H5RCclose(rid1);
+ assert(0 == ret);
+ ret = H5RCclose(rid2);
+ assert(0 == ret);
+
+ /* wait on all requests and print completion status */
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ /* closing the container also acts as a wait all on all pending requests
+ on the container. */
+ assert(H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL) == 0);
+
+ H5Sclose(sid);
+ H5Pclose(fapl_id);
+ H5ESclose(e_stack);
+
+ /* This finalizes the EFF stack. ships a terminate and IOD finalize to the server
+ and shutsdown the FS server (when all clients send the terminate request)
+ and client */
+ MPI_Barrier(MPI_COMM_WORLD);
+ ret = EFF_finalize();
+ assert(ret >= 0);
+
+ MPI_Finalize();
+ return 0;
+}
diff --git a/testff/h5ff_client_links.c b/testff/h5ff_client_links.c
index 45f7d5a..390bbd4 100644
--- a/testff/h5ff_client_links.c
+++ b/testff/h5ff_client_links.c
@@ -123,6 +123,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
/* Close transaction object. Local op */
ret = H5TRclose(tid1);
@@ -180,6 +181,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
/* Close transaction object. Local op */
ret = H5TRclose(tid2);
@@ -204,6 +206,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
/* Leader tells other procs that container version 2 is acquired */
MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
@@ -278,13 +281,14 @@ int main(int argc, char **argv) {
/* closing the container also acts as a wait all on all pending requests
on the container. */
- assert(H5Fclose_ff(file_id, H5_EVENT_STACK_NULL) == 0);
+ assert(H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL) == 0);
/* wait on all requests and print completion status */
H5ESget_count(e_stack, &num_events);
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
assert(0 == ret);
diff --git a/testff/h5ff_client_map.c b/testff/h5ff_client_map.c
index 8574d42..a1fa6f0 100644
--- a/testff/h5ff_client_map.c
+++ b/testff/h5ff_client_map.c
@@ -456,7 +456,7 @@ int main(int argc, char **argv) {
/* closing the container also acts as a wait all on all pending requests
on the container. */
- assert(H5Fclose_ff(file_id, H5_EVENT_STACK_NULL) == 0);
+ assert(H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL) == 0);
fprintf(stderr, "\n*****************************************************************************************************************\n");
fprintf(stderr, "Wait on everything in ES and check Results of operations in ES\n");
diff --git a/testff/h5ff_client_multiple_cont.c b/testff/h5ff_client_multiple_cont.c
index 1bc57d6..d7d54f1 100644
--- a/testff/h5ff_client_multiple_cont.c
+++ b/testff/h5ff_client_multiple_cont.c
@@ -377,8 +377,8 @@ int main(int argc, char **argv) {
ret = H5RCclose(rid2);
assert(0 == ret);
- assert(H5Fclose_ff(fid1, H5_EVENT_STACK_NULL) == 0);
- assert(H5Fclose_ff(fid2, H5_EVENT_STACK_NULL) == 0);
+ assert(H5Fclose_ff(fid1, 1, H5_EVENT_STACK_NULL) == 0);
+ assert(H5Fclose_ff(fid2, 1, H5_EVENT_STACK_NULL) == 0);
/* wait on all requests and print completion status */
H5ESget_count(e_stack, &num_events);
diff --git a/testff/h5ff_client_obj.c b/testff/h5ff_client_obj.c
index e902f4f..59e64f6 100644
--- a/testff/h5ff_client_obj.c
+++ b/testff/h5ff_client_obj.c
@@ -93,6 +93,7 @@ int main(int argc, char **argv) {
started. */
if(0 == my_rank) {
hid_t rid_temp;
+ hid_t anon_did;
/* create transaction object */
tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
@@ -117,6 +118,13 @@ int main(int argc, char **argv) {
H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, tid1, e_stack);
assert(map >= 0);
+ anon_did = H5Dcreate_anon_ff(file_id, dtid, sid, H5P_DEFAULT, H5P_DEFAULT,
+ tid1, e_stack);
+ assert(anon_did > 0);
+
+ ret = H5Dclose_ff(anon_did, e_stack);
+ assert(0 == ret);
+
ret = H5TRfinish(tid1, H5P_DEFAULT, &rid_temp, e_stack);
assert(0 == ret);
@@ -125,6 +133,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
/* Close transaction object. Local op */
ret = H5TRclose(tid1);
@@ -165,6 +174,7 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
if(0 == my_rank) {
/* Close transaction object. Local op */
@@ -269,10 +279,11 @@ int main(int argc, char **argv) {
H5ESwait_all(e_stack, &status);
H5ESclear(e_stack);
printf("%d events in event stack. Completion status = %d\n", num_events, status);
+ assert(status == H5ES_STATUS_SUCCEED);
/* closing the container also acts as a wait all on all pending requests
on the container. */
- assert(H5Fclose_ff(file_id, H5_EVENT_STACK_NULL) == 0);
+ assert(H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL) == 0);
assert(exists);
diff --git a/testff/h5ff_client_open.c b/testff/h5ff_client_open.c
deleted file mode 100644
index 89b198d..0000000
--- a/testff/h5ff_client_open.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * test_client_obj.c: Client side of H5O routines
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include "mpi.h"
-#include "hdf5.h"
-
-int main(int argc, char **argv) {
- const char file_name[]="map_file.h5";
- hid_t file_id;
- hid_t gid;
- hid_t did;
- hid_t map;
- hid_t dtid;
- hid_t rid1;
- hid_t aid;
- hid_t fapl_id;
- hid_t e_stack;
- uint64_t version;
- int my_rank, my_size;
- int provided;
- H5ES_status_t status;
- size_t num_events = 0;
- herr_t ret;
-
- MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
- if(MPI_THREAD_MULTIPLE != provided) {
- fprintf(stderr, "MPI does not have MPI_THREAD_MULTIPLE support\n");
- exit(1);
- }
-
- /* Call EFF_init to initialize the EFF stack.
- As a result of this call, the Function Shipper client is started,
- and HDF5 VOL calls are registered with the function shipper.
- An "IOD init" call is forwarded from the FS client to the FS server
- which should already be running. */
- EFF_init(MPI_COMM_WORLD, MPI_INFO_NULL);
-
- MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
- MPI_Comm_size(MPI_COMM_WORLD, &my_size);
- fprintf(stderr, "APP processes = %d, my rank is %d\n", my_size, my_rank);
-
- fprintf(stderr, "Create the FAPL to set the IOD VOL plugin and create the file\n");
- /* Choose the IOD VOL plugin to use with this file.
- First we create a file access property list. Then we call a new routine to set
- the IOD plugin to use with this fapl */
- fapl_id = H5Pcreate (H5P_FILE_ACCESS);
- H5Pset_fapl_iod(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL);
-
- /* create an event Queue for managing asynchronous requests.
-
- Event Queues will releive the use from managing and completing
- individual requests for every operation. Instead of passing a
- request for every operation, the event queue is passed and
- internally the HDF5 library creates a request and adds it to
- the event queue.
-
- Multiple Event queue can be created used by the application. */
- e_stack = H5EScreate();
- assert(e_stack);
-
- /* Open the file and ask to acquire the latest readable version */
- file_id = H5Fopen_ff(file_name, H5F_ACC_RDONLY, fapl_id, &rid1, H5_EVENT_STACK_NULL);
- assert(file_id);
-
- /* query the latest readable version number */
- H5RCget_version(rid1, &version);
- /* MSC - assert the fake version value that is returned for now */
- assert(version == 1024);
-
- /* create objects */
- gid = H5Gopen_ff(file_id, "G1", H5P_DEFAULT, rid1, e_stack);
- assert(gid > 0);
- did = H5Dopen_ff(gid, "D1", H5P_DEFAULT, rid1, e_stack);
- assert(did > 0);
- map = H5Mopen_ff(file_id, "MAP1", H5P_DEFAULT, rid1, e_stack);
- assert(map > 0);
- dtid = H5Topen_ff(file_id, "DT1", H5P_DEFAULT, rid1, e_stack);
- assert(dtid > 0);
- aid = H5Aopen_ff(did, "ATTR_DSET", H5P_DEFAULT, rid1, e_stack);
- assert(aid > 0);
-
- assert(H5Gclose_ff(gid, e_stack) == 0);
- assert(H5Dclose_ff(did, e_stack) == 0);
- assert(H5Tclose_ff(dtid, e_stack) == 0);
- assert(H5Mclose_ff(map, e_stack) == 0);
- assert(H5Aclose_ff(aid, e_stack) == 0);
-
- /* release container version 1024. This is async. */
- ret = H5RCrelease(rid1, e_stack);
- assert(0 == ret);
-
- ret = H5RCclose(rid1);
- assert(0 == ret);
- /* closing the container also acts as a wait all on all pending requests
- on the container. */
- assert(H5Fclose_ff(file_id, e_stack) == 0);
-
- /* wait on all requests and print completion status */
- H5ESget_count(e_stack, &num_events);
- H5ESwait_all(e_stack, &status);
- H5ESclear(e_stack);
- printf("%d events in event stack. Completion status = %d\n", num_events, status);
-
- H5Pclose(fapl_id);
- H5ESclose(e_stack);
-
- /* This finalizes the EFF stack. ships a terminate and IOD finalize to the server
- and shutsdown the FS server (when all clients send the terminate request)
- and client */
- EFF_finalize();
-
- MPI_Finalize();
- return 0;
-}
diff --git a/testff/h5ff_client_paths.c b/testff/h5ff_client_paths.c
deleted file mode 100644
index 4f55667..0000000
--- a/testff/h5ff_client_paths.c
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- * test_client_path.c: This example demonstrates what can and can't be
- * done with access through Paths in the IOD plugin.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include "mpi.h"
-#include "hdf5.h"
-
-int main(int argc, char **argv) {
- const char file_name[]="map_file.h5";
- hid_t file_id;
- hid_t gid1, gid2, gid3;
- hid_t map;
- hid_t tid1, tid2, rid1, rid2;
- hid_t fapl_id, dxpl_id, trspl_id;
- hid_t e_stack;
-
- uint64_t version;
- uint64_t trans_num;
-
- int my_rank, my_size;
- int provided;
- MPI_Request mpi_req;
-
- H5ES_status_t status;
- size_t num_events = 0;
- herr_t ret;
-
- hsize_t count = -1;
- int key, value;
- hbool_t exists = -1;
-
- MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
- if(MPI_THREAD_MULTIPLE != provided) {
- fprintf(stderr, "MPI does not have MPI_THREAD_MULTIPLE support\n");
- exit(1);
- }
-
- /* Call EFF_init to initialize the EFF stack.
- As a result of this call, the Function Shipper client is started,
- and HDF5 VOL calls are registered with the function shipper.
- An "IOD init" call is forwarded from the FS client to the FS server
- which should already be running. */
- EFF_init(MPI_COMM_WORLD, MPI_INFO_NULL);
-
- MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
- MPI_Comm_size(MPI_COMM_WORLD, &my_size);
- fprintf(stderr, "APP processes = %d, my rank is %d\n", my_size, my_rank);
-
- fprintf(stderr, "Create the FAPL to set the IOD VOL plugin and create the file\n");
- /* Choose the IOD VOL plugin to use with this file.
- First we create a file access property list. Then we call a new routine to set
- the IOD plugin to use with this fapl */
- fapl_id = H5Pcreate (H5P_FILE_ACCESS);
- H5Pset_fapl_iod(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL);
-
- /* create an event Queue for managing asynchronous requests.
-
- Event Queues will releive the use from managing and completing
- individual requests for every operation. Instead of passing a
- request for every operation, the event queue is passed and
- internally the HDF5 library creates a request and adds it to
- the event queue.
-
- Multiple Event queue can be created used by the application. */
- e_stack = H5EScreate();
- assert(e_stack);
-
- /* create the file. */
- file_id = H5Fcreate(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
- assert(file_id);
-
- /* acquire container version 0 - EXACT */
- version = 0;
- rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == version);
-
- /******************************** Transaction 1 ****************************************/
- /* create transaction object */
- tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
- assert(tid1);
-
- /* start transaction 1 with default num_peers (= 0). */
- if(0 == my_rank) {
- ret = H5TRstart(tid1, H5P_DEFAULT, H5_EVENT_STACK_NULL);
- assert(0 == ret);
- }
-
- /* Tell other procs that transaction 1 is started */
- trans_num = 1;
- MPI_Ibcast(&trans_num, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD, &mpi_req);
-
- /* Process 0 can continue writing to transaction 1,
- while others wait for the bcast to complete */
- if(0 != my_rank)
- MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
-
- /* create a group G1 on the root group */
- gid1 = H5Gcreate_ff(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, e_stack);
-
- /* to be able to create G2 on G1, we have to use G1's ID as the starting location */
- gid2 = H5Gcreate_ff(gid1, "G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, e_stack);
-
- /* If we happen to do something like this :
-
- gid2 = H5Gcreate_ff(file_id, "G1/G2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, e_stack);
-
- We will get a failure when the operation completes, because the
- path G1/G2 indicates that we have to read G1 from IOD in read
- context 0. Since G1 is created in transaction 1, it is still
- not yet visible so we can not read from it. We can only write
- to it, which makes the earlier create directly on G1
- possible. This operation will succeed in a subsequent
- transaction that has a read context 1.
- */
-
-
- /* none leader procs have to complete operations before notifying the leader */
- if(0 != my_rank) {
- /* wait on all requests and print completion status */
- H5ESget_count(e_stack, &num_events);
- H5ESwait_all(e_stack, &status);
- H5ESclear(e_stack);
- printf("%d events in event stack. Completion status = %d\n", num_events, status);
- }
-
- /* Barrier to make sure all processes are done writing so Process
- 0 can finish transaction 1 and acquire a read context on it. */
- MPI_Barrier(MPI_COMM_WORLD);
-
- if(0 == my_rank) {
- MPI_Wait(&mpi_req, MPI_STATUS_IGNORE);
-
- ret = H5TRfinish(tid1, H5P_DEFAULT, &rid2, H5_EVENT_STACK_NULL);
- assert(0 == ret);
- }
-
- /* another barrier so other processes know that container version is acquried */
- MPI_Barrier(MPI_COMM_WORLD);
-
- /* Close transaction object. Local op */
- ret = H5TRclose(tid1);
- assert(0 == ret);
-
- /******************************** END Transaction 1 ****************************************/
-
- /* release container version 0. This is async. */
- ret = H5RCrelease(rid1, e_stack);
- assert(0 == ret);
-
- /* wait on all requests and print completion status */
- H5ESget_count(e_stack, &num_events);
- H5ESwait_all(e_stack, &status);
- H5ESclear(e_stack);
- printf("%d events in event stack. Completion status = %d\n", num_events, status);
-
- /* Process 0 tells other procs that container version 1 is acquired */
- version = 1;
- 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) {
- rid2 = H5RCcreate(file_id, version);
- assert(rid2 > 0);
- }
-
-
- /******************************** Transaction 2 ****************************************/
-
- /* create & start transaction 2 with num_peers = n */
- tid2 = H5TRcreate(file_id, rid2, (uint64_t)2);
- assert(tid2);
- trspl_id = H5Pcreate (H5P_TR_START);
- ret = H5Pset_trspl_num_peers(trspl_id, my_size);
- assert(0 == ret);
- ret = H5TRstart(tid2, trspl_id, e_stack);
- assert(0 == ret);
- ret = H5Pclose(trspl_id);
- assert(0 == ret);
-
- /* create G3 under /G1/G2. This can be done by either providing
- the file_id as the starting location, and the entire path to
- where G3 needs to be created (G1/G2/G3), since the intermediate
- groups G1 and G2 are readable, or gid2 as the starting
- location. The latter would be more performant, since we already
- have G2 open, so it will avoid extra access to get to G2 as
- would be in the former case. */
- gid3 = H5Gcreate_ff(gid2, "G3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid2, e_stack);
- /* This will work too:
- gid3 = H5Gcreate_ff(file_id, "G1/G2/G3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid2, e_stack);
- */
-
- /* create a Map object under G3. Since G3 is created in the same
- transaction as the map create will occur, the direct location
- for G3 is needed for the create to succeed. */
- map = H5Mcreate_ff(gid3, "MAP", H5T_STD_I32LE, H5T_STD_I32LE,
- H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, tid2, e_stack);
-
- /* finish transaction 2 */
- ret = H5TRfinish(tid2, H5P_DEFAULT, NULL, e_stack);
- assert(0 == ret);
-
- ret = H5TRclose(tid2);
- assert(0 == ret);
-
- /******************************** END Transaction 2 ****************************************/
-
- if(my_rank == 0) {
- /* release container version 1. This is async. */
- ret = H5RCrelease(rid2, e_stack);
- assert(0 == ret);
- }
-
- assert(H5Gclose_ff(gid1, e_stack) == 0);
- assert(H5Gclose_ff(gid2, e_stack) == 0);
- assert(H5Gclose_ff(gid3, e_stack) == 0);
- assert(H5Mclose_ff(map, e_stack) == 0);
-
- ret = H5RCclose(rid1);
- assert(0 == ret);
- ret = H5RCclose(rid2);
- assert(0 == ret);
-
- /* closing the container also acts as a wait all on all pending requests
- on the container. */
- assert(H5Fclose_ff(file_id, e_stack) == 0);
-
- /* wait on all requests and print completion status */
- H5ESget_count(e_stack, &num_events);
- H5ESwait_all(e_stack, &status);
- H5ESclear(e_stack);
- printf("%d events in event stack. Completion status = %d\n", num_events, status);
-
- H5ESclose(e_stack);
- H5Pclose(fapl_id);
-
- /* This finalizes the EFF stack. ships a terminate and IOD finalize to the server
- and shutsdown the FS server (when all clients send the terminate request)
- and client */
- EFF_finalize();
-
- MPI_Finalize();
- return 0;
-}
diff --git a/testff/h5ff_client_prefetch.c b/testff/h5ff_client_prefetch.c
new file mode 100644
index 0000000..50a627b
--- /dev/null
+++ b/testff/h5ff_client_prefetch.c
@@ -0,0 +1,346 @@
+/*
+ * test_client_obj.c: Client side of H5O routines
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include "mpi.h"
+#include "hdf5.h"
+
+int main(int argc, char **argv) {
+ const char file_name[]="eff_file_prefetch2.h5";
+ hid_t file_id;
+ hid_t gid;
+ hid_t did, map;
+ hid_t sid, dtid;
+ hid_t tid1, tid2, rid1, rid2;
+ hid_t fapl_id, dxpl_id;
+ hid_t e_stack;
+ hbool_t exists = -1;
+
+ const unsigned int nelem=60;
+ hsize_t dims[1];
+
+ uint64_t version;
+ uint64_t trans_num;
+
+ int my_rank, my_size;
+ int provided;
+ MPI_Request mpi_req;
+
+ int32_t *wdata1 = NULL, *rdata1 = NULL;
+ int key, value, i;
+ H5ES_status_t status;
+ size_t num_events = 0;
+ herr_t ret;
+
+ MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
+ if(MPI_THREAD_MULTIPLE != provided) {
+ fprintf(stderr, "MPI does not have MPI_THREAD_MULTIPLE support\n");
+ exit(1);
+ }
+
+ /* Call EFF_init to initialize the EFF stack.
+ As a result of this call, the Function Shipper client is started,
+ and HDF5 VOL calls are registered with the function shipper.
+ An "IOD init" call is forwarded from the FS client to the FS server
+ which should already be running. */
+ EFF_init(MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &my_size);
+ fprintf(stderr, "APP processes = %d, my rank is %d\n", my_size, my_rank);
+
+ wdata1 = malloc (sizeof(int32_t)*nelem);
+ rdata1 = malloc (sizeof(int32_t)*nelem);
+ for(i=0;i<nelem;++i) {
+ wdata1[i]=i;
+ rdata1[i] = 0;
+ }
+
+ fprintf(stderr, "Create the FAPL to set the IOD VOL plugin and create the file\n");
+ /* Choose the IOD VOL plugin to use with this file.
+ First we create a file access property list. Then we call a new routine to set
+ the IOD plugin to use with this fapl */
+ fapl_id = H5Pcreate (H5P_FILE_ACCESS);
+ H5Pset_fapl_iod(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ /* create an event Queue for managing asynchronous requests.
+
+ Event Queues will releive the use from managing and completing
+ individual requests for every operation. Instead of passing a
+ request for every operation, the event queue is passed and
+ internally the HDF5 library creates a request and adds it to
+ the event queue.
+
+ Multiple Event queue can be created used by the application. */
+ e_stack = H5EScreate();
+ assert(e_stack);
+
+ /* create the file. */
+ file_id = H5Fcreate_ff(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id, H5_EVENT_STACK_NULL);
+ assert(file_id > 0);
+
+ /* create 1-D dataspace with 60 elements */
+ dims [0] = nelem;
+ sid = H5Screate_simple(1, dims, NULL);
+ dtid = H5Tcopy(H5T_STD_I32LE);
+
+ /* 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;
+ rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == version);
+
+ /* start transaction 1 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) {
+ hid_t rid_temp;
+
+ /* create transaction object */
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ assert(tid1);
+ ret = H5TRstart(tid1, H5P_DEFAULT, e_stack);
+ assert(0 == ret);
+
+ /* create objects */
+ gid = H5Gcreate_ff(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(gid >= 0);
+
+ did = H5Dcreate_ff(gid, "D1", dtid, sid, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(did >= 0);
+
+ ret = H5Dwrite_ff(did, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata1, tid1, e_stack);
+ assert(ret == 0);
+
+ ret = H5Tcommit_ff(file_id, "DT1", dtid, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(ret == 0);
+
+ map = H5Mcreate_ff(file_id, "MAP1", H5T_STD_I32LE, H5T_STD_I32LE,
+ H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT, tid1, e_stack);
+ assert(map >= 0);
+
+ /* write some KV pairs to each map object. */
+ {
+ key = 1;
+ value = 1000;
+ ret = H5Mset_ff(map, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value,
+ H5P_DEFAULT, tid1, e_stack);
+ assert(ret == 0);
+
+ }
+
+ ret = H5TRfinish(tid1, H5P_DEFAULT, &rid_temp, e_stack);
+ assert(0 == ret);
+
+ /* wait on all requests and print completion status */
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ /* Close transaction object. Local op */
+ ret = H5TRclose(tid1);
+ assert(0 == ret);
+
+ /* create transaction object */
+ tid2 = H5TRcreate(file_id, rid_temp, (uint64_t)2);
+ assert(tid2);
+ ret = H5TRstart(tid2, H5P_DEFAULT, e_stack);
+ assert(0 == ret);
+
+ ret = H5Oset_comment_ff(gid, "Testing Object Comment", tid2, e_stack);
+ assert(ret == 0);
+
+ ret = H5TRfinish(tid2, H5P_DEFAULT, &rid2, e_stack);
+ assert(0 == ret);
+
+ assert(H5Gclose_ff(gid, e_stack) == 0);
+ assert(H5Mclose_ff(map, e_stack) == 0);
+ assert(H5Tclose_ff(dtid, e_stack) == 0);
+ assert(H5Dclose_ff(did, e_stack) == 0);
+
+ /* release container version 1. This is async. */
+ ret = H5RCrelease(rid_temp, e_stack);
+ assert(0 == ret);
+ ret = H5RCclose(rid_temp);
+ assert(0 == ret);
+
+ version = 2;
+ }
+
+ /* release container version 0. This is async. */
+ ret = H5RCrelease(rid1, e_stack);
+ assert(0 == ret);
+
+ /* wait on all requests and print completion status */
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ 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 */
+ MPI_Bcast(&version, 1, MPI_UINT64_T, 0, MPI_COMM_WORLD);
+ assert(2 == version);
+
+ /* other processes just create a read context object; no need to
+ acquire it */
+ if(0 != my_rank) {
+ rid2 = H5RCcreate(file_id, version);
+ assert(rid2 > 0);
+ }
+
+ if(0 == my_rank) {
+ /* Close transaction object. Local op */
+ ret = H5TRclose(tid2);
+ assert(0 == ret);
+
+ ret = H5RCpersist(rid2, H5_EVENT_STACK_NULL);
+ assert(ret == 0);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ gid = H5Oopen_ff(file_id, "G1", H5P_DEFAULT, rid2);
+ assert(gid);
+ dtid = H5Oopen_ff(file_id, "DT1", H5P_DEFAULT, rid2);
+ assert(dtid);
+ did = H5Oopen_ff(gid,"D1", H5P_DEFAULT, rid2);
+ assert(did);
+ map = H5Oopen_ff(file_id,"MAP1", H5P_DEFAULT, rid2);
+ assert(did);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if((my_size > 1 && 1 == my_rank) ||
+ (my_size == 1 && 0 == my_rank)) {
+ ret = H5Tevict_ff(dtid, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Devict_ff(did, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Mevict_ff(map, 2, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if((my_size > 1 && 1 == my_rank) ||
+ (my_size == 1 && 0 == my_rank)) {
+ hid_t mapl_id, tapl_id, dapl_id;
+ hrpl_t map_replica, dt_replica, dset_replica;
+
+ /* prefetch objects */
+ ret = H5Mprefetch_ff(map, rid2, &map_replica, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ printf("prefetched map with replica id %"PRIx64"\n", map_replica);
+ ret = H5Tprefetch_ff(dtid, rid2, &dt_replica, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ printf("prefetched datatype with replica id %"PRIx64"\n", dt_replica);
+ ret = H5Dprefetch_ff(did, rid2, &dset_replica, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ printf("prefetched dataset with replica id %"PRIx64"\n", dset_replica);
+
+ /* Read from prefetched Replicas */
+ /* set dxpl to read from replica in BB */
+ dxpl_id = H5Pcreate (H5P_DATASET_XFER);
+ ret = H5Pset_read_replica(dxpl_id, dset_replica);
+ assert(0 == ret);
+
+ ret = H5Dread_ff(did, dtid, H5S_ALL, H5S_ALL, dxpl_id, rdata1, rid2, H5_EVENT_STACK_NULL);
+ assert(ret == 0);
+ printf("Read Data1: ");
+ for(i=0;i<nelem;++i)
+ printf("%d ",rdata1[i]);
+ printf("\n");
+
+ dxpl_id = H5Pcreate (H5P_DATASET_XFER);
+ ret = H5Pset_read_replica(dxpl_id, map_replica);
+ assert(0 == ret);
+
+ key = 1;
+ value = -1;
+ ret = H5Mget_ff(map, H5T_STD_I32LE, &key, H5T_STD_I32LE, &value,
+ dxpl_id, rid2, H5_EVENT_STACK_NULL);
+ printf("Value recieved = %d\n", value);
+
+ H5Pclose(dxpl_id);
+
+ /* evict Replicas */
+ 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);
+ 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);
+ 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);
+ assert(0 == ret);
+ H5Pclose(mapl_id);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if(my_rank == 0) {
+ /* release container version 2. */
+ ret = H5RCrelease(rid2, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ }
+
+ assert(H5Oclose_ff(gid, e_stack) == 0);
+ assert(H5Oclose_ff(did, e_stack) == 0);
+ assert(H5Oclose_ff(dtid, e_stack) == 0);
+ assert(H5Oclose_ff(map, e_stack) == 0);
+
+ ret = H5RCclose(rid1);
+ assert(0 == ret);
+ ret = H5RCclose(rid2);
+ assert(0 == ret);
+
+ /* wait on all requests and print completion status */
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ /* closing the container also acts as a wait all on all pending requests
+ on the container. */
+ assert(H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL) == 0);
+
+ H5Sclose(sid);
+ H5Pclose(fapl_id);
+ H5ESclose(e_stack);
+
+ free(wdata1);
+ free(rdata1);
+
+ /* This finalizes the EFF stack. ships a terminate and IOD finalize to the server
+ and shutsdown the FS server (when all clients send the terminate request)
+ and client */
+ MPI_Barrier(MPI_COMM_WORLD);
+ ret = EFF_finalize();
+ assert(ret >= 0);
+
+ MPI_Finalize();
+ return 0;
+}
diff --git a/testff/h5ff_client_view.c b/testff/h5ff_client_view.c
new file mode 100644
index 0000000..0cf0169
--- /dev/null
+++ b/testff/h5ff_client_view.c
@@ -0,0 +1,459 @@
+/*
+ * h5ff_client_dset.c: Client side test for Dataset routines.
+ */
+
+#include <hdf5.h>
+
+#include <mpi.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+#define NTUPLES 256
+static int my_rank = 0, my_size = 1;
+
+static void
+test_view(const char *file_name, const char *dataset_name,
+ hsize_t total, hsize_t ncomponents, hid_t datatype_id,
+ hsize_t ntuples, hsize_t start, void *buf)
+{
+ hid_t file_id, view_id;
+ hid_t did1, did2, did3, gid1;
+ hid_t file_space_id, mem_space_id;
+ hid_t tid1, rid1, rid2, trspl_id;
+ hid_t fapl_id;
+ hsize_t dims[2] = {total, ncomponents};
+ hsize_t offset[2] = {start, 0};
+ hsize_t count[2] = {ntuples, ncomponents};
+ int rank = (ncomponents == 1) ? 1 : 2;
+ uint64_t version;
+ herr_t ret;
+ void *dset_token1, *dset_token2, *dset_token3;
+ size_t token_size1, token_size2, token_size3;
+ double lower_bound1 = 39.1, upper_bound1 = 42.1;
+ int lower_bound2 = 295, upper_bound2 = 298;
+ hid_t query_id1, query_id2, query_id3, query_id4, query_id5, query_id6;
+ hid_t query_id;
+ hid_t e_stack;
+ H5ES_status_t status;
+ size_t num_events = 0;
+ MPI_Request mpi_reqs[6];
+
+ /* Choose the IOD VOL plugin to use with this file. */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ H5Pset_fapl_iod(fapl_id, MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ /* create an event Queue for managing asynchronous requests. */
+ e_stack = H5EScreate();
+ assert(e_stack);
+
+ /* Open an existing file. */
+ file_id = H5Fcreate_ff(file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id,
+ H5_EVENT_STACK_NULL);
+
+ ret = H5Pclose(fapl_id);
+ assert(0 == ret);
+
+ /* acquire container version 0 - EXACT. */
+ version = 0;
+ rid1 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(0 == version);
+
+ /* create transaction object */
+ tid1 = H5TRcreate(file_id, rid1, (uint64_t)1);
+ assert(tid1);
+
+ trspl_id = H5Pcreate(H5P_TR_START);
+ ret = H5Pset_trspl_num_peers(trspl_id, (unsigned int) my_size);
+ assert(0 == ret);
+ ret = H5TRstart(tid1, trspl_id, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ ret = H5Pclose(trspl_id);
+ assert(0 == ret);
+
+ /* Create the data space for the first dataset. */
+ file_space_id = H5Screate_simple(rank, dims, NULL);
+ assert(file_space_id);
+
+ if(0 == my_rank) {
+ /* create a group */
+ gid1 = H5Gcreate_ff(file_id, "G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT,
+ tid1, H5_EVENT_STACK_NULL);
+ assert(gid1 > 0);
+
+ /* Create a dataset. */
+ did1 = H5Dcreate_ff(gid1, "D1", datatype_id, file_space_id,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, H5_EVENT_STACK_NULL);
+ assert(did1);
+
+ /* Create a dataset. */
+ did2 = H5Dcreate_ff(gid1, "D2", datatype_id, file_space_id,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, H5_EVENT_STACK_NULL);
+ assert(did2);
+
+ /* Create a dataset. */
+ did3 = H5Dcreate_ff(gid1, "D3", datatype_id, file_space_id,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, tid1, H5_EVENT_STACK_NULL);
+ assert(did3);
+
+ ret = H5Gclose_ff(gid1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ /* get the token size of each dset */
+ ret = H5Oget_token(did1, NULL, &token_size1);
+ assert(0 == ret);
+ ret = H5Oget_token(did2, NULL, &token_size2);
+ assert(0 == ret);
+ ret = H5Oget_token(did3, NULL, &token_size3);
+ assert(0 == ret);
+
+ /* allocate buffers for each token */
+ dset_token1 = malloc(token_size1);
+ dset_token2 = malloc(token_size2);
+ dset_token3 = malloc(token_size3);
+
+ /* get the token buffer */
+ ret = H5Oget_token(did1, dset_token1, &token_size1);
+ assert(0 == ret);
+ ret = H5Oget_token(did2, dset_token2, &token_size2);
+ assert(0 == ret);
+ ret = H5Oget_token(did3, dset_token3, &token_size3);
+ assert(0 == ret);
+
+ /* bcast the token sizes and the tokens */
+ MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[0]);
+ MPI_Ibcast(&token_size2, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[1]);
+ MPI_Ibcast(&token_size3, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[2]);
+
+ MPI_Ibcast(dset_token1, token_size1, MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[3]);
+ MPI_Ibcast(dset_token2, token_size2, MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[4]);
+ MPI_Ibcast(dset_token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[5]);
+ MPI_Waitall(6, mpi_reqs, MPI_STATUS_IGNORE);
+ }
+ else {
+ /* recieve the token size */
+ MPI_Ibcast(&token_size1, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[0]);
+ MPI_Ibcast(&token_size2, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[1]);
+ MPI_Ibcast(&token_size3, sizeof(size_t), MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[2]);
+ MPI_Waitall(3, mpi_reqs, MPI_STATUS_IGNORE);
+
+ /* allocate buffer for token */
+ dset_token1 = malloc(token_size1);
+ dset_token2 = malloc(token_size2);
+ dset_token3 = malloc(token_size3);
+
+ /* recieve the token */
+ MPI_Ibcast(dset_token1, token_size1, MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[0]);
+ MPI_Ibcast(dset_token2, token_size2, MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[1]);
+ MPI_Ibcast(dset_token3, token_size3, MPI_BYTE, 0, MPI_COMM_WORLD,
+ &mpi_reqs[2]);
+ MPI_Waitall(3, mpi_reqs, MPI_STATUS_IGNORE);
+
+ did1 = H5Oopen_by_token(dset_token1, tid1, H5_EVENT_STACK_NULL);
+ did2 = H5Oopen_by_token(dset_token2, tid1, H5_EVENT_STACK_NULL);
+ did3 = H5Oopen_by_token(dset_token3, tid1, H5_EVENT_STACK_NULL);
+ }
+ free(dset_token1);
+ free(dset_token2);
+ free(dset_token3);
+
+ mem_space_id = H5Screate_simple(rank, count, NULL);
+ assert(mem_space_id);
+
+ /* write data to datasets */
+ ret = H5Sselect_hyperslab(file_space_id, H5S_SELECT_SET, offset,
+ NULL, count, NULL);
+ assert(0 == ret);
+
+ /* Write to the datasets. */
+ ret = H5Dwrite_ff(did1, datatype_id, mem_space_id, file_space_id,
+ H5P_DEFAULT, buf, tid1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Dwrite_ff(did2, datatype_id, mem_space_id, file_space_id,
+ H5P_DEFAULT, buf, tid1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Dwrite_ff(did3, datatype_id, mem_space_id, file_space_id,
+ H5P_DEFAULT, buf, tid1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ /* Close the data space for the first dataset. */
+ ret = H5Sclose(mem_space_id);
+ assert(0 == ret);
+
+ /* Finish transaction 1. */
+ 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;
+ rid2 = H5RCacquire(file_id, &version, H5P_DEFAULT, H5_EVENT_STACK_NULL);
+ assert(rid2 > 0);
+ assert(1 == version);
+
+ /* release container version 0. */
+ ret = H5RCrelease(rid1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* Create a simple query */
+ /* query = (39.1 < x < 42.1) || (295 < x < 298) */
+ query_id1 = H5Qcreate(H5Q_TYPE_DATA_ELEM, H5Q_MATCH_GREATER_THAN,
+ H5T_NATIVE_DOUBLE, &lower_bound1);
+ assert(query_id1);
+ query_id2 = H5Qcreate(H5Q_TYPE_DATA_ELEM, H5Q_MATCH_LESS_THAN,
+ H5T_NATIVE_DOUBLE, &upper_bound1);
+ assert(query_id2);
+ query_id3 = H5Qcombine(query_id1, H5Q_COMBINE_AND, query_id2);
+ assert(query_id3);
+ query_id4 = H5Qcreate(H5Q_TYPE_DATA_ELEM, H5Q_MATCH_GREATER_THAN,
+ H5T_NATIVE_INT, &lower_bound2);
+ assert(query_id4);
+ query_id5 = H5Qcreate(H5Q_TYPE_DATA_ELEM, H5Q_MATCH_LESS_THAN,
+ H5T_NATIVE_INT, &upper_bound2);
+ assert(query_id5);
+ query_id6 = H5Qcombine(query_id4, H5Q_COMBINE_AND, query_id5);
+ assert(query_id6);
+ query_id = H5Qcombine(query_id3, H5Q_COMBINE_OR, query_id6);
+ assert(query_id);
+
+ /* create a view on D1 */
+ view_id = H5Vcreate_ff(did1, query_id, H5P_DEFAULT, rid2, e_stack);
+ assert(view_id > 0);
+
+ {
+ hsize_t attr_count, obj_count, reg_count;
+ hssize_t num_points;
+ hid_t region_space;
+ int r_ndims;
+ hsize_t r_dims[2];
+
+ H5Qclose(query_id);
+ ret = H5Dclose_ff(did1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Vget_location_ff(view_id, &did1, e_stack);
+ assert(0 == ret);
+
+ ret = H5Vget_query(view_id, &query_id);
+ assert(0 == ret);
+
+ ret = H5Vget_counts(view_id, &attr_count, &obj_count, &reg_count);
+ assert(0 == ret);
+ assert(0 == attr_count);
+ assert(0 == obj_count);
+ assert(1 == reg_count);
+
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ ret = H5Dclose_ff(did1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Vget_elem_regions_ff(view_id, 0, 1, &did1,
+ &region_space, e_stack);
+ assert(0 == ret);
+
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ r_ndims = H5Sget_simple_extent_dims(region_space, r_dims, NULL);
+
+ assert(2 == r_ndims);
+ assert(total == r_dims[0]);
+ assert(ncomponents == r_dims[1]);
+
+ num_points = H5Sget_select_elem_npoints(region_space);
+ if(my_size > 1)
+ assert(15 == num_points);
+ else
+ assert(9 == num_points);
+
+ ret = H5Sclose(region_space);
+ assert(0 == ret);
+ }
+
+ H5Vclose(view_id);
+
+ gid1 = H5Gopen_ff(file_id, "G1", H5P_DEFAULT, rid2, e_stack);
+ assert(gid1 > 0);
+
+ /* create a view on all datasets under G1 */
+ view_id = H5Vcreate_ff(gid1, query_id, H5P_DEFAULT, rid2, e_stack);
+ assert(view_id > 0);
+
+ {
+ hsize_t attr_count, obj_count, reg_count, i;
+ hssize_t num_points;
+ hid_t regions[3];
+ hid_t did[3];
+ int r_ndims;
+ hsize_t r_dims[2];
+
+ H5Qclose(query_id);
+ ret = H5Gclose_ff(gid1, e_stack);
+ assert(0 == ret);
+
+ ret = H5Vget_location_ff(view_id, &gid1, e_stack);
+ assert(0 == ret);
+ assert(gid1 > 0);
+
+ ret = H5Vget_query(view_id, &query_id);
+ assert(0 == ret);
+
+ ret = H5Vget_counts(view_id, &attr_count, &obj_count, &reg_count);
+ assert(0 == ret);
+ assert(0 == attr_count);
+ assert(0 == obj_count);
+ assert(3 == reg_count);
+
+ ret = H5Vget_elem_regions_ff(view_id, 0, reg_count, did, regions, e_stack);
+ assert(0 == ret);
+
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ for(i=0 ; i<reg_count ; i++) {
+
+ assert(did[i] > 0);
+ ret = H5Dclose_ff(did[i], e_stack);
+ assert(0 == ret);
+
+ r_ndims = H5Sget_simple_extent_dims(regions[i], r_dims, NULL);
+
+ assert(2 == r_ndims);
+ assert(total == r_dims[0]);
+ assert(ncomponents == r_dims[1]);
+
+ num_points = H5Sget_select_elem_npoints(regions[i]);
+ if(my_size > 1)
+ assert(15 == num_points);
+ else
+ assert(9 == num_points);
+
+ ret = H5Sclose(regions[i]);
+ assert(0 == ret);
+ }
+ }
+
+ H5ESget_count(e_stack, &num_events);
+ H5ESwait_all(e_stack, &status);
+ H5ESclear(e_stack);
+ printf("%d events in event stack. Completion status = %d\n", num_events, status);
+
+ H5Vclose(view_id);
+
+ H5Qclose(query_id);
+ H5Qclose(query_id6);
+ H5Qclose(query_id5);
+ H5Qclose(query_id4);
+ H5Qclose(query_id3);
+ H5Qclose(query_id2);
+ H5Qclose(query_id1);
+
+ ret = H5Gclose_ff(gid1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5Dclose_ff(did1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ ret = H5Dclose_ff(did2, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ ret = H5Dclose_ff(did3, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+ ret = H5Sclose(file_space_id);
+ assert(0 == ret);
+
+ /* release container version 1. */
+ ret = H5RCrelease(rid2, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+
+ ret = H5RCclose(rid1);
+ assert(0 == ret);
+ ret = H5RCclose(rid2);
+ assert(0 == ret);
+ ret = H5TRclose(tid1);
+ assert(0 == ret);
+
+ ret = H5ESclose(e_stack);
+ assert(ret == 0);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ /* Close the file. */
+ ret = H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL);
+ assert(0 == ret);
+}
+
+int
+main(int argc, char **argv)
+{
+ const char *file_name="eff_file_view.h5";
+ const char *dataset_name="D1";
+ hsize_t ntuples = NTUPLES;
+ hsize_t ncomponents = 3;
+ hsize_t start, total;
+ int *data;
+ hsize_t i, j;
+
+ int provided;
+
+ MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
+ if(MPI_THREAD_MULTIPLE != provided) {
+ fprintf(stderr, "MPI does not have MPI_THREAD_MULTIPLE support\n");
+ exit(1);
+ }
+
+ /* Call EFF_init to initialize the EFF stack. */
+ EFF_init(MPI_COMM_WORLD, MPI_INFO_NULL);
+
+ MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &my_size);
+ fprintf(stderr, "APP processes = %d, my rank is %d\n", my_size, my_rank);
+
+ start = ntuples * (hsize_t) my_rank;
+ total = ntuples * (hsize_t) my_size;
+
+ /* Initialize the dataset. */
+ data = (int *) malloc(sizeof(int) * ncomponents * ntuples);
+ for (i = 0; i < ntuples; i++) {
+ for (j = 0; j < ncomponents; j++) {
+ data[ncomponents * i + j] = my_rank * ntuples + i;
+ }
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ test_view(file_name, dataset_name, total, ncomponents, H5T_NATIVE_INT,
+ ntuples, start, data);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ free(data);
+
+ MPI_Barrier(MPI_COMM_WORLD);
+ EFF_finalize();
+ MPI_Finalize();
+
+ return 0;
+}
diff --git a/testff/h5ff_client_vl_data.c b/testff/h5ff_client_vl_data.c
index b82f40c..c08230d 100644
--- a/testff/h5ff_client_vl_data.c
+++ b/testff/h5ff_client_vl_data.c
@@ -299,7 +299,7 @@ int main(int argc, char **argv) {
ret = H5Dclose_ff(did2, e_stack);
assert(ret == 0);
- H5Fclose_ff(file_id, H5_EVENT_STACK_NULL);
+ H5Fclose_ff(file_id, 1, H5_EVENT_STACK_NULL);
H5ESget_count(e_stack, &num_events);
H5ESwait_all(e_stack, &status);