Skip to content

Commit

Permalink
updates grep statements
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel peter committed Dec 23, 2014
1 parent 9655bf6 commit 48bb5b8
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ echo
echo `date`
echo

NSTEP=`grep NSTEP ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
DT=`grep DT ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
NPROC=`grep NPROC ./DATA/Par_file | cut -d = -f 2 `
NSTEP=`grep ^NSTEP ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
DT=`grep ^DT ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
NPROC=`grep ^NPROC ./DATA/Par_file | cut -d = -f 2 `

#daniel:
echo "Par_file parameters:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ echo
echo `date`
echo

NSTEP=`grep NSTEP ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
DT=`grep DT ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
NPROC=`grep NPROC ./DATA/Par_file | cut -d = -f 2 `
NSTEP=`grep ^NSTEP ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
DT=`grep ^DT ./DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
NPROC=`grep ^NPROC ./DATA/Par_file | cut -d = -f 2 `

#daniel:
echo "Par_file parameters:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cp DATA/CMTSOLUTION OUTPUT_FILES/
cp DATA/STATIONS OUTPUT_FILES/

# get the number of processors, ignoring comments in the Par_file
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

# decomposes mesh using the pre-saved mesh files in MESH-default
echo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cd ../
# script to run the mesher and the solver
# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 `
NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 `

# total number of nodes is the product of the values read
numnodes=$NPROC
Expand Down
2 changes: 1 addition & 1 deletion run_this_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cp DATA/CMTSOLUTION OUTPUT_FILES/
cp DATA/STATIONS OUTPUT_FILES/

# get the number of processors, ignoring comments in the Par_file
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

# decomposes mesh using the pre-saved mesh files in MESH-default
echo
Expand Down
4 changes: 2 additions & 2 deletions utils/Cluster/go_generate_databases
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# 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 `
set my_local_path = `grep ^LOCAL_PATH DATA/Par_file | cut -d '=' -f 2 `

# compute total number of processors needed
set NPROC = `grep NPROC DATA/Par_file | cut -d '=' -f 2 `
set NPROC = `grep ^NPROC DATA/Par_file | cut -d '=' -f 2 `

# total number of processors is the product of the values read
@ numprocessors = $NPROC
Expand Down
4 changes: 2 additions & 2 deletions utils/Cluster/go_solver
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
# 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 `
set my_local_path = `grep ^LOCAL_PATH DATA/Par_file | cut -d '=' -f 2 `

# compute total number of processors needed
set NPROC = `grep NPROC DATA/Par_file | cut -d '=' -f 2 `
set NPROC = `grep ^NPROC DATA/Par_file | cut -d '=' -f 2 `

# total number of processors is the product of the values read
@ numprocessors = $NPROC
Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/lsf/go_generate_databases_lsf.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fi
# script to run the mesher and the solver
# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 `
NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 `

# total number of nodes is the product of the values read
numnodes=$NPROC
Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/lsf/go_solver_lsf.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fi
# script to run the mesher and the solver
# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 `
NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 `

# total number of nodes is the product of the values read
numnodes=$NPROC
Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/lsf/run_lsf.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ d=`date`
echo "Finished compilation $d"

# get total number of nodes needed for solver
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 `
NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 `

# compute total number of nodes needed for mesher
NPROC_XI=`grep NPROC_XI DATA/meshfem3D_files/Mesh_Par_file | cut -d = -f 2 `
Expand Down
4 changes: 2 additions & 2 deletions utils/Cluster/pbs/go_decomposer_pbs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ cd $PBS_O_WORKDIR

# script to decompose mesh
# read Par_file to get information about the run
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

# path to database files for mesh
LOCALPATH=`grep LOCAL_PATH DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
LOCALPATH=`grep ^LOCAL_PATH DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

echo starting decomposer for $NPROC partitions
echo " "
Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/pbs/go_generate_databases_pbs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cd $PBS_O_WORKDIR

# script to generate databases
# read Par_file to get information about the run
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

mkdir -p OUTPUT_FILES

Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/pbs/go_mesher_pbs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
cd $PBS_O_WORKDIR

# number of cores for the job
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

mkdir -p OUTPUT_FILES
mkdir -p OUTPUT_FILES/DATABASES_MPI
Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/pbs/go_solver_pbs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd $PBS_O_WORKDIR
# script to run the solver
# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

mkdir -p OUTPUT_FILES

Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/pbs/valgrind_go_solver_pbs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cd $PBS_O_WORKDIR

# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`
NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2`

mkdir -p OUTPUT_FILES

Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/sge/go_generate_databases_sge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# script to run the mesher and the solver
# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 `
NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 `

# total number of nodes is the product of the values read
numnodes=$NPROC
Expand Down
2 changes: 1 addition & 1 deletion utils/Cluster/sge/go_solver_sge.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# script to run the mesher and the solver
# read Par_file to get information about the run
# compute total number of nodes needed
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 `
NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 `

# total number of nodes is the product of the values read
numnodes=$NPROC
Expand Down
2 changes: 1 addition & 1 deletion utils/cmt_frechet/go_solver_cmt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# name of the file that contains the list of machines
set list_of_machines = `grep MACHINE_FILE DATA/Par_file | cut -c 27- `
set my_local_path = `grep LOCAL_PATH DATA/Par_file | cut -c 27- `
set my_local_path = `grep ^LOCAL_PATH DATA/Par_file | cut -c 27- `

# read Par_file to get total number of processors needed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

switch sourceType
case 'FORWARD'
[nt_status nt] = system('grep NSTEP ../DATAs/Par_file | cut -d = -f 2');
[dt_status dt] = system('grep DT ../DATAs/Par_file | cut -d = -f 2');
[nt_status nt] = system('grep ^NSTEP ../DATAs/Par_file | cut -d = -f 2');
[dt_status dt] = system('grep ^DT ../DATAs/Par_file | cut -d = -f 2');
[f_status f] = system('grep half\ duration ../DATAs/backup/CMTSOLUTION_FORWARD | cut -d : -f 2');

nt=str2num(nt);
Expand Down Expand Up @@ -40,7 +40,7 @@


case 'BACKWARD'
[nt_status nt] = system('grep NSTEP ../DATAs/Par_file | cut -d = -f 2');
[nt_status nt] = system('grep ^NSTEP ../DATAs/Par_file | cut -d = -f 2');
nt=str2num(nt);

fid=fopen('../DATAs/backup/STATIONS_FORWARD');
Expand All @@ -63,13 +63,13 @@
totalCutTrace=zeros(cutLength,stationNumber);

benchStation=floor((1+stationNumber)/2);
bench=load(['../OUTPUT_FILES/' c{1,1}{benchStation} '.' c{1,2}{benchStation} '.' band 'Z' '.' variable]);
bench=load(['../OUTPUT_FILES/' c{1,2}{benchStation} '.' c{1,1}{benchStation} '.' band 'Z' '.' variable]);
[benchMax benchMaxIndex] = max(bench(:,2));

for nStation = 1:stationNumber
trace_x = load(['../OUTPUT_FILES/' c{1,1}{nStation} '.' c{1,2}{nStation} '.' band 'X' '.' variable]);
trace_y = load(['../OUTPUT_FILES/' c{1,1}{nStation} '.' c{1,2}{nStation} '.' band 'Y' '.' variable]);
trace_z = load(['../OUTPUT_FILES/' c{1,1}{nStation} '.' c{1,2}{nStation} '.' band 'Z' '.' variable]);
trace_x = load(['../OUTPUT_FILES/' c{1,2}{nStation} '.' c{1,1}{nStation} '.' band 'X' '.' variable]);
trace_y = load(['../OUTPUT_FILES/' c{1,2}{nStation} '.' c{1,1}{nStation} '.' band 'Y' '.' variable]);
trace_z = load(['../OUTPUT_FILES/' c{1,2}{nStation} '.' c{1,1}{nStation} '.' band 'Z' '.' variable]);
cutTrace_x = trace_x(benchMaxIndex - cutLength/2+cutShift:benchMaxIndex + cutLength/2 -1+cutShift,2);
cutTrace_y = trace_y(benchMaxIndex - cutLength/2+cutShift:benchMaxIndex + cutLength/2 -1+cutShift,2);
cutTrace_z = trace_z(benchMaxIndex - cutLength/2+cutShift:benchMaxIndex + cutLength/2 -1+cutShift,2);
Expand Down

0 comments on commit 48bb5b8

Please sign in to comment.