-
Notifications
You must be signed in to change notification settings - Fork 39
/
warp3d_script_linux_openmp
executable file
·110 lines (109 loc) · 3.19 KB
/
warp3d_script_linux_openmp
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
#!/bin/bash
#
#
# Run WARP3D (Linux) -- OpenMP only + MKL direct/iterative sparse solver
# Version built with Intel Fortran
# ======================================================================
#
# usage: warp3d_script_linux_Intel_openmp (number-of-threads) ( < input ) ( > output )
#
# ( ) -- optional
#
#
echo " "
if [ $# = "0" ]; then
echo ">> Usage:"; echo " "
echo " wwarp3d_script_linux_Intel_openmp (<parms>) ( < input ) ( > output )"; echo " "
echo " <parms>: <no. of threads> "
echo " ( ) implies optional"
echo " "
exit 1
fi
echo " "
echo ">> Running WARP3D on Linux ..."
echo " OpenMP + threaded MKL direct/iterative sparse solver"
echo " Built with Intel Fortran"
#
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_linux/warp3d.omp"
#
if [[ ! -f "$WARP3D_HOME/run_linux/warp3d.omp" ]]
then
echo " "; echo " "
echo ">>>> WARP3D executable does not exist:'$warp3d_exe'"
echo " No execution possible"
echo " "; echo " "
exit
fi
if [[ ! -x "$WARP3D_HOME/run_linux/warp3d.omp" ]]
then
echo " "; echo " "
echo ">>>> WARP3D executable must have execute permissions:'$warp3d_exe'"
echo " No execution possible"
echo " "; echo " "
exit
fi
#
# set LD_LIBRARY_PATH. Examine the ordering...
#
# Note: at runtime, WARP3D will use the MKL library
# files located in linux_packages/lib included in the
# WARP3D distribution.
# ** This applies even if you have the
# ** Intel compiler system installed on your machine.
# We distribute the most current versions of the
# the required MKL libraries. These are backwards
# compatible with older Intel processors.
#
# The WARP3D build (linking) process also used these
# files.
#
# MKL is available free from Intel.
#
export LD_LIBRARY_PATH=$WARP3D_HOME/linux_packages/lib:$LD_LIBRARY_PATH
#
#
# 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
#
# increase the allowable size of the runtime stack. needed
# for large number of threads
#
ulimit -s 100000
#
# run WARP3D. The io-redirection files are automatically
# passed thru the bash shell.
#
$warp3d_exe
#
/bin/rm -f core
exit