summaryrefslogtreecommitdiffstats
path: root/examples/h5dsm_test.sh
blob: d82d77ffbb3b840827d433f44672445b5458172d (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
POOL_UUID=$1
EXEC_ARGS="-x DD_MASK=\"all\" --hostfile $HOME/my_hosts --ompi-server file:~/uri.txt"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# H5Lexists (should be FALSE)
echo h5dsm_link_exists file.h5 /slink/slroot/slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID file.h5 /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.h5 /slink/slroot/dset slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_slink_create $POOL_UUID file.h5 /slink/slroot/dset slpath
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

# H5Lexists (should be TRUE)
echo h5dsm_link_exists file.h5 /slink/slroot/slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID file.h5 /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.h5 slink/slroot/slpath
orterun -np 1 $EXEC_ARGS ./h5dsm_group_open $POOL_UUID file.h5 slpath
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

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

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

# H5Literate grp
echo h5dsm_link_iter file.h5 grp
orterun -np 1 $EXEC_ARGS ./h5dsm_link_iter $POOL_UUID file.h5 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.h5 / attrroot
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_create $POOL_UUID file.h5 / attrroot
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

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

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

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

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

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

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

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

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

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

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

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

# H5Aiterate on dataset
echo h5dsm_attr_iter file.h5 /dset
orterun -np 1 $EXEC_ARGS ./h5dsm_attr_iter $POOL_UUID file.h5 /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.h5 /
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open $POOL_UUID file.h5 /
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

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

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

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

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

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

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

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

# H5Oget_info dataset
echo h5dsm_obj_info file.h5 /dset
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_info $POOL_UUID file.h5 /dset | 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.h5 0x0000000000000001
orterun -np 1 $EXEC_ARGS ./h5dsm_obj_open_addr $POOL_UUID file.h5 0x0000000000000001
if test $? -ne 0; then
    echo FAILED
    exit 1
fi

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

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

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

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

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

# --------------- Snapshots --------------- #
# H5Lexists before slink created (should be FALSE)
echo h5dsm_link_exists file.h5 grp2 7
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID file.h5 slink 7 | 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.h5 grp2 8
orterun -np 1 $EXEC_ARGS ./h5dsm_link_exists $POOL_UUID file.h5 slink 8 | 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

# --------------- Output Comparison --------------- #
# Disabled due to DAOS debug messages
#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