[cig-commits] [commit] devel: updates grep statements (48bb5b8)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Dec 23 05:06:49 PST 2014
Repository : https://github.com/geodynamics/specfem3d
On branch : devel
Link : https://github.com/geodynamics/specfem3d/compare/c92aeae6613ca38c29e96dd169c292160dc53e21...c3b9c7ef07feb7d057fa71da18323d53b9c27233
>---------------------------------------------------------------
commit 48bb5b89eca20ca1712e5a590f59387e4db03017
Author: daniel peter <peterda at ethz.ch>
Date: Tue Dec 23 11:22:19 2014 +0100
updates grep statements
>---------------------------------------------------------------
48bb5b89eca20ca1712e5a590f59387e4db03017
.../ACOUSTIC/run_inhomogeneous.bash | 6 +++---
.../ELASTIC/run_inhomogeneous.bash | 6 +++---
.../run_this_example.sh | 2 +-
.../meshfem3D_examples/many_interfaces/go_process_pbs.bash | 2 +-
run_this_example.sh | 2 +-
utils/Cluster/go_generate_databases | 4 ++--
utils/Cluster/go_solver | 4 ++--
utils/Cluster/lsf/go_generate_databases_lsf.bash | 2 +-
utils/Cluster/lsf/go_solver_lsf.bash | 2 +-
utils/Cluster/lsf/run_lsf.bash | 2 +-
utils/Cluster/pbs/go_decomposer_pbs.bash | 4 ++--
utils/Cluster/pbs/go_generate_databases_pbs.bash | 2 +-
utils/Cluster/pbs/go_mesher_pbs.bash | 2 +-
utils/Cluster/pbs/go_solver_pbs.bash | 2 +-
utils/Cluster/pbs/valgrind_go_solver_pbs.bash | 2 +-
utils/Cluster/sge/go_generate_databases_sge.bash | 2 +-
utils/Cluster/sge/go_solver_sge.bash | 2 +-
utils/cmt_frechet/go_solver_cmt | 2 +-
...and_backward_sources_time_reversal_Yingzi_Ying_Matlab.m | 14 +++++++-------
19 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/run_inhomogeneous.bash b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/run_inhomogeneous.bash
index 22efbae..40ee641 100755
--- a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/run_inhomogeneous.bash
+++ b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/run_inhomogeneous.bash
@@ -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:"
diff --git a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/run_inhomogeneous.bash b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/run_inhomogeneous.bash
index 96d7920..2f8b10f 100755
--- a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/run_inhomogeneous.bash
+++ b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/run_inhomogeneous.bash
@@ -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:"
diff --git a/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh b/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh
index d5ad295..3e5701f 100755
--- a/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh
+++ b/EXAMPLES/homogeneous_halfspace_HEX8_elastic_absorbing_Stacey_5sides/run_this_example.sh
@@ -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
diff --git a/EXAMPLES/meshfem3D_examples/many_interfaces/go_process_pbs.bash b/EXAMPLES/meshfem3D_examples/many_interfaces/go_process_pbs.bash
index 999965b..aea4813 100755
--- a/EXAMPLES/meshfem3D_examples/many_interfaces/go_process_pbs.bash
+++ b/EXAMPLES/meshfem3D_examples/many_interfaces/go_process_pbs.bash
@@ -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
diff --git a/run_this_example.sh b/run_this_example.sh
index e6be198..81bd473 100755
--- a/run_this_example.sh
+++ b/run_this_example.sh
@@ -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
diff --git a/utils/Cluster/go_generate_databases b/utils/Cluster/go_generate_databases
index f5322ac..29cd410 100755
--- a/utils/Cluster/go_generate_databases
+++ b/utils/Cluster/go_generate_databases
@@ -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
diff --git a/utils/Cluster/go_solver b/utils/Cluster/go_solver
index 690cfc1..d332a98 100755
--- a/utils/Cluster/go_solver
+++ b/utils/Cluster/go_solver
@@ -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
diff --git a/utils/Cluster/lsf/go_generate_databases_lsf.bash b/utils/Cluster/lsf/go_generate_databases_lsf.bash
index ea9212a..9579331 100755
--- a/utils/Cluster/lsf/go_generate_databases_lsf.bash
+++ b/utils/Cluster/lsf/go_generate_databases_lsf.bash
@@ -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
diff --git a/utils/Cluster/lsf/go_solver_lsf.bash b/utils/Cluster/lsf/go_solver_lsf.bash
index 0e6323e..1b01704 100755
--- a/utils/Cluster/lsf/go_solver_lsf.bash
+++ b/utils/Cluster/lsf/go_solver_lsf.bash
@@ -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
diff --git a/utils/Cluster/lsf/run_lsf.bash b/utils/Cluster/lsf/run_lsf.bash
index fcf061f..e0ca60e 100755
--- a/utils/Cluster/lsf/run_lsf.bash
+++ b/utils/Cluster/lsf/run_lsf.bash
@@ -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 `
diff --git a/utils/Cluster/pbs/go_decomposer_pbs.bash b/utils/Cluster/pbs/go_decomposer_pbs.bash
index 263a561..845d27a 100755
--- a/utils/Cluster/pbs/go_decomposer_pbs.bash
+++ b/utils/Cluster/pbs/go_decomposer_pbs.bash
@@ -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 " "
diff --git a/utils/Cluster/pbs/go_generate_databases_pbs.bash b/utils/Cluster/pbs/go_generate_databases_pbs.bash
index 1f0ca2a..1b7d5c4 100755
--- a/utils/Cluster/pbs/go_generate_databases_pbs.bash
+++ b/utils/Cluster/pbs/go_generate_databases_pbs.bash
@@ -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
diff --git a/utils/Cluster/pbs/go_mesher_pbs.bash b/utils/Cluster/pbs/go_mesher_pbs.bash
index 633cf64..feecceb 100755
--- a/utils/Cluster/pbs/go_mesher_pbs.bash
+++ b/utils/Cluster/pbs/go_mesher_pbs.bash
@@ -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
diff --git a/utils/Cluster/pbs/go_solver_pbs.bash b/utils/Cluster/pbs/go_solver_pbs.bash
index f642d97..14a525d 100755
--- a/utils/Cluster/pbs/go_solver_pbs.bash
+++ b/utils/Cluster/pbs/go_solver_pbs.bash
@@ -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
diff --git a/utils/Cluster/pbs/valgrind_go_solver_pbs.bash b/utils/Cluster/pbs/valgrind_go_solver_pbs.bash
index 92f255b..8523849 100755
--- a/utils/Cluster/pbs/valgrind_go_solver_pbs.bash
+++ b/utils/Cluster/pbs/valgrind_go_solver_pbs.bash
@@ -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
diff --git a/utils/Cluster/sge/go_generate_databases_sge.bash b/utils/Cluster/sge/go_generate_databases_sge.bash
index a614ca3..6acbf2b 100755
--- a/utils/Cluster/sge/go_generate_databases_sge.bash
+++ b/utils/Cluster/sge/go_generate_databases_sge.bash
@@ -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
diff --git a/utils/Cluster/sge/go_solver_sge.bash b/utils/Cluster/sge/go_solver_sge.bash
index 958b7cc..eb11b6a 100755
--- a/utils/Cluster/sge/go_solver_sge.bash
+++ b/utils/Cluster/sge/go_solver_sge.bash
@@ -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
diff --git a/utils/cmt_frechet/go_solver_cmt b/utils/cmt_frechet/go_solver_cmt
index 99f0d94..6bf7c1f 100755
--- a/utils/cmt_frechet/go_solver_cmt
+++ b/utils/cmt_frechet/go_solver_cmt
@@ -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
diff --git a/utils/generate_SOURCE_file_forward_and_backward_sources_time_reversal_Yingzi_Ying_Matlab.m b/utils/generate_SOURCE_file_forward_and_backward_sources_time_reversal_Yingzi_Ying_Matlab.m
index 6bac417..9bcf9d3 100644
--- a/utils/generate_SOURCE_file_forward_and_backward_sources_time_reversal_Yingzi_Ying_Matlab.m
+++ b/utils/generate_SOURCE_file_forward_and_backward_sources_time_reversal_Yingzi_Ying_Matlab.m
@@ -10,8 +10,8 @@ backwardSourceComponent=[1 1 1];
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);
@@ -40,7 +40,7 @@ end
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');
@@ -63,13 +63,13 @@ cutShift = 0;
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);
More information about the CIG-COMMITS
mailing list