Skip to content

Commit bfa62e2

Browse files
committed
Adding the backend to the repository
1 parent 468cb0b commit bfa62e2

24 files changed

+4531
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ CMakeLists.txt.user
3838

3939
images/.DS_Store
4040
.DS_Store
41+
42+
Agave/utils/gmsh

Agave/LICENSE

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Date: 9-24-2018
2+
3+
This LICENSE document pertains to the CWE back-end materials, comprising the files contained in the same folder or archive as this document and the files in all the subfolders contained therein.
4+
5+
The 'gmsh' program, contained in the 'utils' folder is a copy of the freely available 'gmsh' program. It's license is accessible within the 'gmsh' program itself, and can be found at: http://gmsh.info/doc/LICENSE.txt
6+
7+
All other programs and files in these materials are licensed under a BSD-style license as follows:
8+
9+
Copyright (c) 2018 The University of Notre Dame
10+
Copyright (c) 2018 The Regents of the University of California
11+
12+
Redistribution and use in source and binary forms, with or without modification,
13+
are permitted provided that the following conditions are met:
14+
15+
1. Redistributions of source code must retain the above copyright notice, this
16+
list of conditions and the following disclaimer.
17+
18+
2. Redistributions in binary form must reproduce the above copyright notice, this
19+
list of conditions and the following disclaimer in the documentation and/or other
20+
materials provided with the distribution.
21+
22+
3. Neither the name of the copyright holder nor the names of its contributors may
23+
be used to endorse or promote products derived from this software without specific
24+
prior written permission.
25+
26+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
27+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
28+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
29+
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
31+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
32+
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
34+
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35+
SUCH DAMAGE.

Agave/apps/cwe-parallel/test/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo "Test not yet implemented. This script is a test placeholder."

Agave/apps/cwe-parallel/wrapper.sh

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Copyright (c) 2018 The University of Notre Dame
2+
# Copyright (c) 2018 The Regents of the University of California
3+
#
4+
# Redistribution and use in source and binary forms, with or without modification,
5+
# are permitted provided that the following conditions are met:
6+
#
7+
# 1. Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# 2. Redistributions in binary form must reproduce the above copyright notice, this
11+
# list of conditions and the following disclaimer in the documentation and/or other
12+
# materials provided with the distribution.
13+
14+
# 3. Neither the name of the copyright holder nor the names of its contributors may
15+
# be used to endorse or promote products derived from this software without specific
16+
# prior written permission.
17+
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
19+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
21+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24+
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27+
# SUCH DAMAGE.
28+
29+
# Contributors:
30+
# Written by Peter Sempolinski, for the Natural Hazard Modeling Laboratory, director: Ahsan Kareem, at Notre Dame
31+
32+
set -x
33+
34+
${AGAVE_JOB_CALLBACK_RUNNING}
35+
36+
export STARTINGDIR=`pwd`
37+
38+
export PYTHONDIR=$STARTINGDIR/python/CFDexec
39+
export PYTHONPATH=$PYTHONPATH:$STARTINGDIR/python
40+
41+
unzip templates.zip
42+
export TEMPLATER_FOLDER=$STARTINGDIR/templates
43+
44+
PARENTDIR="${directory}"
45+
TASKSTAGE="${stage}"
46+
export EXTRAFILE="${file_input}"
47+
48+
function dump_logs {
49+
echo "Starting cwe cleanup"
50+
51+
cd $STARTINGDIR
52+
mkdir logs
53+
54+
mv .agave.log logs
55+
mv *.err logs/cwe-parallel.err
56+
mv *.out logs/cwe-parallel.out
57+
mv *.log logs
58+
59+
if [ -f $EXTRAFILE ]
60+
then
61+
rm -rf $EXTRAFILE
62+
fi
63+
64+
rm -rf $TEMPLATER_FOLDER
65+
echo "$1" > .exit
66+
exit $1
67+
}
68+
69+
#Debug: output all inputs
70+
echo "dest is $PARENTDIR"
71+
echo "stage is $TASKSTAGE"
72+
73+
cp -f ${directory}/.caseParams .varStore
74+
75+
export DATA_FOLDER=`python $PYTHONDIR/Templater.py getdatafolder`
76+
STOP=$?
77+
if [ $STOP -ne 0 ]
78+
then
79+
echo "Unable to retrive data folder path"
80+
dump_logs $STOP
81+
fi
82+
83+
SCRIPT_FILE=`python $PYTHONDIR/Templater.py getscript $TASKSTAGE`
84+
85+
STOP=$?
86+
if [ $STOP -ne 0 ]
87+
then
88+
echo "Unable to retrive script name."
89+
dump_logs $STOP
90+
fi
91+
92+
LAST_STAGE=`python $PYTHONDIR/Templater.py getlaststage $TASKSTAGE`
93+
94+
STOP=$?
95+
if [ $STOP -ne 0 ]
96+
then
97+
echo "Unable to retrive last stage name."
98+
dump_logs $STOP
99+
fi
100+
101+
echo $LAST_STAGE
102+
103+
if [ $LAST_STAGE != "None" ]
104+
then
105+
mv ${directory}/$LAST_STAGE/* .
106+
mv -f ${directory}/.caseParams .varStore
107+
rm -rf logs
108+
rm -f .exit
109+
fi
110+
111+
rm -rf ${directory}
112+
if [ -d "stats" ]
113+
then
114+
python $PYTHONDIR/Templater.py paramset -s stats
115+
else
116+
python $PYTHONDIR/Templater.py paramset
117+
fi
118+
119+
chmod 700 $SCRIPT_FILE
120+
121+
$SCRIPT_FILE
122+
123+
STOP=$?
124+
if [ $STOP -ne 0 ]
125+
then
126+
echo "Error in job process"
127+
dump_logs $STOP
128+
fi
129+
130+
if [ -d "stats" ]
131+
then
132+
python $PYTHONDIR/Templater.py paramset -s stats
133+
fi
134+
135+
STOP=$?
136+
if [ $STOP -ne 0 ]
137+
then
138+
echo "Error in job process"
139+
dump_logs $STOP
140+
fi
141+
142+
echo "CWE task process complete."
143+
dump_logs 0
144+

Agave/apps/cwe-serial/test/test.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
echo "Test not yet implemented. This script is a test placeholder."

Agave/apps/cwe-serial/wrapper.sh

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Copyright (c) 2018 The University of Notre Dame
2+
# Copyright (c) 2018 The Regents of the University of California
3+
#
4+
# Redistribution and use in source and binary forms, with or without modification,
5+
# are permitted provided that the following conditions are met:
6+
#
7+
# 1. Redistributions of source code must retain the above copyright notice, this
8+
# list of conditions and the following disclaimer.
9+
#
10+
# 2. Redistributions in binary form must reproduce the above copyright notice, this
11+
# list of conditions and the following disclaimer in the documentation and/or other
12+
# materials provided with the distribution.
13+
14+
# 3. Neither the name of the copyright holder nor the names of its contributors may
15+
# be used to endorse or promote products derived from this software without specific
16+
# prior written permission.
17+
18+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
19+
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
21+
# SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
23+
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
24+
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
26+
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27+
# SUCH DAMAGE.
28+
29+
# Contributors:
30+
# Written by Peter Sempolinski, for the Natural Hazard Modeling Laboratory, director: Ahsan Kareem, at Notre Dame
31+
32+
set -x
33+
34+
${AGAVE_JOB_CALLBACK_RUNNING}
35+
36+
export STARTINGDIR=`pwd`
37+
38+
export PYTHONDIR=$STARTINGDIR/python/CFDexec
39+
export PYTHONPATH=$PYTHONPATH:$STARTINGDIR/python
40+
41+
unzip templates.zip
42+
export TEMPLATER_FOLDER=$STARTINGDIR/templates
43+
44+
PARENTDIR="${directory}"
45+
TASKSTAGE="${stage}"
46+
export EXTRAFILE="${file_input}"
47+
48+
function dump_logs {
49+
echo "Starting cwe cleanup"
50+
51+
cd $STARTINGDIR
52+
mkdir logs
53+
54+
mv .agave.log logs
55+
mv *.err logs/cwe-serial.err
56+
mv *.out logs/cwe-serial.out
57+
mv *.log logs
58+
59+
if [ -f $EXTRAFILE ]
60+
then
61+
rm -rf $EXTRAFILE
62+
fi
63+
64+
rm -rf $TEMPLATER_FOLDER
65+
echo "$1" > .exit
66+
exit $1
67+
}
68+
69+
#Debug: output all inputs
70+
echo "dest is $PARENTDIR"
71+
echo "stage is $TASKSTAGE"
72+
73+
cp -f ${directory}/.caseParams .varStore
74+
75+
export DATA_FOLDER=`python $PYTHONDIR/Templater.py getdatafolder`
76+
STOP=$?
77+
if [ $STOP -ne 0 ]
78+
then
79+
echo "Unable to retrive data folder path"
80+
dump_logs $STOP
81+
fi
82+
83+
SCRIPT_FILE=`python $PYTHONDIR/Templater.py getscript $TASKSTAGE`
84+
85+
STOP=$?
86+
if [ $STOP -ne 0 ]
87+
then
88+
echo "Unable to retrive script name."
89+
dump_logs $STOP
90+
fi
91+
92+
LAST_STAGE=`python $PYTHONDIR/Templater.py getlaststage $TASKSTAGE`
93+
94+
STOP=$?
95+
if [ $STOP -ne 0 ]
96+
then
97+
echo "Unable to retrive last stage name."
98+
dump_logs $STOP
99+
fi
100+
101+
echo $LAST_STAGE
102+
103+
if [ $LAST_STAGE != "None" ]
104+
then
105+
mv ${directory}/$LAST_STAGE/* .
106+
mv -f ${directory}/.caseParams .varStore
107+
rm -rf logs
108+
rm -f .exit
109+
fi
110+
111+
rm -rf ${directory}
112+
if [ -d "stats" ]
113+
then
114+
python $PYTHONDIR/Templater.py paramset -s stats
115+
else
116+
python $PYTHONDIR/Templater.py paramset
117+
fi
118+
119+
chmod 700 $SCRIPT_FILE
120+
121+
$SCRIPT_FILE
122+
123+
STOP=$?
124+
if [ $STOP -ne 0 ]
125+
then
126+
echo "Error in cwe task process"
127+
dump_logs $STOP
128+
fi
129+
130+
if [ -d "stats" ]
131+
then
132+
python $PYTHONDIR/Templater.py paramset -s stats
133+
fi
134+
135+
STOP=$?
136+
if [ $STOP -ne 0 ]
137+
then
138+
echo "Error in cwe task process"
139+
dump_logs $STOP
140+
fi
141+
142+
echo "CWE task process complete."
143+
dump_logs 0
144+

0 commit comments

Comments
 (0)