-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgo.sh
executable file
·583 lines (563 loc) · 21.8 KB
/
go.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
#!/bin/bash
# @file go.sh
# @author Ladutenko Konstantin <kostyfisik at gmail (.) com>
# @copyright 2013 Ladutenko Konstantin
# @section LICENSE
# This file is part of JADE++.
#
# JADE++ is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# JADE++ is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with JADE++. If not, see <http://www.gnu.org/licenses/>.
#
# @brief Compile JADE++ and run tests.
usage_msg="\nUsage: JADE++ can be (re-)compiled and run with call \n
$./go.sh [mode]\n
Possible modes:\n
new \t - Make new build and run.
old \t - Default. Re-build and run.
test \t - Re-build and run JADE++ on a set of test functions.
single \t - Re-build and run JADE++ on a single test function.
Possible enviroment parameters:\n
\n
JADE_MPI_size \t- total number of MPI processes.\n
JADE_MPI_nodes \t- total number of MPI nodes for cluster enviroment.\n
\n
In the case of enviroment parameters are not (or set with value 'unset')\n
set some default vale (depending on executing host) will be used.\n"
#############################################################################
if [[ ! $JADE_MPI_size ]]; then JADE_MPI_size="unset"; fi
if [[ ! $JADE_MPI_nodes ]]; then JADE_MPI_nodes="unset"; fi
MPI_options=
#MPI_options="--bind-to-core"
#############################################################################
# Parse input parameters
#############################################################################
mode=$1; config_file=$2; wrong_params=$3
#HOST=`cat /etc/hostname`
HOST=`hostname`
if [[ $config_file ]]; then
echo ================ !ERROR! =================
echo Should be no more than single input parameter
echo ================ !ERROR! =================
echo -e $usage_msg
exit 1
fi
# # Mode names
mode_new1="new"
# ? clang mode
mode_new2="new2" # gcc
# mode_new3="new3" # gcc with -O3
mode_old1="old"; mode_old2="old2";
mode_test="test"; # mode_prof="prof"; mode_old2prof="old2prof"; mode_pgo="pgo"
mode_single="single";
# mode_custom="custom"; mode_debug="debug"; mode_build="build"
# Default values
yes="yes"; no="no"
#compiler_gcc="gcc";
compiler_clang="clang"
usedCompiler=$compiler_gcc # or clang
useGCC48=$no # use gcc 4.8 if it is available in build area of scripts folder
isNew=$yes;
isTest=$no ; isProfile=$no ; isPGO=$no
isBuildOnly=$no;
# if [[ $mode = $mode_build || $config_file = $mode_build ]]; then
# isBuildOnly=$yes
# fi
path_jade=$PWD; path_bin=$path_jade/bin; path_build=$path_jade/build
path_src=$path_jade/src; path_data=$path_jade/data
# Should be same as in cmake config in $path_src
if [[ ! $mode ]]; then mode=$mode_new2; fi
if [[ $mode = "help" || $mode = "--help" || $mode = "-h" ]]; then
echo -e $usage_msg
exit 0
fi
#jade_bin="run-size-sweep"
#jade_bin="run-optimize-cloak"
#jade_bin="run-optimize-feed-cloak"
#jade_bin="run-optimize-scatter-Au-SiO2"
#jade_bin="run-optimize-absorber-TiN"
#jade_bin="run-optimize-absorber-TiN-wideband"
#jade_bin="run-optimize-absorber-two-band"
#jade_bin="run-optimize-alu"
#jade_bin="run-optimize-absorber-TiN-bi"
#jade_bin="run-optimize-ideal-bulk"
#jade_bin="run-superscatter-drude"
#jade_bin="run-optimize-superscatter-drude"
#jade_bin="run-absorb-Ag-in-glass"
#jade_bin="run-coating-w-sweep"
#jade_bin="run-coating-w-sweep-2layers"
#jade_bin="run-optimize-meander-cloak"
#jade_bin="run-optimize-meander-cloak-2layer"
#jade_bin="run-optimize-meander-cloak-3layer"
#jade_bin="run-optimize-meander-cloak-4layer"
#jade_bin="run-optimize-meander-cloak-5layer"
#jade_bin="run-quasi-pec-spectra"
#jade_bin="run-jade-test-feed"
jade_bin="run-jade-test"
if [[ $mode = $mode_test ]]; then
echo Run JADE++ test!
jade_bin="run-jade-test"
fi
if [[ $mode = $mode_single ]]; then
echo Run JADE++ test for single function!
jade_bin="run-jade-single"
fi
# # Check mode
# if [[ $mode != $mode_new1 \
# # && $mode != $mode_new2 && $mode != $mode_new3 && \
# # $mode != $mode_old1 && $mode != $mode_old2 && \
# # $mode != $mode_test && \
# # $mode != $mode_prof && $mode != $mode_old2prof && \
# # $mode != $mode_pgo && \
# # $mode != $mode_custom && \
# # $mode != $mode_build && \
# # $mode != $mode_debug
# ]]; then
# # So mode may be miss spelled or contains config file path.
# if [[ $config_file ]]; then
# echo ================ !ERROR! =================
# echo Undefined mode
# echo ================ !ERROR! =================
# echo -e $usage_msg
# exit 1
# fi
# echo Using default mode: Full build with clang compiler.
# config_file=$mode
# mode=$mode_new1
# fi
# if [[ ( $mode = $mode_test || $mode = $mode_build ) && $config_file ]]; then
# echo ================ !ERROR! =================
# echo Test and build modes do not support external config file
# echo ================ !ERROR! =================
# exit 1
# fi
# # Check config file(s)
# path_default_config=$path_jade/data/default-jade.config
# # Test containing "X1D-zero" in its name is a special optin in TuneJADEOptionsMPI
# tests="self-test-X1D-zero self-test-TMz2D-speedup self-test-3D-simple"
# if [[ $mode = $mode_test ]]; then
# echo Check for tests config files...
# for test in $tests; do
# test_name=${test//-/_}
# path_test_config="path_${test_name}_config"
# eval path_${test_name}_config=$path_jade/data/$test.config
# echo ${!path_test_config}
# if [[ ! -r ${!path_test_config} ]];
# then
# echo ================ !ERROR! =================
# echo Test mode was not able to access some of config files for tests
# echo ${!path_test_config}
# echo ================ !ERROR! =================
# exit 1
# fi
# done
# fi
# # Should be tested after checking $test_mode
# if [[ ! $config_file && $mode != $mode_build ]]; then
# echo Setting default config file $path_default_config
# config_file=$path_default_config
# fi
# if [[ ! -a $config_file && $isBuildOnly != $yes ]]; then
# echo ================ !ERROR! =================
# echo Was not able to found config file using path: $config_file
# echo ================ !ERROR! =================
# exit 1
# fi
# # Convert relative path for custom config file to absolute.
# firstChar=${config_file:0:1}
# if [[ $firstChar != "/" && $isBuildOnly != $yes ]]; then
# config_file=$path_jade/$config_file
# echo Change config file path to absolute path: $config_file
# fi
echo ============ Current script settings =============
echo mode: $mode
# if [[ $mode != $mode_test && $isBuildOnly != $yes ]]; then
# echo config file: $config_file
# fi
echo base dir path: $path_jade
# Check directory structure
if [[ ! -d $path_src ]]; then
echo ================ !ERROR! =================
echo No source folder $path_src
echo ================ !ERROR! =================
exit 1
fi
force_new_build=$no
if [[ -a $path_build ]]; then
echo Found build folder.
else
echo Creating build folder...
mkdir build
force_new_build=$yes
fi
if [[ -a $path_bin ]]; then
echo Found bin folder.
else
echo Creating build folder...
mkdir bin
fi
#############################################################################
# Compile settings
#############################################################################
echo ============ Compile settings =============
if [[ ( $mode = $mode_old1 || $mode = $mode_old2 || $mode = $mode_test || $mode=$mode_single ) && $force_new_build = $no ]]; then
isNew=$no
echo Recompile mode is on.
else
isNew=$yes
echo Cleaning build path.
rm -r $path_build/* >/dev/null 2>&1
fi
echo Cleaning bin
rm -r $path_bin/* >/dev/null 2>&1
# Profiling mode should use gcc compiler.
if [[ $mode = $mode_prof || $mode = $mode_old2prof ]]; then
echo Using gprof.
isProfile=$yes
flag_cmake_profile="-DCMAKE_CXX_FLAGS=-pg -DCMAKE_EXE_LINKER_FLAGS=-pg"
fi
# PGO mode should use gcc compiler.
if [[ $mode = $mode_pgo ]]; then
echo Using pgo.
isPGO=$yes
fi
if [[ $HOST == "rh-lum.metalab.ifmo.ru" ]]; then
echo Setting MPI path on rh-lum.metalab.ifmo.ru !
#scl enable devtoolset-1.1 bash
# ompi_path_bin=/usr/lib64/openmpi/bin/
# ompi_path_lib=/usr/lib64/openmpi/lib/
# if [ -d "$ompi_path_bin" ] && [[ ":$PATH:" != *":$ompi_path_bin:"* ]]; then
# PATH="${PATH:+"$PATH:"}$ompi_path_bin"
# fi
# export LD_LIBRARY_PATH=$ompi_path_lib
fi
# Set compiler
if [[ $mode = $mode_new1 || $mode = $mode_old1 || $mode = $mode_test || $mode = $mode_single ]]; then
echo $mode
echo Using \'clang\' compiler.
usedCompiler=$compiler_clang
#path_clang33=/home/mmedia/soft/clang/clang+llvm-3.3-amd64-debian6/bin/
if [[ $HOST == "head.phoif.ifmo.ru" ]]; then
path_clang33=/home/nfs-shared/tig/clang
elif [[ $HOST == "dmmrkovich-birzha" ]]; then
path_clang33=
elif [[ $HOST == "deb00" || $HOST == "tig-laptop2" ]]; then
path_clang33=/home/mmedia/soft/clang/clang33
elif [[ $HOST == "rh-lum.metalab.ifmo.ru" ]]; then
echo rh-lum
path_clang33=/home/tig/clang/clang33
# ompi_path_bin=/usr/lib64/openmpi/bin/
# ompi_path_lib=/usr/lib64/openmpi/lib/
# if [ -d "$ompi_path_bin" ] && [[ ":$PATH:" != *":$ompi_path_bin:"* ]]; then
# PATH="${PATH:+"$PATH:"}$ompi_path_bin"
# fi
# export LD_LIBRARY_PATH=$ompi_path_lib
else
path_clang33=/usr
fi
echo path_clang: $path_clang33
export OMPI_CC=$path_clang33/bin/clang
export OMPI_CXX="$path_clang33/bin/clang++ -I$path_clang33/include -stdlib=libc++"
echo clang version:
$OMPI_CC --version
if [[ $HOST == "tig-laptop3" ]]; then
path_clang33=/usr
export OMPI_CC=$path_clang33/bin/clang
export OMPI_CXX="$path_clang33/bin/clang++ -I$path_clang33/inclde/c++/v1 -stdlib=libc++"
fi
else
path_gcc48=/home/mmedia/soft/gcc/gcc48
if [[ -a $path_gcc48 && $useGCC48 = $yes ]]; then
echo Using \'gcc-4.8\' compiler.
export OMPI_CC=$path_gcc48/bin/gcc
#export OMPI_CXX="$path_gcc48/bin/g++"
export OMPI_CXX="$path_gcc48/bin/g++ -I$path_gcc48/include/c++/4.8.1 -Wl,-rpath,$path_gcc48/lib64"
else
echo Using gcc compiler.
path_gcc48=
export OMPI_CC=gcc
export OMPI_CXX=g++
fi
echo ompi_cc $OMPI_CC
echo ompi_cxx $OMPI_CXX
fi
# Select OMPI_CXXFLAGS
#debug
#flags_O2="-std=c++11"
flags_O2="-O2 -Wall -std=c++11"
#flags_O2="-O2 -Wall -std=c++11 -stdlib=libc++"
#flags_O2="-O2 -ftemplate-depth-30 -Wall -std=c++11"
flags_debug="-ftemplate-depth-30 -Wall -std=c++11 -stdlib=libc++"
#flags_debug_gcc="-ftemplate-depth-30 -std=c++11 -da -Q"
flags_debug_gcc="-ftemplate-depth-30 -std=c++11 -g -O0"
flags_O3="-O3 -ffast-math -ftemplate-depth-30 -march=native -mtune=native -mfpmath=both -malign-double -mstackrealign -ftree-vectorize -msse2 -ftree-vectorizer-verbose=5 -Wall -std=c++11 -stdlib=libc++"
flags_with_google=" -Ofast -std=c++11 -lm -lrt /usr/lib/libtcmalloc_minimal.so.4 -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -march=native -mtune=native -msse4.2"
# TODO option -flto -- Do we need it?
#export OMPI_CXXFLAGS=$flags_debug_gcc
export OMPI_CXXFLAGS=$flags_O2
#export OMPI_CXXFLAGS=$flags_with_google
if [[ $mode = $mode_new1 ]]; then
export OMPI_CXXFLAGS=$flags_O2
fi
if [[ $mode = $mode_debug ]]; then
echo Using debug mode.
export OMPI_CXXFLAGS=$flags_debug
fi
if [[ $mode = $mode_new3 ]]; then
export OMPI_CXXFLAGS=$flags_with_google
fi
echo Using flags: $OMPI_CXXFLAGS
echo ============ End of compile settings =============
#############################################################################
# Build
#############################################################################
function BuildJADE {
echo "Building JADE++..."
local path_tmp=`pwd`
cd $path_build
# if [[ $flag_cmake_profile && $flag_cmake_pgo ]]; then
# echo ================ !ERROR! =================
# echo Config with cmake flags $flag_cmake_profile and $flag_cmake_pgo
# echo ================ !ERROR! =================
# exit 1
# fi
flag_cmake=
# if [[ $flag_cmake_profile ]]; then
# flag_cmake=$flag_cmake_profile
# fi
# if [[ $flag_cmake_pgo ]]; then
# flag_cmake=$flag_cmake_pgo
# fi
if [[ $isNew = $yes ]]; then
echo $PWD
echo "Doing new build.."
CC=mpicc CXX=mpic++ VERBOSE=1 cmake $path_jade \
-DCMAKE_INSTALL_PREFIX="$path_bin" \
$flag_cmake
fi
make -j4
make install
cd $path_tmp
} # end of function BuildJADE
BuildJADE
#############################################################################
# Run
#############################################################################
echo "Executing $jade_bin on host -> $HOST <-"
if [[ $jade_bin = "run-optimize-absorber-TiN" || $jade_bin = "run-optimize-absorber-TiN-bi" || $jade_bin = "run-optimize-absorber-TiN-wideband" || $jade_bin = "run-optimize-absorber-two-band" || $jade_bin = "run-optimize-scatter-Au-SiO2" || $jade_bin = "run-absorb-Ag-in-glass" ]]; then
echo Copy dispersion files...
cp $path_data/Si.txt $path_bin
cp $path_data/GaAs.txt $path_bin
cp $path_data/TiN.txt $path_bin
cp $path_data/Ag.txt $path_bin
cp $path_data/Au.txt $path_bin
cp $path_data/SiO2.txt $path_bin
ls $path_bin
fi
if [[ $isBuildOnly = $yes ]]; then
cd $path_bin
mv run-jade-test jade-test.bin
exit 0;
fi
if [[ $mode = $mode_test ]]; then isTest=$yes; fi
if [[ $isProfile = $yes ]]; then
# Grpof output for each process in separate file
export GMON_OUT_PREFIX='gmon.out'
fi
# Task and host dependant MPI parameters tuning.
function TuneJADEOptionsMPI {
# if [[ $JADE_MPI_size = "unset" && \
# "$config_file" = *"X1D-zero"* ]]; then
# JADE_MPI_size=2
# JADE_MPI_nodes=1
# fi
if [[ $HOST == "head.phoif.ifmo.ru" ]]; then
if [[ $JADE_MPI_size = "unset" ]]; then JADE_MPI_size=16; fi
if [[ $JADE_MPI_nodes = "unset" ]]; then JADE_MPI_nodes=8; fi
elif [[ $HOST == "deb00" || $HOST == "dmmrkovich-birzha" ]]; then
if [[ $JADE_MPI_size = "unset" ]]; then JADE_MPI_size=4; fi
elif [[ $HOST == "rh-lum.metalab.ifmo.ru" ]]; then
if [[ $JADE_MPI_size = "unset" ]]; then JADE_MPI_size=10; fi
else
if [[ $JADE_MPI_size = "unset" ]]; then JADE_MPI_size=2; fi
fi
} # end of TuneJADEOptionsMPI
# Host dependant MPI run of JADE
function RunJADE {
local path_tmp=`pwd`
cd $path_bin
# cp $config_file $path_bin/jade.config
if [[ $HOST == "head.phoif.ifmo.ru" ]]; then
echo "Waiting for shared file system to distibute files..."
sleep 2
echo "(1) Nodes $JADE_MPI_nodes procs $JADE_MPI_size"
salloc -N $JADE_MPI_nodes -n $JADE_MPI_size -p max1day \
mpirun $MPI_options ./$jade_bin #jade.config
else
echo "(1) Nodes 1 procs $JADE_MPI_size"
#time mpirun -np $JADE_MPI_size $MPI_options ./$jade_bin #jade.config
mpirun -np $JADE_MPI_size $MPI_options ./$jade_bin #jade.config
fi
cd $path_tmp
} # end of RunJADE
if [[ $isTest = $no ]]; then
TuneJADEOptionsMPI
time RunJADE
if [[ $isPGO = $yes ]]; then
# export OMPI_CXXFLAGS="$flags_O2 -fprofile-generate"
# export OMPI_LDFLAGS=$OMPI_CXXFLAGS
flag_cmake_pgo="-DCMAKE_CXX_FLAGS=-fprofile-generate -DCMAKE_EXE_LINKER_FLAGS=-fprofile-generate"
rm -r $path_bin/*
BuildJADE
echo ============================================
echo Run PGO profiling
sleep 2
RunJADE
cp $path_build/src/mpi-decomposition/CMakeFiles/mpi-decomposition.dir/__/simulation-core/basic-fdtd.cc.gcda $path_build/src/simulation-core/CMakeFiles/simulation-core.dir/basic-fdtd.cc.gcda
cp $path_build/src/mpi-decomposition/CMakeFiles/mpi-decomposition.dir/__/profiling/timer.cc.gcda $path_build/src/profiling/CMakeFiles/profiling.dir/timer.cc.gcda
# export OMPI_CXXFLAGS="$flags_O2 -fprofile-use"
# export OMPI_LDFLAGS=$OMPI_CXXFLAGS
flag_cmake_pgo="-DCMAKE_CXX_FLAGS=-fprofile-use -DCMAKE_EXE_LINKER_FLAGS=-fprofile-use"
rm -r $path_bin/*
BuildJADE
echo ============================================
echo Run after PGO compiled
sleep 2
RunJADE
fi
fi # end of if [[ $isTest = $no ]]
# if [[ $isProfile = $yes ]]; then
# gprof $jade_bin gmon.out* | grep '^index'
# for file in gmon.out*;
# do
# echo $file
# gprof $jade_bin $file | grep 'DoBorderStep' | grep '^\['
# gprof $jade_bin $file | grep 'DoStep' | grep '^\['
# done
# echo Average
# gprof $jade_bin gmon.out* | grep 'DoBorderStep' | grep '^\['
# gprof $jade_bin gmon.out* | grep 'DoStep' | grep '^\['
# gprof --no-flat-profile $jade_bin gmon.out* > average-profile
# gprof $jade_bin gmon.out* > flat-average-profile
# rm gmon.out*
# fi # end of if isProfile
if [[ $isTest = $yes ]]; then
TuneJADEOptionsMPI
RunJADE
fi
# if [[ $isTest = $yes ]]; then
# echo "Prepare files for tests ..."
# cd $path_bin
# for test in $tests; do
# # For each test make dir, copy config and binary to it, run.
# cd $path_bin
# mkdir $test
# test_name=${test//-/_}
# #path_test_config="path_${test_name}_config"
# path_test="$path_bin/$test"
# #path_test_config="path_${test}_config"
# #cp ${!path_test_config} ${path_test}/jade.config
# cp $jade_bin $path_test
# cd $path_test
# backup_JADE_MPI_size=$JADE_MPI_size
# backup_JADE_MPI_nodes=$JADE_MPI_nodes
# if [[ $test = "self-test-X1D-zero" ]]; then
# JADE_MPI_size=2
# JADE_MPI_nodes=1
# fi
# echo "============ Running test $test ============="
# if [[ $HOST == "head.phoif.ifmo.ru" ]]; then
# echo "Waiting for shared file system to distibute files..."
# sleep 2
# if [[ $JADE_MPI_size = "unset" ]]; then JADE_MPI_size=16; fi
# if [[ $JADE_MPI_nodes = "unset" ]]; then JADE_MPI_nodes=8; fi
# echo "(1) Nodes $JADE_MPI_nodes procs $JADE_MPI_size"
# salloc -N $JADE_MPI_nodes -n $JADE_MPI_size -p max1hour \
# mpirun $MPI_options ./$jade_bin #jade.config
# if [[ $test = "self-test-TMz2D-speedup" ]]; then
# echo "(*******) Nodes 16 procs 128 (1024 x 1024, step 1000, ~15.4s)"
# salloc -N 16 -n 128 -p max1hour \
# mpirun $MPI_options ./$jade_bin #jade.config
# echo "(*******) Nodes 16 procs 16 (1024 x 1024, step 1000, ~7s)"
# salloc -N 16 -n 16 -p max1hour \
# mpirun $MPI_options ./$jade_bin #jade.config
# echo "(*******) Nodes 1 procs 8 (1024 x 1024, step 1000, ~30.2s)"
# salloc -N 1 -n 8 -p max1hour \
# mpirun $MPI_options ./$jade_bin #jade.config
# echo "(*******) Nodes 1 procs 1 (1024 x 1024, step 1000, ~47.6s)"
# salloc -N 1 -n 1 -p max1hour \
# mpirun $MPI_options ./$jade_bin #jade.config
# fi
# elif [[ $HOST == "deb00" || $HOST == "dmmrkovich-birzha" ]]; then
# echo "(*******) Procs 1"
# mpirun -np 1 $MPI_options ./$jade_bin #jade.config
# echo "(*******) Procs 2"
# mpirun -np 2 $MPI_options ./$jade_bin #jade.config
# echo "(*******) Procs 4"
# mpirun -np 4 $MPI_options ./$jade_bin #jade.config
# else
# if [[ $JADE_MPI_size = "unset" ]]; then JADE_MPI_size=2; fi
# echo "(1) Nodes 1 procs $JADE_MPI_size"
# mpirun -np $JADE_MPI_size $MPI_options ./$jade_bin #jade.config
# fi
# JADE_MPI_size=$backup_JADE_MPI_size
# JADE_MPI_nodes=$backup_JADE_MPI_nodes
# rm *.jade >/dev/null 2>&1
# done # end of for test in $tests; do
# fi # end of if [[ $isTest = $yes ]]
# if [[ $config_file = $path_self_test_X1D_zero_config ]]; then
# echo "Prepare *.png from gnuplot ..."
# cp $path_jade/data/gnuplot/* ./
# ./gnuplot-all.sh >/dev/null 2>&1
# # mkdir tmpdir
# # cp *0241-* $path_bin/tmpdir
# # rm $path_bin/*
# # cp $path_bin/tmpdir/* ./
# # rm -r $path_bin/tmpdir
# fi
#rm *.jade >/dev/null 2>&1
if [[ $mode = $mode_test ]]; then
echo Finished JADE++ test!
exit 0
fi
if [[ $mode = $mode_single ]]; then
echo Finished JADE++ test for single function!
exit 0
fi
cd bin
rm *-nan-*
chmod +x run-gnuplot*.sh
for file in `ls run-gnuplot* 2>/dev/null`; do
chmod +x $file
./$file
done
cp $path_jade/scripts/prepare-overview.py $path_bin
cp $path_jade/scripts/prepare-Qabs-overview.py $path_bin
cp $path_jade/scripts/plot-SiAgSi-overview.py $path_bin
cp $path_jade/scripts/filter.py $path_bin
cp -r $path_jade/src $path_bin
#echo $path_bin
if [[ $HOST == "rh-lum.metalab.ifmo.ru" ]]; then
cd $path_jade
rm bin.tar.bz2
tar -cjf bin.tar.bz2 bin
fi
cd $path_bin
rm *-nan-*
#./filter.py # No longer needed?
if [[ $jade_bin = "run-optimize-absorber-TiN" || $jade_bin = "run-optimize-scatter-Au-SiO2" || $jade_bin = "run-optimize-absorber-TiN-bi" || $jade_bin = "run-optimize-absorber-TiN-wideband" || $jade_bin = "run-optimize-absorber-two-band" || $jade_bin="run-optimize-feed-cloak" ]]; then
./prepare-Qabs-overview.py
#mv sweep-ch.dat sweep-ch.txt
./plot-SiAgSi-overview.py
else
./prepare-overview.py
fi