/* * test_client.c: Client side of Milestone 4.2 Asynchronous I/O and initial * IOD VOL plugin demonstration. This is, in effect, the application program that * would run on one or more compute nodes and make calls to the HDF5 API. */ #include #include #include #include #include "mpi.h" #include "hdf5.h" int main(int argc, char **argv) { const char file_name1[]="eff_file_1"; const char file_name2[]="eff_file_2"; hid_t fid1, fid2; hid_t gid1, gid2; hid_t did1, did2; hid_t dtid1, dtid2; hid_t sid; hid_t tid1, tid2, rid1, rid2, rid3, rid4; hid_t fapl_id, trspl_id; hid_t e_stack; void *token1, *token2, *token3, *token4, *token5, *token6; size_t token_size1, token_size2, token_size3, token_size4, token_size5, token_size6; uint64_t version; uint64_t trans_num; const unsigned int nelem=60; int *wdata1 = NULL, *wdata2 = NULL; int *rdata1 = NULL, *rdata2 = NULL; unsigned int i = 0; hsize_t dims[1]; int my_rank, my_size; int provided; MPI_Request mpi_req, mpi_reqs[12]; 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); /* allocate and initialize arrays for dataset & attribute writes and reads. The write arrays are intialized to contain 60 integers (0-59). The read arrays are intialized to contain 60 integers all 0s. */ wdata1 = malloc (sizeof(int)*nelem); wdata2 = malloc (sizeof(int)*nelem); rdata1 = malloc (sizeof(int)*nelem); rdata2 = malloc (sizeof(int)*nelem); for(i=0;i