summaryrefslogtreecommitdiffstats
path: root/examples/h5dsm_test.sh
blob: 4c635723e5a7116b8973cfabb811077bb923ad54 (plain)
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
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
POOL_UUID=$1
EXEC_ARGS="-x DD_MASK=\"all\" --ompi-server file:~/uri.txt"
FILE="h5dsm_test.h5"

# --------------- SETUP --------------- #
# Create file
echo h5dsm_file_create $FILE
orterun -np 1 $EXEC_ARGS ./h5dsm_file_create $POOL_UUID $FILE
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_file_create $FILE \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_file_create $POOL_UUID $FILE
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open file
echo h5dsm_file_open $FILE
orterun -np 1 $EXEC_ARGS ./h5dsm_file_open $POOL_UUID $FILE
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_file_open $FILE \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_file_open $POOL_UUID $FILE
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create group
echo h5dsm_group_create $FILE grp
orterun -np 1 $EXEC_ARGS ./h5dsm_group_create $POOL_UUID $FILE grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open group
echo h5dsm_group_open $FILE grp
orterun -np 1 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_group_open $FILE grp \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create dataset
echo h5dsm_dset_create $FILE dset
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_create $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create dset2
echo h5dsm_dset_create $FILE dset2 \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_dset_create $POOL_UUID $FILE dset2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open dataset
echo h5dsm_dset_open $FILE /dset
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_open $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_dset_open $FILE /dset \(2 processes\)
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_open $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open dset2
echo h5dsm_dset_open $FILE dset2
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_open $POOL_UUID $FILE dset2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_dset_open $FILE dset2 \(2 processes\)
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_open $POOL_UUID $FILE dset2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- DSET IO --------------- #
# Write dataset
echo h5dsm_dset_write $FILE dset
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_write $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# "Write Partial" test
echo h5dsm_dset_wpartial $FILE dset2 \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_dset_wpartial $POOL_UUID $FILE dset2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Read dataset
echo h5dsm_dset_read $FILE dset2
orterun -np 1 $EXEC_ARGS ./h5dsm_dset_read $POOL_UUID $FILE dset2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# "Read Partial" test
echo h5dsm_dset_rpartial $FILE dset \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_dset_rpartial $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- MAPS --------------- #
echo h5dsm_map $FILE
orterun -np 1 $EXEC_ARGS ./h5dsm_map $POOL_UUID $FILE
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- LINKS --------------- #
# H5Lexists (should be FALSE)
echo h5dsm_link_exists $FILE grp2
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID $FILE grp2 | tee h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create grp2 \(2 processes\)
echo h5dsm_group_create $FILE grp2 -s
orterun -np 2 $EXEC_ARGS ./h5dsm_group_create $POOL_UUID $FILE grp2 -s
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Lexists (should be TRUE)
echo h5dsm_link_exists $FILE grp2
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID $FILE grp2 | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create slink
echo h5dsm_slink_create $FILE grp slink -s
orterun -np 1 $EXEC_ARGS ./h5dsm_slink_create $POOL_UUID $FILE grp slink -s
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open slink
echo h5dsm_group_open $FILE slink
orterun -np 1 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE slink
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_group_open $FILE slink \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE slink
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create slroot
echo h5dsm_slink_create $FILE / grp/slroot
orterun -np 1 $EXEC_ARGS ./h5dsm_slink_create $POOL_UUID $FILE / grp/slroot
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open slroot
echo h5dsm_group_open $FILE /slink/slroot/grp
orterun -np 1 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE /slink/slroot/grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_group_open $FILE /slink/slroot/grp \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE /slink/slroot/grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Lexists (should be FALSE)
echo h5dsm_link_exists $FILE /slink/slroot/slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID $FILE /slink/slroot/slpath | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create slpath
echo h5dsm_slink_create $FILE /slink/slroot/dset slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_slink_create $POOL_UUID $FILE /slink/slroot/dset slpath
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Lexists (should be TRUE)
echo h5dsm_link_exists $FILE /slink/slroot/slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID $FILE /slink/slroot/slpath | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open slpath
echo h5dsm_dset_open $FILE slink/slroot/slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE slpath
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_dset_open $FILE slink/slroot/slpath \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID $FILE slpath
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Literate root
echo h5dsm_link_iter $FILE /
orterun -np 1 $EXEC_ARGS ./h5dsm_link_iter $POOL_UUID $FILE / | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Literate grp
echo h5dsm_link_iter $FILE grp
orterun -np 1 $EXEC_ARGS ./h5dsm_link_iter $POOL_UUID $FILE grp | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Attributes --------------- #
# Create attribute on root group
echo h5dsm_attr_create $FILE / attrroot
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_create $POOL_UUID $FILE / attrroot
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open attribute
echo h5dsm_attr_open $FILE / attrroot
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_open $POOL_UUID $FILE / attrroot
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Write attribute
echo h5dsm_attr_write $FILE / attrroot
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_write $POOL_UUID $FILE / attrroot
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Read attribute
echo h5dsm_attr_read $FILE / attrroot
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_read $POOL_UUID $FILE / attrroot
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create attribute on group
echo h5dsm_attr_create $FILE grp attrgrp
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_create $POOL_UUID $FILE grp attrgrp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open attribute
echo h5dsm_attr_open $FILE /grp attrgrp
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_open $POOL_UUID $FILE /grp attrgrp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create attribute on dataset
echo h5dsm_attr_create $FILE /dset attrdset
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_create $POOL_UUID $FILE /dset attrdset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open attribute
echo h5dsm_attr_open $FILE dset attrdset
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_open $POOL_UUID $FILE dset attrdset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Create additional attribute on root group
echo h5dsm_attr_create $FILE / attrroot2
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_create $POOL_UUID $FILE / attrroot2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# Open attribute
echo h5dsm_attr_open $FILE / attrroot2
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_open $POOL_UUID $FILE / attrroot2
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Aiterate on root group
echo h5dsm_attr_iter $FILE /
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_iter $POOL_UUID $FILE / | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Aiterate on group
echo h5dsm_attr_iter $FILE grp
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_iter $POOL_UUID $FILE grp | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Aiterate on dataset
echo h5dsm_attr_iter $FILE /dset
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_iter $POOL_UUID $FILE /dset | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Objects --------------- #
# H5Oopen root group
echo h5dsm_obj_open $FILE /
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE /
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open $FILE / \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE /
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen group
echo h5dsm_obj_open $FILE /grp
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE /grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open $FILE /grp \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE /grp
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen dataset
echo h5dsm_obj_open $FILE dset
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open $FILE dset \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE dset
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen map
echo h5dsm_obj_open $FILE MAP_VL_T
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE MAP_VL_T
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open $FILE MAP_VL_T \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID $FILE MAP_VL_T
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oget_info root group
echo h5dsm_obj_info $FILE /
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_info $POOL_UUID $FILE / | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oget_info group
echo h5dsm_obj_info $FILE grp
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_info $POOL_UUID $FILE grp | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oget_info dataset
echo h5dsm_obj_info $FILE /dset
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_info $POOL_UUID $FILE /dset | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oget_info map
echo h5dsm_obj_info $FILE /MAP_VL_T
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_info $POOL_UUID $FILE /MAP_VL_T | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen_by_addr root group
echo h5dsm_obj_open_addr $FILE 0x0000000000000001
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0x0000000000000001
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open_addr $FILE 0x0000000000000001 \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0x0000000000000001
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen_by_addr group
echo h5dsm_obj_open_addr $FILE 0x0000000000000002
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0x0000000000000002
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open_addr $FILE 0x0000000000000002 \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0x0000000000000002
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen_by_addr dataset
echo h5dsm_obj_open_addr $FILE 0x4000000000000003
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0x4000000000000003
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open_addr $FILE 0x4000000000000003 \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0x4000000000000003
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Oopen_by_addr dataset
echo h5dsm_obj_open_addr $FILE 0xc000000000000005
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0xc000000000000005
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_obj_open_addr $FILE 0xc000000000000005 \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID $FILE 0xc000000000000005
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Snapshots --------------- #
# H5Lexists before slink created (should be FALSE)
echo h5dsm_link_exists $FILE grp2 9
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID $FILE slink 9 | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Lexists after slink created (should be TRUE)
echo h5dsm_link_exists $FILE grp2 10
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID $FILE slink 10 | tee -a h5dsm_test.out
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Type Conversion --------------- #
echo h5dsm_ttconv
orterun -np 1 $EXEC_ARGS ./h5dsm_ttconv $POOL_UUID -q
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Variable Length Types --------------- #
echo h5dsm_tvlen
orterun -np 1 $EXEC_ARGS ./h5dsm_tvlen $POOL_UUID -q
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Committed Datatypes --------------- #
echo h5dsm_tcommit
orterun -np 1 $EXEC_ARGS ./h5dsm_tcommit $POOL_UUID -q
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

echo h5dsm_tcommit \(2 processes\)
orterun -np 2 $EXEC_ARGS ./h5dsm_tcommit $POOL_UUID -q
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# --------------- Output Comparison --------------- #
sed -i -e 's/#.*//' -e 's/[ ^I]*$//' -e '/^$/ d' h5dsm_test.out
echo cmp h5dsm_test.out h5dsm_test.out.exp
cmp h5dsm_test.out h5dsm_test.out.exp
if test $? -ne 0; then
    echo h5dsm_test.out does not match h5dsm_test.out.exp
    echo FAILED
    exit 1
fi

echo PASSED
exit 0