-
Notifications
You must be signed in to change notification settings - Fork 220
/
go_mesher
executable file
·59 lines (44 loc) · 1.59 KB
/
go_mesher
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
#!/bin/csh
# script to run the mesher
# read DATA/Par_file to get information about the run
# name of the file that contains the list of machines
set machine_file = "mymachines"
set my_local_path = `grep LOCAL_PATH DATA/Par_file | cut -d '=' -f 2 `
# compute total number of processors needed
set NPROC_XI = `grep NPROC_XI DATA/Par_file | cut -d '=' -f 2 `
set NPROC_ETA = `grep NPROC_ETA DATA/Par_file | cut -d '=' -f 2 `
# total number of processors is the product of the values read
@ numprocessors = $NPROC_XI * $NPROC_ETA
rm -r -f OUTPUT_FILES
mkdir OUTPUT_FILES
rm -f sources timestamp* PI* error_message* starttimeloop*
if ( ! -d $my_local_path ) mkdir $my_local_path
if ( -f $machine_file ) then
echo " "
echo using machine file \"$machine_file\"
echo " "
echo list of active machines:
echo " "
cat $machine_file
echo " "
# this only used on a cluster if specifying list of machines
# assumes the name of the machines is n001, n002 etc...
# if name is different then change the tr -d 'n' below
grep -v '#' $machine_file | tr -d ' ' | tr -d 'n' > OUTPUT_FILES/filtered_machines.txt
endif
echo NPROC_XI = $NPROC_XI
echo NPROC_ETA = $NPROC_ETA
echo " "
echo starting MPI mesher on $numprocessors processors
echo " "
echo starting run in current directory $PWD
echo " "
echo mesh files will be saved in directory $my_local_path
echo " "
#### use this on Beowulf
set MPIRUN="mpirun"
$MPIRUN -nolocal -machinefile $machine_file -np $numprocessors $PWD/xmeshfem3D
#### use this on SGI
# mpirun -np $numprocessors xmeshfem3D
#### use this on Compaq Dec Alpha
# dmpirun -np $numprocessors xmeshfem3D