-
Notifications
You must be signed in to change notification settings - Fork 39
/
warp3d_script_windows
executable file
·69 lines (69 loc) · 1.87 KB
/
warp3d_script_windows
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
#!/bin/bash
#
#
# Run WARP3D for Windows -- OpenMP only + MKL direct/iterative sparse solver
# =========================================================================
#
# --->>> This script requires CygWin (free) software to be
# --->>> installed. www.cygwin.com
#
# usage: warp3d_script_windows (number-of-threads) ( < input ) ( > output )
#
# ( ) -- optional
#
#
echo " "
if [ $# = "0" ]; then
echo ">> Usage:"; echo " "
echo " warp3d_script_windows (<parms>) ( < input ) ( > output )"; echo " "
echo " <parms>: <no. of threads> "
echo " ( ) implies optional"
echo " "
exit 1
fi
echo " "
echo ">> Running WARP3D on Windows ..."
echo " OpenMP + threaded MKL direct/iterative sparse solver"
#
if [ -z "$WARP3D_HOME" ]; then
printf "[ERROR]\n"
printf "... An environment variable WARP3D_HOME is not set.\n"
printf "... use Bash shell command: export WARP3D_HOME=... install directory...\n"
printf "Quitting...\n"
exit 1
fi
#
# set executable file name for OpenMP + MKL sparse solver
# version of warp3d
#
warp3d_exe="$WARP3D_HOME/run_windows/warp3d.exe"
#
# set the number of threads for WARP3D execution and
# for use by the MKL sparse solver. Here we just
# assign the same number of threads for both.
#
# default to 1 thread if user does nothing.
#
export OMP_NUM_THREADS=1
if [ $# = "1" ]; then
export OMP_NUM_THREADS=$1
fi
export MKL_NUM_THREADS=$OMP_NUM_THREADS
#
echo ">> Number of threads for parallel execution: " $OMP_NUM_THREADS
echo " "
#
# make a core file in case WARP3D aborts. make it
# unwritable so the core dump does not actually get
# written.
#
touch core &> /dev/null
chmod ugo-rwx core
#
# run WARP3D. The io-redirection files are automatically
# passed thru the bash shell.
#
$warp3d_exe
#
/bin/rm -f core
exit