forked from srodrb/BSC-FWI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_example.sh
52 lines (45 loc) · 1.74 KB
/
run_example.sh
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
#!/bin/bash
#.........................................
# define configuration
OPTION_DEBUG_VALUE=OFF
OPTION_IO_VALUE=ON
OPTION_NVME_VALUE=ON
OPTION_STATS_VALUE=OFF
OPTION_ARCH_VALUE=generic # values are: generic,KNL
# env. variables required by the FWI code
export FWIDIR=$PWD
# script internal variables
color_green=`tput setaf 2`
color_cyan=`tput setaf 6`
color_reset=`tput sgr0`
# compile the schedule and model generator utilities
echo "${color_green}------------- Compiling scheduler and model generator binaries${color_reset}"
cd utils
source environment_$2.sh
mkdir -p build
cd build
rm -rf *
cmake -DCMAKE_C_COMPILER=gcc -Ddebug=$OPTION_DEBUG_VALUE -Dperform-io=$OPTION_IO_VALUE -Duse-nvme=$OPTION_NVME_VALUE ..
make install
# create the schedule and model by running the binaries
cd ..
echo "${color_green}------------- Running scheduler and model generator utilities${color_reset}"
echo "${color_cyan}"
rm fwi.log
./generateSchedule.bin fwi_params.txt fwi_frequencies.txt
echo "${color_reset}"
./generateModel.bin fwi_schedule.txt
# compile an run one FWI flavour
echo "${color_green}------------- Compiling $1 FWI version code${color_reset}"
cd ../$1
source environment_$2.sh
mkdir -p build
cd build
rm -rf *
echo "cmake -Darchitecture=$OPTION_ARCH_VALUE -Ddebug=$OPTION_DEBUG_VALUE -Dperform-io=$OPTION_IO_VALUE -Duse-nvme=$OPTION_NVME_VALUE -Dcollect-stats=$OPTION_STATS_VALUE .."
cmake -Darchitecture=$OPTION_ARCH_VALUE -Ddebug=$OPTION_DEBUG_VALUE -Dperform-io=$OPTION_IO_VALUE -Duse-nvme=$OPTION_NVME_VALUE -Dcollect-stats=$OPTION_STATS_VALUE ..
make install
# script ends here
echo ""
echo "${color_cyan}In order to launch the job youll need to modify the proper jobscript under $1 according to the information presented in this log${color_reset}"
echo ""