[cig-commits] [commit] devel, master: NOISE minor changes (02fee70)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Nov 6 08:04:37 PST 2014
Repository : https://github.com/geodynamics/specfem3d_globe
On branches: devel,master
Link : https://github.com/geodynamics/specfem3d_globe/compare/bc58e579b3b0838a0968725a076f5904845437ca...be63f20cbb6f462104e949894dbe205d2398cd7f
>---------------------------------------------------------------
commit 02fee703ccbd2bcfce3d0d64b579986c4b1b3c2e
Author: Yang Luo <yangl at princeton.edu>
Date: Tue Mar 22 21:52:38 2011 +0000
NOISE minor changes
>---------------------------------------------------------------
02fee703ccbd2bcfce3d0d64b579986c4b1b3c2e
noise_examples/global_long/NOISE123.submit_atten | 36 ++++-------------------
noise_examples/global_long/NOISE_clean_create | 14 +++++----
noise_examples/global_long/NOISE_collect | 20 ++++++-------
noise_examples/global_short/NOISE123.submit_atten | 36 ++++-------------------
noise_examples/global_short/NOISE_clean_create | 14 +++++----
noise_examples/global_short/NOISE_collect | 20 ++++++-------
noise_examples/pre-processing | 14 +++------
noise_examples/regional/NOISE123.submit_atten | 36 ++++-------------------
noise_examples/regional/NOISE_clean_create | 14 +++++----
noise_examples/regional/NOISE_collect | 20 ++++++-------
10 files changed, 73 insertions(+), 151 deletions(-)
diff --git a/noise_examples/global_long/NOISE123.submit_atten b/noise_examples/global_long/NOISE123.submit_atten
index 8763ac3..9acd958 100755
--- a/noise_examples/global_long/NOISE123.submit_atten
+++ b/noise_examples/global_long/NOISE123.submit_atten
@@ -24,26 +24,13 @@ echo "$PBS_JOBID" > zzz_job_info/jobid_all
d=`date`
LOCAL_PATH_ALL=`grep LOCAL_PATH DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
echo "Start cleaning local disk on nodes, $d"
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+1 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+8 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_clean_create $LOCAL_PATH_ALL
d=`date`
echo "Finish cleaning local disk on nodes, $d"
## clean OUTPUT_FILES
-rm -rf OUTPUT_FILES
-mkdir OUTPUT_FILES
+rm -rf OUTPUT_FILES
+mkdir -p OUTPUT_FILES
#### backup Fortran source files
##rm -rf ZZZ_src
@@ -120,14 +107,7 @@ mpiexec -np $numnodes -hostfile zzz_job_info/compute_nodes_all $PWD/xspecfem3D_n
## collect outputs (e.g., kernels, meshes) from local nodes to global disk
d=`date`
echo "Start collecting outputs from nodes, $d"
-for (( ievent=1;ievent<=$numnodes;ievent++ ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- let myrank="$ievent-1"
- mpiexec -np 1 -host $machine_all ./NOISE_collect $machine_all $machine_all $LOCAL_PATH_ALL $LOCAL_PATH_ALL $myrank < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_collect $LOCAL_PATH_ALL OUTPUT_FILES/
d=`date`
echo "Finish collecting outputs from nodes, $d"
@@ -140,12 +120,6 @@ cp DATA/CMTSOLUTION ZZZ_3/
cp DATA/STATIONS ZZZ_3/
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+1 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_clean_create $LOCAL_PATH_ALL
d=`date`
echo "Finish cleaning local disk on nodes, $d"
diff --git a/noise_examples/global_long/NOISE_clean_create b/noise_examples/global_long/NOISE_clean_create
index 5caea4f..bb03b61 100755
--- a/noise_examples/global_long/NOISE_clean_create
+++ b/noise_examples/global_long/NOISE_clean_create
@@ -1,7 +1,11 @@
-#!/bin/bash
-ulimit -s unlimited
+#!/bin/bash -eu
-LOCAL_PATH=$1
+DIR_LOCAL=$1
+iproc=$PBS_VNODENUM
+
+##### other files can be collected in the same way
+if [ $(($iproc % 8)) = 0 ]; then
+ rm -rf $DIR_LOCAL
+ mkdir -p $DIR_LOCAL
+fi
-rm -rf $LOCAL_PATH
-mkdir -p $LOCAL_PATH
diff --git a/noise_examples/global_long/NOISE_collect b/noise_examples/global_long/NOISE_collect
index b373407..806d7b9 100755
--- a/noise_examples/global_long/NOISE_collect
+++ b/noise_examples/global_long/NOISE_collect
@@ -1,13 +1,11 @@
-#!/bin/bash
+#!/bin/bash -eu
-machine_new=$1
-machine_old=$2
-LOCAL_PATH_NEW=$3
-LOCAL_PATH_OLD=$4
-let myrank=$5
-myrank_new=`printf "%06d" $myrank`
+DIR_LOCAL=$1
+DIR_GLOBAL=$2
+iproc=`printf "%06d" $PBS_VNODENUM`
+
+##### other files can be collected in the same way
+mv $DIR_LOCAL/*$iproc*reg1*kernel*.bin $DIR_GLOBAL/
+mv $DIR_LOCAL/*$iproc*reg1_*array_dims.txt $DIR_GLOBAL/
+mv $DIR_LOCAL/*$iproc*reg1_solver_data*.bin $DIR_GLOBAL/
-##echo "cp $LOCAL_PATH_NEW/proc$myrank_new*kernel* OUTPUT_FILES/"
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1*kernel*.bin OUTPUT_FILES/
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1_*array_dims.txt OUTPUT_FILES/
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1_solver_data*.bin OUTPUT_FILES/
diff --git a/noise_examples/global_short/NOISE123.submit_atten b/noise_examples/global_short/NOISE123.submit_atten
index 8763ac3..9acd958 100755
--- a/noise_examples/global_short/NOISE123.submit_atten
+++ b/noise_examples/global_short/NOISE123.submit_atten
@@ -24,26 +24,13 @@ echo "$PBS_JOBID" > zzz_job_info/jobid_all
d=`date`
LOCAL_PATH_ALL=`grep LOCAL_PATH DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
echo "Start cleaning local disk on nodes, $d"
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+1 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+8 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_clean_create $LOCAL_PATH_ALL
d=`date`
echo "Finish cleaning local disk on nodes, $d"
## clean OUTPUT_FILES
-rm -rf OUTPUT_FILES
-mkdir OUTPUT_FILES
+rm -rf OUTPUT_FILES
+mkdir -p OUTPUT_FILES
#### backup Fortran source files
##rm -rf ZZZ_src
@@ -120,14 +107,7 @@ mpiexec -np $numnodes -hostfile zzz_job_info/compute_nodes_all $PWD/xspecfem3D_n
## collect outputs (e.g., kernels, meshes) from local nodes to global disk
d=`date`
echo "Start collecting outputs from nodes, $d"
-for (( ievent=1;ievent<=$numnodes;ievent++ ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- let myrank="$ievent-1"
- mpiexec -np 1 -host $machine_all ./NOISE_collect $machine_all $machine_all $LOCAL_PATH_ALL $LOCAL_PATH_ALL $myrank < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_collect $LOCAL_PATH_ALL OUTPUT_FILES/
d=`date`
echo "Finish collecting outputs from nodes, $d"
@@ -140,12 +120,6 @@ cp DATA/CMTSOLUTION ZZZ_3/
cp DATA/STATIONS ZZZ_3/
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+1 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_clean_create $LOCAL_PATH_ALL
d=`date`
echo "Finish cleaning local disk on nodes, $d"
diff --git a/noise_examples/global_short/NOISE_clean_create b/noise_examples/global_short/NOISE_clean_create
index 5caea4f..bb03b61 100755
--- a/noise_examples/global_short/NOISE_clean_create
+++ b/noise_examples/global_short/NOISE_clean_create
@@ -1,7 +1,11 @@
-#!/bin/bash
-ulimit -s unlimited
+#!/bin/bash -eu
-LOCAL_PATH=$1
+DIR_LOCAL=$1
+iproc=$PBS_VNODENUM
+
+##### other files can be collected in the same way
+if [ $(($iproc % 8)) = 0 ]; then
+ rm -rf $DIR_LOCAL
+ mkdir -p $DIR_LOCAL
+fi
-rm -rf $LOCAL_PATH
-mkdir -p $LOCAL_PATH
diff --git a/noise_examples/global_short/NOISE_collect b/noise_examples/global_short/NOISE_collect
index b373407..806d7b9 100755
--- a/noise_examples/global_short/NOISE_collect
+++ b/noise_examples/global_short/NOISE_collect
@@ -1,13 +1,11 @@
-#!/bin/bash
+#!/bin/bash -eu
-machine_new=$1
-machine_old=$2
-LOCAL_PATH_NEW=$3
-LOCAL_PATH_OLD=$4
-let myrank=$5
-myrank_new=`printf "%06d" $myrank`
+DIR_LOCAL=$1
+DIR_GLOBAL=$2
+iproc=`printf "%06d" $PBS_VNODENUM`
+
+##### other files can be collected in the same way
+mv $DIR_LOCAL/*$iproc*reg1*kernel*.bin $DIR_GLOBAL/
+mv $DIR_LOCAL/*$iproc*reg1_*array_dims.txt $DIR_GLOBAL/
+mv $DIR_LOCAL/*$iproc*reg1_solver_data*.bin $DIR_GLOBAL/
-##echo "cp $LOCAL_PATH_NEW/proc$myrank_new*kernel* OUTPUT_FILES/"
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1*kernel*.bin OUTPUT_FILES/
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1_*array_dims.txt OUTPUT_FILES/
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1_solver_data*.bin OUTPUT_FILES/
diff --git a/noise_examples/pre-processing b/noise_examples/pre-processing
index 86fd0e2..efe55e8 100755
--- a/noise_examples/pre-processing
+++ b/noise_examples/pre-processing
@@ -11,26 +11,20 @@ cd ../../
mkdir -p SEM zzz_job_info NOISE_TOMOGRAPHY
-#cp $dir/A0.II.LHZ.adj ./SEM/
-#cp $dir/cp_adj_sources ./SEM/
-
cp $dir/adj_traveltime_filter.f90 ./
cp $dir/NOISE123.submit_atten ./
cp $dir/NOISE_clean_create ./
cp $dir/NOISE_collect ./
cp $dir/NOISE_transfer ./
-cp $dir/S_squared ./NOISE_TOMOGRAPHY
+cp $dir/S_squared ./NOISE_TOMOGRAPHY/
cp $dir/irec_master_noise ./NOISE_TOMOGRAPHY/
cp $dir/nu_master ./NOISE_TOMOGRAPHY/
cp $dir/Par_file_NOISE_* ./DATA/
-cp $dir/CMTSOLUTION_NOISE ./DATA/
-cp $dir/STATIONS_NOISE ./DATA/
-
-#cd SEM
-#./cp_adj_sources
-#cd ..
+cp $dir/CMTSOLUTION_NOISE ./DATA/CMTSOLUTION
+cp $dir/STATIONS_NOISE ./DATA/STATIONS
+cp $dir/STATIONS_NOISE_ADJOINT ./DATA/STATIONS_ADJOINT
ifort -o NOISE_adj adj_traveltime_filter.f90
diff --git a/noise_examples/regional/NOISE123.submit_atten b/noise_examples/regional/NOISE123.submit_atten
index 4faad9f..7aedc31 100755
--- a/noise_examples/regional/NOISE123.submit_atten
+++ b/noise_examples/regional/NOISE123.submit_atten
@@ -24,26 +24,13 @@ echo "$PBS_JOBID" > zzz_job_info/jobid_all
d=`date`
LOCAL_PATH_ALL=`grep LOCAL_PATH DATA/Par_file | cut -d = -f 2 | sed 's/ //g'`
echo "Start cleaning local disk on nodes, $d"
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+1 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+8 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_clean_create $LOCAL_PATH_ALL
d=`date`
echo "Finish cleaning local disk on nodes, $d"
## clean OUTPUT_FILES
-rm -rf OUTPUT_FILES
-mkdir OUTPUT_FILES
+rm -rf OUTPUT_FILES
+mkdir -p OUTPUT_FILES
#### backup Fortran source files
##rm -rf ZZZ_src
@@ -120,14 +107,7 @@ mpiexec -np $numnodes -hostfile zzz_job_info/compute_nodes_all $PWD/xspecfem3D_n
## collect outputs (e.g., kernels, meshes) from local nodes to global disk
d=`date`
echo "Start collecting outputs from nodes, $d"
-for (( ievent=1;ievent<=$numnodes;ievent++ ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- let myrank="$ievent-1"
- mpiexec -np 1 -host $machine_all ./NOISE_collect $machine_all $machine_all $LOCAL_PATH_ALL $LOCAL_PATH_ALL $myrank < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_collect $LOCAL_PATH_ALL OUTPUT_FILES/
d=`date`
echo "Finish collecting outputs from nodes, $d"
@@ -140,12 +120,6 @@ cp DATA/CMTSOLUTION ZZZ_3/
cp DATA/STATIONS ZZZ_3/
-for (( ievent=1;ievent<=$numnodes;ievent=ievent+1 ))
-do
- let line=$ievent
- machine_all=$(awk 'NR=='$line'{print}' zzz_job_info/compute_nodes_all)
- mpiexec -np 1 -host $machine_all ./NOISE_clean_create $LOCAL_PATH_ALL < /dev/null &
-done
-wait
+pbsdsh $PBS_O_WORKDIR/NOISE_clean_create $LOCAL_PATH_ALL
d=`date`
echo "Finish cleaning local disk on nodes, $d"
diff --git a/noise_examples/regional/NOISE_clean_create b/noise_examples/regional/NOISE_clean_create
index 5caea4f..bb03b61 100755
--- a/noise_examples/regional/NOISE_clean_create
+++ b/noise_examples/regional/NOISE_clean_create
@@ -1,7 +1,11 @@
-#!/bin/bash
-ulimit -s unlimited
+#!/bin/bash -eu
-LOCAL_PATH=$1
+DIR_LOCAL=$1
+iproc=$PBS_VNODENUM
+
+##### other files can be collected in the same way
+if [ $(($iproc % 8)) = 0 ]; then
+ rm -rf $DIR_LOCAL
+ mkdir -p $DIR_LOCAL
+fi
-rm -rf $LOCAL_PATH
-mkdir -p $LOCAL_PATH
diff --git a/noise_examples/regional/NOISE_collect b/noise_examples/regional/NOISE_collect
index b373407..806d7b9 100755
--- a/noise_examples/regional/NOISE_collect
+++ b/noise_examples/regional/NOISE_collect
@@ -1,13 +1,11 @@
-#!/bin/bash
+#!/bin/bash -eu
-machine_new=$1
-machine_old=$2
-LOCAL_PATH_NEW=$3
-LOCAL_PATH_OLD=$4
-let myrank=$5
-myrank_new=`printf "%06d" $myrank`
+DIR_LOCAL=$1
+DIR_GLOBAL=$2
+iproc=`printf "%06d" $PBS_VNODENUM`
+
+##### other files can be collected in the same way
+mv $DIR_LOCAL/*$iproc*reg1*kernel*.bin $DIR_GLOBAL/
+mv $DIR_LOCAL/*$iproc*reg1_*array_dims.txt $DIR_GLOBAL/
+mv $DIR_LOCAL/*$iproc*reg1_solver_data*.bin $DIR_GLOBAL/
-##echo "cp $LOCAL_PATH_NEW/proc$myrank_new*kernel* OUTPUT_FILES/"
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1*kernel*.bin OUTPUT_FILES/
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1_*array_dims.txt OUTPUT_FILES/
-mv $LOCAL_PATH_NEW/proc$myrank_new*reg1_solver_data*.bin OUTPUT_FILES/
More information about the CIG-COMMITS
mailing list