-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.c
572 lines (471 loc) · 19.5 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
/******************************************************************************
*** Example code of how to use the INHDF5 API
***
*** Copyright (c) 2020-2024 Ioannis Nompelis
*** Ioannis Nompelis <nompelis@nobelware.com>
******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <mpi.h>
#include <hdf5.h>
#include "inUtils_HDF5.h"
// The original demonstration that uses 2 ranks (processes)
int oldtest()
{
int ierr=0;
int irank,nrank;
MPI_Comm comm;
hid_t id_alist, id_file, id_grp, id_data;
hid_t id_type, id_space;
hsize_t idims[1],ioff[1],icnt[1];
int* idum;
int n;
MPI_Comm_dup( MPI_COMM_WORLD, &comm );
MPI_Comm_rank( comm, &irank );
MPI_Comm_size( comm, &nrank );
if( nrank > 2 ) {
printf("This demo is meant to run with 2 processes \n");
return 1;
}
//-- open the HDF5 API
H5open();
// create a file
ierr = inUtils_HDF_CreateFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("File creation success\n");
// close the file to subsequently test the opening of a file
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("File closing success\n");
// open a file
ierr = inUtils_HDF_OpenFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("File opening success\n");
// create a group
ierr = inUtils_HDF_CreateGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf("Group creation success\n");
// close this group the test subsequent opening of the group
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf("Group closing success\n");
// open a group
ierr = inUtils_HDF_OpenGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf("Group opening success\n");
// create a dataspace (to use in creating a dataset)
idims[0] = 20;
id_space = H5Screate_simple( 1, idims, idims );
// create a dataset
id_type = H5T_NATIVE_INT;
ierr = inUtils_HDF_CreateDataset( "my_dataset", comm, id_grp,
id_type, id_space,
&id_data );
if( ierr == 0 ) if( irank == 0 ) printf("Dataset creation success\n");
// close the dataset so that we can test the re-opening
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf("Dataset closing success\n");
// close the space that is no longer needed
H5Sclose( id_space );
// open a dataset
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, &id_type, &id_space );
if( ierr == 0 ) if( irank == 0 ) printf("Dataset opening success\n");
// create an array to write to the dataset
idum = (int*) malloc( 10 * sizeof(int) ); // no error-trapping
for(n=0;n<10;++n) idum[n] = irank + 1;
// write to the dataset
if( irank == 0 ) ioff[0] = 0;
if( irank == 1 ) ioff[0] = 10;
icnt[0] = 10;
ierr = inUtils_HDF_DatasetWrite( comm, id_data, id_type, id_space,
1, ioff, icnt, idum );
if( ierr == 0 ) if( irank == 0 ) printf("Write to dataset successful\n");
// close the dataset so that we can test the re-opening and re-reading
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf("Dataset closing success\n");
// close the space
H5Sclose( id_space );
// change the stored data to something other than what we will read
for(n=0;n<10;++n) idum[n] = irank + 1;
// open the dataset so that we can test reading
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, &id_type, &id_space );
if( ierr == 0 ) if( irank == 0 ) printf("Dataset opening success\n");
// read the dataset
if( irank == 0 ) ioff[0] = 0;
if( irank == 1 ) ioff[0] = 10;
icnt[0] = 10;
ierr = inUtils_HDF_DatasetRead( comm, id_data, id_type, id_space,
1, ioff, icnt, idum );
if( ierr == 0 ) if( irank == 0 ) printf("Reading from dataset successful\n");
// close the dataset for doog
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf("Dataset closing success\n");
// close the space
H5Sclose( id_space );
// show the contents of the buffer as we read it
if( irank == 0 ) {
printf(" Rank 0 data: ");
for(n=0;n<10;++n) printf(" %d",idum[n]);
printf(" \n");
sleep(1);
MPI_Barrier( comm );
} else {
MPI_Barrier( comm );
printf(" Rank 1 data: ");
for(n=0;n<10;++n) printf(" %d",idum[n]);
printf(" \n");
sleep(1);
}
// drop buffer
free( idum );
printf("Final termination \n");
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
//-- close the HDF5 and MPI APIs
H5close();
return 0;
}
// A demonstration involving more complex dataset
int test( MPI_Comm* comm_ )
{
int ierr=0;
int irank,nrank;
MPI_Comm comm;
MPI_Comm_dup( *comm_, &comm );
MPI_Comm_rank( comm, &irank );
MPI_Comm_size( comm, &nrank );
hid_t id_alist, id_file, id_grp, id_data;
hid_t id_type, id_space;
hsize_t idims[2],ioff[2],icnt[2];
long int* idum;
long int n,nseg,nc,nmax,noff;
double t0 = MPI_Wtime(), t1;
// build a large array on this process (with rectangular data)
nseg = 1000*1000; // number of "rows" in every rank's segment
nc = 10; // number of "columns" for the data table
idum = (long int*) malloc( (size_t) (nseg*nc) * sizeof(long int) );
if( idum == NULL ) {
printf("Allocation error\n");
exit(1); // abnormal exit; the MPI runtime env will terminate them all
}
nmax = ((long int) nrank) * nseg;
noff = ((long int) irank) * nseg;
//-- open the HDF5 API
H5open();
// create a file
ierr = inUtils_HDF_CreateFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File creation success\n");
// close the file (and its list) to subsequently test the opening of a file
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("< File closing success\n");
// open a file
ierr = inUtils_HDF_OpenFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File opening success\n");
// create a group
ierr = inUtils_HDF_CreateGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group creation success\n");
// close this group the test subsequent opening of the group
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf("<< Group closing success\n");
// open a group
ierr = inUtils_HDF_OpenGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group opening success\n");
// create a dataspace (to use in creating a dataset)
idims[0] = (hsize_t) nmax;
idims[1] = (hsize_t) nc;
id_space = H5Screate_simple( 2, idims, idims );
// create a dataset
if( irank == 0 ) printf(">>> Creating dataset\n");
id_type = H5T_NATIVE_LONG;
ierr = inUtils_HDF_CreateDataset( "my_dataset", comm, id_grp,
id_type, id_space,
&id_data );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset creation success\n");
// close the dataset so that we can test the re-opening
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf("<<< Dataset closing success\n");
// close the space that is no longer needed
H5Sclose( id_space );
// open a dataset
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, &id_type, &id_space );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset opening success\n");
if( irank == 0 ) printf(" Constructing data\n");
// put data in the array, of the form "row * 100 + column"
for(n=0;n<nseg;++n) {
for(long int k=0;k<nc;++k) {
idum[ n*nc + k ] = (noff + n+1)*100 + k;
}
}
// write to the dataset
if( irank == 0 ) printf(">>> Writing to dataset\n");
ioff[0] = (hsize_t) noff;
ioff[1] = (hsize_t) 0;
icnt[0] = (hsize_t) nseg;
icnt[1] = (hsize_t) nc;
ierr = inUtils_HDF_DatasetWrite( comm, id_data, id_type, id_space,
2, ioff, icnt, idum );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Write to dataset successful\n");
// close the dataset so that we can test the re-opening and re-reading
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf("<<< Dataset closing success\n");
// close the space
H5Sclose( id_space );
// change the stored data to something other than what we will read
if( irank == 0 ) printf(" Corrupting data in memory\n");
for(n=0;n<nseg;++n) {
for(long int k=0;k<nc;++k) {
idum[ n*nc + k ] = ~( (noff + n)*100 + k ); // flip all bits
}
}
if( irank == 0 ) {
printf(" Rank 0 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
sleep(1);
MPI_Barrier( comm );
} else if( irank == nrank-1 ) {
MPI_Barrier( comm );
printf(" Rank 1 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
} else {
MPI_Barrier( comm );
}
// open the dataset so that we can test reading
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, &id_type, &id_space );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset opening success\n");
// read the dataset
ioff[0] = (hsize_t) noff;
ioff[1] = (hsize_t) 0;
icnt[0] = (hsize_t) nseg;
icnt[1] = (hsize_t) nc;
ierr = inUtils_HDF_DatasetRead( comm, id_data, id_type, id_space,
2, ioff, icnt, idum );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Reading dataset successful\n");
// close the dataset
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf("<<< Dataset closing success\n");
// close the space
H5Sclose( id_space );
// show the contents of the buffer as we read it
if( irank == 0 ) {
printf(" Rank 0 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
sleep(1);
MPI_Barrier( comm );
} else if( irank == nrank-1 ) {
MPI_Barrier( comm );
printf(" Rank 1 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
} else {
MPI_Barrier( comm );
}
// drop buffer
free( idum );
if( irank == 0 ) printf("<< Closing group\n");
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
if( irank == 0 ) printf("< Closing file\n");
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
t1 = MPI_Wtime();
if( irank == 0 ) printf(" Final termination after %lf sec\n",t1-t0);
//-- close the HDF5 and MPI APIs
H5close();
return 0;
}
// Some testing of mine...
int test2( MPI_Comm* comm_ )
{
int ierr=0;
int irank,nrank;
MPI_Comm comm;
MPI_Comm_dup( *comm_, &comm );
MPI_Comm_rank( comm, &irank );
MPI_Comm_size( comm, &nrank );
hid_t id_alist, id_file, id_grp, id_data;
hid_t id_type, id_space;
int nd=2; // change to "1" to use a 1D layout (dimension 2 will be ignored)
hsize_t idims[2],ioff[2],icnt[2];
long int* idum;
long int n,nseg,nc,nmax,noff;
double t0,t1;
// build a large array on this process (with rectangular data)
nseg = 1000*1000; // number of "rows" in every rank's segment
nc = 10; // number of "columns" for the data table
idum = (long int*) malloc( (size_t) (nseg*nc) * sizeof(long int) );
if( idum == NULL ) {
printf("Allocation error\n");
exit(1); // abnormal exit; the MPI runtime env will terminate them all
}
nmax = ((long int) nrank) * nseg;
noff = ((long int) irank) * nseg;
//-- open the HDF5 API
H5open();
t0 = MPI_Wtime();
// create a file IN PARALLEL
ierr = inUtils_HDF_CreateFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File creation success\n");
// close the file to subsequently test the opening of a file
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File closing success\n");
// open a file IN PARALLEL
ierr = inUtils_HDF_OpenFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File opening success\n");
// create a group IN PARALLEL
ierr = inUtils_HDF_CreateGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group creation success\n");
// close this group the test subsequent opening of the group
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group closing success\n");
// open a group IN PARALLEL
ierr = inUtils_HDF_OpenGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group opening success\n");
// create a dataspace (to use in creating a dataset)
idims[0] = (hsize_t) nmax;
if( nd == 1 ) idims[0] = (hsize_t) (nc*nmax);
idims[1] = (hsize_t) nc;
id_space = H5Screate_simple( nd, idims, idims );
// create a dataset IN PARALLEL
if( irank == 0 ) printf(">>> Creating dataset...\n");
id_type = H5T_NATIVE_LONG;
ierr = inUtils_HDF_CreateDataset( "my_dataset", comm, id_grp,
id_type, id_space,
&id_data );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset creation success\n");
// close the dataset so that we can test the re-opening
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset closing success\n");
// close the space that is no longer needed
H5Sclose( id_space );
// open a dataset IN PARALLEL (not requesting back type and space)
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, NULL, NULL );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset opening success\n");
// close everything
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset closing success\n");
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group closing success\n");
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File closing success\n");
t1 = MPI_Wtime();
if( irank == 0 ) printf("Time elapsed: %lf sec\n",t1-t0);
// put data in the array, of the form "row * 100 + column"
for(n=0;n<nseg;++n) {
for(long int k=0;k<nc;++k) {
idum[ n*nc + k ] = (noff + n+1)*100 + k;
}
}
if( irank == 0 ) printf("Opening and writing in PARALLEL \n");
sleep(1);
t0 = MPI_Wtime();
ierr = inUtils_HDF_OpenFile( "TEST_FILE", comm, &id_alist, &id_file );
if( ierr == 0 ) if( irank == 0 ) printf("> File opening success\n");
ierr = inUtils_HDF_OpenGroup( "my_group", comm, id_file, &id_grp );
if( ierr == 0 ) if( irank == 0 ) printf(">> Group opening success\n");
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, &id_type, &id_space );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset opening success\n");
if( irank == 0 ) printf("[Space number of dims: %d]\n",
H5Sget_simple_extent_ndims( id_space ) );
/////// cleanup if we do not continue ////////
// ierr = inUtils_HDF_CloseDataset( comm, &id_data );
// H5Sclose( id_space );
// ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
// ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
// write to the dataset
if( irank == 0 ) printf(">>> Writing to dataset...\n");
ioff[0] = (hsize_t) noff;
ioff[1] = (hsize_t) 0;
icnt[0] = (hsize_t) nseg;
icnt[1] = (hsize_t) nc;
if( nd == 1 ) {
ioff[0] = (hsize_t) (nc*noff);
icnt[0] = (hsize_t) (nc*nseg);
}
ierr = inUtils_HDF_DatasetWrite( comm, id_data, id_type, id_space,
nd, ioff, icnt, idum );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Write to dataset successful\n");
// close the dataset so that we can test the re-opening and re-reading
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset closing success\n");
H5Sclose( id_space );
/////// cleanup if we do not continue ////////
// ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
// if( ierr == 0 ) if( irank == 0 ) printf(">> Group closing success\n");
// ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
// if( ierr == 0 ) if( irank == 0 ) printf("> File closing success\n");
t1 = MPI_Wtime();
if( irank == 0 ) printf("Time elapsed: %lf sec\n",t1-t0);
// change the stored data to something other than what we will read
for(n=0;n<nseg;++n) {
for(long int k=0;k<nc;++k) {
idum[ n*nc + k ] = ~( (noff + n)*100 + k ); // flip all bits
}
}
if( irank == 0 ) {
printf(" Rank 0 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
sleep(1);
MPI_Barrier( comm );
} else if( irank == nrank-1 ) {
MPI_Barrier( comm );
printf(" Rank 1 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
} else {
MPI_Barrier( comm );
}
t0 = MPI_Wtime();
if( irank == 0 ) printf("About to read back the data from the open file\n");
// open the dataset so that we can test reading
if( irank == 0 ) printf(">>> Opening dataset\n");
ierr = inUtils_HDF_OpenDataset( "my_dataset", comm, id_grp,
&id_data, &id_type, &id_space );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset opening success\n");
// read the dataset
if( irank == 0 ) printf(">>> Reading from dataset...\n");
ioff[0] = (hsize_t) noff;
ioff[1] = (hsize_t) 0;
icnt[0] = (hsize_t) nseg;
icnt[1] = (hsize_t) nc;
if( nd == 1 ) {
ioff[0] = (hsize_t) (nc*noff);
icnt[0] = (hsize_t) (nc*nseg);
}
ierr = inUtils_HDF_DatasetRead( comm, id_data, id_type, id_space,
nd, ioff, icnt, idum );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Reading successful\n");
// close the dataset
ierr = inUtils_HDF_CloseDataset( comm, &id_data );
if( ierr == 0 ) if( irank == 0 ) printf(">>> Dataset closing success\n");
// close the space
H5Sclose( id_space );
// show the contents of the buffer as we read it
if( irank == 0 ) {
printf(" Rank 0 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
sleep(1);
MPI_Barrier( comm );
} else if( irank == nrank-1 ) {
MPI_Barrier( comm );
printf(" Rank 1 data: ");
for(n=0;n<10;++n) printf(" %ld",idum[n]);
printf(" \n");
} else {
MPI_Barrier( comm );
}
if( irank == 0 ) printf(">> Closing group\n");
ierr = inUtils_HDF_CloseGroup( comm, &id_grp );
if( irank == 0 ) printf("> Closing file\n");
ierr = inUtils_HDF_CloseFile( comm, &id_alist, &id_file );
t1 = MPI_Wtime();
if( irank == 0 ) printf("Final termination after %lf sec\n",t1-t0);
// drop buffer
free( idum );
//-- close the HDF5 and MPI APIs
H5close();
return 0;
}