Debian Codegraph @

packages/seacas/libraries/exodus/test/makedmp

raw
1 #! /usr/bin/env bash
2 # Copyright(C) 1999-2021, 2024 National Technology & Engineering Solutions
3 # of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 # NTESS, the U.S. Government retains certain rights in this software.
5 #
6 # See packages/seacas/LICENSE for details
7
8 # script to run all tests and compare them to saved dump files.
9 #
10 # To run the tests with valgrind checking, uncomment the next line and comment the
11 # following line. Can also define other prefixes if wanted.
12
13 if [ "$1" == "" ]; then
14 mkdir -p nc3; cd nc3
15 fi
16 if [ "$1" == "netcdf4" ]; then
17 export EXODUS_NETCDF4=quiet
18 mkdir -p nc4; cd nc4
19 fi
20 if [ "$1" == "netcdf5" ]; then
21 export EXODUS_NETCDF5=quiet
22 mkdir -p nc5; cd nc5
23 fi
24
25
26 #set PREFIX = "valgrind --tool=memcheck"
27 PREFIX=""
28 SUFFIX=""
29 BINDIR=/Users/gdsjaar/src/seacas/build/packages/seacas/libraries/exodus/test
30 SRCDIR=/Users/gdsjaar/src/seacas/packages/seacas/libraries/exodus/test
31 NCDUMP=/Users/gdsjaar/src/seacas/bin/ncdump
32 THREAD_SAFE=@SEACASExodus_ENABLE_THREADSAFE@
33
34 DIFF="diff -w"
35
36 rm -f test.output
37 echo "testwt - single precision write test..."
38 echo "begin testwt" > test.output
39 ${PREFIX} ${BINDIR}/testwt${SUFFIX} >> test.output
40 echo "end testwt" >> test.output
41 # Filter out the "maximum_name_length" attribute. Moves around in ncdump output for nc4 vs nc3
42 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
43
44 echo "testrd - single precision read test..."
45 echo "begin testrd" >> test.output
46 ${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd.dmp
47 echo "end testrd" >> test.output
48
49 echo "testcp_ss - single-to-single precision copy test..."
50 echo "begin testcp_ss" >> test.output
51 ${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
52 echo "end testcp_ss" >> test.output
53 ${NCDUMP} -d5,5 testcp.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testcp_ss.dmp
54
55 echo "testcp_sd - single-to-double precision copy test..."
56 echo "begin testcp_sd" >> test.output
57 ${PREFIX} ${BINDIR}/testcpd${SUFFIX} >> test.output
58 echo "end testcp_sd" >> test.output
59 ${NCDUMP} -d5,5 testcpd.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testcp_sd.dmp
60
61 echo "testcp_nl - normal_model to large_model single precision copy test..."
62 echo "begin testcp_nl" >> test.output
63 ${PREFIX} ${BINDIR}/testcp_nl${SUFFIX} >> test.output
64 echo "end testcp_nl" >> test.output
65 ${NCDUMP} -d5,5 testcp_nl.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testcp_nl.dmp
66
67 echo "testcp_transient - copy mesh and transient data..."
68 echo "begin testcp_tran" >> test.output
69 ${PREFIX} ${BINDIR}/testcp_tran${SUFFIX} >> test.output
70 echo "end testcp_tran" >> test.output
71 ${NCDUMP} -d5,5 testcp.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testcp_tran.dmp
72
73 echo "testwt_clb - single precision write test using concatenated puts..."
74 echo "begin testwt_clb" >> test.output
75 ${PREFIX} ${BINDIR}/testwt_clb${SUFFIX} >> test.output
76 echo "end testwt_clb" >> test.output
77 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/test_clb.dmp
78
79 echo "testwtd - double precision write test..."
80 echo "begin testwtd" >> test.output
81 ${PREFIX} ${BINDIR}/testwtd${SUFFIX} >> test.output
82 echo "end testwtd" >> test.output
83 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testd.dmp
84
85 echo "testrdd - double precision read test..."
86 echo "begin testrdd" >> test.output
87 ${PREFIX} ${BINDIR}/testrdd${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrdd.dmp
88 echo "end testrdd" >> test.output
89
90 echo "testcp_dd - double-to-double precision copy test..."
91 echo "begin testcp_dd" >> test.output
92 ${PREFIX} ${BINDIR}/testcpd${SUFFIX} >> test.output
93 echo "end testcp_dd" >> test.output
94 ${NCDUMP} -d5,5 testcpd.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testcp_dd.dmp
95
96 echo "testcp_ds - double-to-single precision copy test..."
97 echo "begin testcp_ds" >> test.output
98 ${PREFIX} ${BINDIR}/testcp${SUFFIX} >> test.output
99 echo "end testcp_ds" >> test.output
100 ${NCDUMP} -d5,5 testcp.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testcp_ds.dmp
101
102 echo "testwt1 - single precision write files with several side sets..."
103 echo "testwt1 ... [Expect WEDGE6 warning from this test]"
104 echo "begin testwt1" >> test.output
105 ${PREFIX} ${BINDIR}/testwt1${SUFFIX} >> test.output
106 echo "end testwt1" >> test.output
107 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/test1.dmp
108
109 echo "testrd1 - single precision read test of a file with several side sets..."
110 echo "testrd1 ... [Expect file create failure error, NOCLOBBER]"
111 echo "testrd1 ... [Expect failure locating elem var 1 for elem block 12]"
112 echo "begin testrd1" >> test.output
113 ${PREFIX} ${BINDIR}/testrd1${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd1.dmp
114 echo "end testrd1" >> test.output
115
116 echo "testwt_ss - write files to test side sets..."
117 echo "testwt_ss ... [Expect WEDGE6 warning from this test]"
118 echo "begin testwt_ss" >> test.output
119 ${PREFIX} ${BINDIR}/testwt_ss${SUFFIX} >> test.output
120 echo "end testwt_ss" >> test.output
121 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testwt_ss.dmp
122
123 echo "testrd_ss - read test of a file with several side sets..."
124 echo "testrd_ss ... [Expect warning for NULL sidesets 30 and 31]"
125 echo "begin testrd_ss" >> test.output
126 ${PREFIX} ${BINDIR}/testrd_ss${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd_ss.dmp
127 echo "end testrd_ss" >> test.output
128
129 echo "testwt2 - single precision write 2 files (simultaneously open) test..."
130 echo "begin testwt2" >> test.output
131 ${PREFIX} ${BINDIR}/testwt2${SUFFIX} >> test.output
132 echo "end testwt2" >> test.output
133 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/test2-1.dmp
134 ${NCDUMP} -d5,5 test2.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/test2-2.dmp
135
136 echo "testrdwt - read from one and write to another (simultaneously open) file..."
137 echo "begin testrdwt" >> test.output
138 ${PREFIX} ${BINDIR}/testrdwt${SUFFIX} >> test.output
139 echo "end testrdwt" >> test.output
140 ${NCDUMP} -d5,5 test2.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/test2.dmp
141
142 echo "testwt_nc - write x y z components of coordinates separately..."
143 echo "begin testwt_nc" >> test.output
144 ${PREFIX} ${BINDIR}/testwt_nc${SUFFIX} >> test.output
145 echo "end testwt_nc" >> test.output
146 # Filter out the "maximum_name_length" attribute. Moves around in ncdump output for nc4 vs nc3
147 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue | grep -v maximum_name_length > ${SRCDIR}/test.dmp
148
149 echo "testrd_nc - read x y z components of coordinates separately..."
150 echo "begin testrd_nc" >> test.output
151 ${PREFIX} ${BINDIR}/testrd_nc${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd_nc.dmp
152 echo "end testrd" >> test.output
153
154 echo "testwt-zeron - write file with zero nodes and elements..."
155 echo "begin testwt-zeron" >> test.output
156 ${PREFIX} ${BINDIR}/testwt-zeron${SUFFIX} >> test.output
157 echo "end testwt-zeron" >> test.output
158 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testwt-zeron.dmp
159
160 echo "testrd - read test of file with zero nodes and elements..."
161 echo "begin testrd zero nodes" >> test.output
162 ${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd_zeron.dmp
163 echo "end testrd zero nodes" >> test.output
164
165 echo "testwt-zeroe - write file with zero elements..."
166 echo "begin testwt-zeroe" >> test.output
167 ${PREFIX} ${BINDIR}/testwt-zeroe${SUFFIX} >> test.output
168 echo "end testwt-zeroe" >> test.output
169 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testwt-zeroe.dmp
170
171 echo "testrd - read test of file with zero elements..."
172 echo "begin testrd zero elements" >> test.output
173 ${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd_zeroe.dmp
174 echo "end testrd zero elements" >> test.output
175
176 echo "testwt-one-attrib - read/write test of element attributes - read one at a time..."
177 echo "begin testwt-one-attrib - read attributes one at a time" >> test.output
178 ${PREFIX} ${BINDIR}/testwt-one-attrib${SUFFIX}
179 echo "end testwt-one-attrib - read attributes one at a time" >> test.output
180
181 echo "testwt-nsided - write file with nsided elements..."
182 echo "begin testwt-nsided" >> test.output
183 ${PREFIX} ${BINDIR}/testwt-nsided${SUFFIX} >> test.output
184 echo "end testwt-nsided" >> test.output
185 ${NCDUMP} -d5,5 test-nsided.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testwt-nsided.dmp
186
187 echo "testrd-nsided - read file with nsided elements..."
188 echo "begin testrd-nsided" >> test.output
189 ${PREFIX} ${BINDIR}/testrd-nsided${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd-nsided.dmp
190 echo "end testrd-nsided" >> test.output
191
192 echo "testwt-nfaced - write file with nfaced elements..."
193 echo "begin testwt-nfaced" >> test.output
194 ${PREFIX} ${BINDIR}/testwt-nfaced${SUFFIX} >> test.output
195 echo "end testwt-nfaced" >> test.output
196 ${NCDUMP} -d5,5 test-nfaced.exo | grep -v version | grep -v _FillValue > ${SRCDIR}/testwt-nfaced.dmp
197
198 echo "testrd-nfaced - read file with nfaced elements..."
199 echo "begin testrd-nfaced" >> test.output
200 ${PREFIX} ${BINDIR}/testrd-nfaced${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd-nfaced.dmp
201 echo "end testrd-nfaced" >> test.output
202
203 echo "testwt-long-name - write file with long (64-character) names..."
204 echo "begin testwt-long-name" >> test.output
205 # Filter out the "maximum_name_length" attribute. Moves around in ncdump output for nc4 vs nc3
206 ${PREFIX} ${BINDIR}/testwt-long-name${SUFFIX} >> test.output
207 echo "end testwt-long-name" >> test.output
208 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v "maximum_name_length" > ${SRCDIR}/testwt-long-name.dmp
209
210 echo "testrd - read long name file truncating to 32 characters on read..."
211 echo "begin testrd (truncate)" >> test.output
212 ${PREFIX} ${BINDIR}/testrd${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd-nm32.dmp
213 echo "end testrd (truncate)" >> test.output
214
215 echo "testrd-long-name - read long name file..."
216 echo "begin testrd-long-name" >> test.output
217 ${PREFIX} ${BINDIR}/testrd-long-name${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/testrd-long-name.dmp
218 echo "end testrd-long-name" >> test.output
219
220 echo "test_nemesis - read long name file..."
221 echo "begin test_nemesis" >> test.output
222 ${PREFIX} ${BINDIR}/test_nemesis${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/test_nemesis.dmp
223 echo "end test_nemesis" >> test.output
224
225 echo "test-empty - read an empty (only ex_create called) exodus file..."
226 echo "begin test-empty" >> test.output
227 ${PREFIX} ${BINDIR}/test-empty${SUFFIX} | grep -v version | grep -v _FillValue > ${SRCDIR}/test-empty.dmp
228 echo "end test-empty" >> test.output
229
230 if [ "$THREAD_SAFE" == "YES" ]; then
231
232 echo "test_ts_nvar - each thread writes data for a single nodal variable..."
233 echo "begin test_ts_nvar" >> test.output
234 ${PREFIX} ${BINDIR}/test_ts_nvar${SUFFIX} >> test.output
235 echo "end test_ts_nvar" >> test.output
236 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v "maximum_name_length" > ${SRCDIR}/test_ts_nvar.dmp
237
238 echo "test_ts_nvar_rd - each thread reads data for a single nodal variable..."
239 echo "begin test_ts_nvar_rd" >> test.output
240 ${PREFIX} ${BINDIR}/test_ts_nvar_rd${SUFFIX} > ${SRCDIR}/test_ts_nvar_rd.dmp
241 echo "end test_ts_nvar_rd" >> test.output
242
243
244 echo "test_ts_partial_nvar - each thread writes data for a single nodal variable..."
245 echo "begin test_ts_partial_nvar" >> test.output
246 ${PREFIX} ${BINDIR}/test_ts_partial_nvar${SUFFIX} >> test.output
247 echo "end test_ts_partial_nvar" >> test.output
248 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v "maximum_name_length" > ${SRCDIR}/test_ts_partial_nvar.dmp
249
250 echo "test_ts_partial_nvar_rd - each thread reads data for a single nodal variable..."
251 echo "begin test_ts_partial_nvar_rd" >> test.output
252 ${PREFIX} ${BINDIR}/test_ts_partial_nvar${SUFFIX} >> test.output
253 echo "end test_ts_partial_nvar_rd" >> test.output
254 ${PREFIX} ${BINDIR}/test_ts_partial_nvar_rd${SUFFIX} > ${SRCDIR}/test_ts_partial_nvar_rd.dmp
255 echo "test_ts_files - each thread creates its own file..."
256 echo "begin test_ts_files" >> test.output
257 ${PREFIX} ${BINDIR}/test_ts_files${SUFFIX} >> test.output
258 echo "end test_ts_files" >> test.output
259 mv test0.exo test.exo
260 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
261 mv test1.exo test.exo
262 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
263 mv test2.exo test.exo
264 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
265 mv test3.exo test.exo
266 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
267 mv test4.exo test.exo
268 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
269 mv test5.exo test.exo
270 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
271 mv test6.exo test.exo
272 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
273 mv test7.exo test.exo
274 ${NCDUMP} -d5,5 test.exo | grep -v version | grep -v _FillValue |grep -v maximum_name_length > ${SRCDIR}/test.dmp
275 echo "test_ts_errval - multiple threads calling ex_err and ex_get_err..."
276 echo "begin test_ts_errval" >> test.output
277 ${PREFIX} ${BINDIR}/test_ts_errval${SUFFIX} >> test.output
278 echo "end test_ts_errval" >> test.output
279 fi