Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flex Extract
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Flexpart
Flex Extract
Commits
6bc4b425
Commit
6bc4b425
authored
5 years ago
by
pesei
Browse files
Options
Downloads
Patches
Plain Diff
Add script to run regression tests
called run_regrtest.sh + small corr on run_ref.sh
parent
2d1c3388
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/Regression/FortranEtadot/run_ref.sh
+2
-1
2 additions, 1 deletion
Testing/Regression/FortranEtadot/run_ref.sh
Testing/Regression/FortranEtadot/run_regrtest.sh
+109
-0
109 additions, 0 deletions
Testing/Regression/FortranEtadot/run_regrtest.sh
with
111 additions
and
1 deletion
Testing/Regression/FortranEtadot/run_ref.sh
+
2
−
1
View file @
6bc4b425
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
# Copyright Petra Seibert, 2019
# Copyright Petra Seibert, 2019
# SPDX-License-Identifier: MIT-0
# SPDX-License-Identifier: MIT-0
export
OMP_NUM_THREADS
=
4
export
OMP_NUM_THREADS
=
4
# you may want to change this
export
OMP_PLACES
=
sockets
export
OMP_PLACES
=
sockets
testhome
=
`
pwd
`
testhome
=
`
pwd
`
path1
=
../../../Source/Fortran/
path1
=
../../../Source/Fortran/
...
@@ -20,6 +20,7 @@ rm -f log.run_ref failed
...
@@ -20,6 +20,7 @@ rm -f log.run_ref failed
rm
-f
log.run_ref
rm
-f
log.run_ref
if
[
"
$1
"
=
omithigh
]
;
then
# for fast testing, not for production
if
[
"
$1
"
=
omithigh
]
;
then
# for fast testing, not for production
# requires > 16 GB
inputs
=
`
ls
Inputs |
grep
-v
high
`
inputs
=
`
ls
Inputs |
grep
-v
high
`
else
else
inputs
=
`
ls
Inputs
`
inputs
=
`
ls
Inputs
`
...
...
This diff is collapsed.
Click to expand it.
Testing/Regression/FortranEtadot/run_regrtest.sh
0 → 100755
+
109
−
0
View file @
6bc4b425
#!/bin/bash
# Do the regression tests
# can be called without arguments, then will test all cases
# or with argument "omithigh" then high-resolution cases are omitted
# Copyright Petra Seibert, 2019
# SPDX-License-Identifier: MIT-0
export
OMP_NUM_THREADS
=
4
# you may want to change this
export
OMP_PLACES
=
sockets
testhome
=
`
pwd
`
path1
=
../../../Source/Fortran/
path
=
../
${
path1
}
exedebug
=
calc_etadot_debug.out
exefast
=
calc_etadot_fast.out
hash
=
$(
git log
--abbrev-commit
--pretty
=
oneline
-n
1
--pretty
=
format:
'%h'
)
exitonfail
=
true
numtest
=
0
numpassed
=
0
rm
-f
log.run_regr failed
# loop over all reference runs
if
[
"
$1
"
=
omithigh
]
;
then
# for fast testing, not for production
inputs
=
`
ls
Inputs |
grep
-v
high
`
else
inputs
=
`
ls
Inputs |grep etadothigh
`
fi
for
ref
in
$inputs
;
do
echo
'Working on test case ='
$ref
# loop over debug and fast runs
for
exe
in
'debug'
'fast'
;
do
numtest
=
$((
numtest
+
1
))
failed
=
false
rm
-f
Work/
*
# make shure that Work is empty
cd
Work
echo
' Run code version "'
${
exe
}
'"'
|
tee
-a
../log.run_regr
thisexe
=
calc_etadot_
${
exe
}
.out
ln
../Inputs/
${
ref
}
/fort.
*
.
(
time
${
path
}${
thisexe
}
)
>
& log
# check whether runs completeted properly
grep
-q
CONGRATULATIONS log
if
[
$?
=
"0"
]
;
then
echo
' CONGRATULATIONS found'
|
tee
-a
../log.run_regr
else
echo
' missing CONGRATULATIONS. Test failed.'
|
tee
-a
../log.run_regr
echo
$ref
$exe
'FAILED'
>>
${
testhome
}
/failed
if
[
"
${
exitonfail
}
"
=
true
]
;
then
exit
;
else
failed
=
true
;
fi
fi
for
outfile
in
'fort.15'
'VERTICAL.EC'
;
do
if
[
-e
$outfile
]
;
then
# compare reference and current version
# omega case also produces fort.25 - need to add this
outref
=
'../Outputs/Output_ref_'
${
ref
}
'_'
${
exe
}
'/'
$outfile
test
=
$(
cmp
$outfile
$outref
)
if
$test
;
then
echo
' '
$outfile
' test passed'
|
tee
-a
../log.run_regr
else
echo
'WARNING:'
$outfile
' test failed'
|
tee
-a
../log.run_regr
echo
$ref
$exe
'FAILED'
>>
${
testhome
}
/failed
if
[
"
${
exitonfail
}
"
=
true
]
;
then
exit
;
else
failed
=
true
;
fi
fi
else
echo
' missing '
${
outfile
}
' Test failed.'
|
tee
-a
../log.run_regr
echo
$ref
$exe
'FAILED'
>>
${
testhome
}
/failed
if
[
"
${
exitonfail
}
"
=
true
]
;
then
exit
;
else
failed
=
true
;
fi
fi
done
# end loop outfiles
if
[
"
${
failed
}
"
=
false
]
;
then
numpassed
=
$((
numpassed
+
1
))
;
fi
# save and show runtimes
log
=
'log'
times
=
$(
tail
-3
${
log
}
)
real
=
$(
echo
$times
|
grep
real |
awk
'{print $2}'
)
user
=
$(
echo
$times
|
grep
user |
awk
'{print $4}'
)
sys
=
$(
echo
$times
|
grep
sys |
awk
'{print $6}'
)
echo
$hash
,
"'"
reference
"'"
,
"'"
${
ref
}
'_'
${
exe
}
"'"
,
${
real
}
,
${
user
}
,
${
sys
}
>>
../runtimes.csv
tail
-1
../runtimes.csv
>>
log.run_regr
cd
..
rm
Work/
*
# this is for being more safe
done
# end of exe loop
echo
# go to next reference run
done
# end of ref loop
echo
echo
' Regression test: '
$numpassed
'out of'
$numtest
'tests passed'
.
\
|
tee
-a
../log.run_regr
echo
' More information may be found in log.run_regr'
echo
' Runtimes were added to runtimes.csv under '
$hash
|
tee
-a
../log.run_regr
# the following code is executed only if exitonfail is not set to 'true'.
if
[
-e
failed
]
;
then
echo
echo
Some tests failed, see file
"failed"
:
echo
cat
failed|sort
-u
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment