...
 
Commits (5)
branch JenkinsNILU for CI setup
options:
./define_default_run.sh
slfiles:
./loop_on_pathnames.sh
run:
./run_all_sl
clean:
rm -r options*
cleanrun:
rm *.out rm *.err *.sl
This diff is collapsed.
#!/bin/bash
#OUTPUT="$(ls -1 pathnames*)"
OUTPUTdefault="$(ls -1 pathnames*)"
OUTPUT=${OUTPUTvar:-$OUTPUTdefault}
OUTPUTpwd="$(pwd)"
FLEXPARTdefault=FLEXPART_8d70e43
#FLEXPART=FLEXPART_8d70e43
FLEXPART=${FLEXPARTvar:-$FLEXPARTdefault}
echo $OUTPUT
for i in ${OUTPUT}
do
FP_slurm_batch_sl=slurm_batch_$i.sl
#FP_slurm_batch_sl=toto.sl
echo '#!/bin/bash' > $FP_slurm_batch_sl
echo '#SBATCH -J ' FP_$i >> $FP_slurm_batch_sl
echo '#SBATCH -D ' ${OUTPUTpwd} ' # working directory of script' >> $FP_slurm_batch_sl
echo '#SBATCH --mem=8092 # total memory requirement for the node (in MB)' >> $FP_slurm_batch_sl
echo '#SBATCH --mem-per-cpu=1024 # minimum amount of memory required pr. allocated CPU' >> $FP_slurm_batch_sl
echo '#SBATCH -n 1 # number of tasks, e.g. number of cores' >> $FP_slurm_batch_sl
echo '#SBATCH -N 1 # ensure all cores are on the same host/machine' >> $FP_slurm_batch_sl
echo '#SBATCH --mail-type=ALL # when to send e-mail (valid options are: BEGIN,END,FAIL,REQUEUE,ALL)' >> $FP_slurm_batch_sl
echo '#SBATCH --mail-user=ip@nilu.no # who to send email to' >> $FP_slurm_batch_sl
echo '#SBATCH -o output-%N-%j.out # filename to send standard out to' >> $FP_slurm_batch_sl
echo '#SBATCH -e error-%N-%j.err # filename to send standard error to' >> $FP_slurm_batch_sl
echo ' ' >> $FP_slurm_batch_sl
echo 'srun -l ' $FLEXPART $i >> $FP_slurm_batch_sl
echo $FLEXPART $i
done
#!/bin/bash
joblist=joblist #0
#declare -a myarray
declare -a myarray0
declare -a myarray1
declare -a myarray2
# Load file into array.
let i=0
let i0=0
let i1=0
let i1=0
while IFS=$'\n' read -r line_data; do
# Parse “${line_data}” to produce content
# that will be stored in the array.
# (Assume content is stored in a variable
# named 'array_element'.)
# ...
#sbatch slurm_batch_pathnames10.sl
#Submitted batch job 113835
# if [ $((i%2)) -eq 0 ]
# then
## echo $i is "even"
# echo line_data=$line_data
# array_element0=${i#*pathnames}
# echo array_element0=$array_element0
# myarray0[i]="${array_element0}"
# ((++i0))
# fi
echo line_data read=$line_data
#array_element1=${line_data#*pathnames}
array_element1=${line_data#*pathnames}
echo array_element1=$array_element1
array_element1=${array_element1%*.sl}
echo array_element1=$array_element1
myarray1[i]="${array_element1}" # Populate array.
# myarray[i]="${line_data}"
((++i))
done < ${joblist}1$joblistgroup
#done < ${joblist}1
let i=0
while IFS=$'\n' read -r line_data; do
echo line_data read=$line_data
array_element2bis=${line_data##job}
array_element2=${line_data:20:26}
echo array_element2bis=$array_element2
echo array_element2=$array_element2
myarray2[i]="${array_element2}" # Populate array.
((++i))
done < ${joblist}2$joblistgroup
#done < ${joblist}2
let i=0
while (( ${#myarray1[@]} > i )); do
printf "${myarray1[i++]}\n"
done
let i=0
while (( ${#myarray2[@]} > i )); do
printf "${myarray2[i++]}\n"
done
let i=0
while (( ${#myarray2[@]} > i )); do
echo 'test' "${myarray1[$i]}" 'is job' "${myarray2[$i]}"
((++i))
done
let i=0
while (( ${#myarray2[@]} > i )); do
echo 'test' "${myarray1[$i]}" 'is job' "${myarray2[$i]}"
((++i))
done
#exit
tot_successes="$(cat output-*.out | grep CONGRATULATIONS | wc -l)"
tot_runs="$(ls -1 output-*.out | wc -l)"
echo $tot_successes successful out of $tot_runs
let isuc=0
let ifail=0
let i=0
while (( ${#myarray2[@]} > i )); do
# stringin < output-*myarray1[$i].out
# issuccess="$(cat output-*myarray1[$i].out | grep CONGRATULATIONS | wc -l)"
#echo search output-*${myarray1[$i]}.out
#outputlist=$(ls -1 output-*.out | grep ${myarray1[$i]})
#echo outputlist = $outputlist
nummer=${myarray2[$i]}
echo nummer=$nummer
capture=$(find *"$nummer"*out)
capture2=`find *"$nummer"*out`
echo capture=$capture
echo capture2=$capture2
issuccess="$(cat "$capture" | grep CONGRATULATIONS | wc -l)"
issuccess2=`cat "$capture" | grep CONGRATULATIONS | wc -l`
echo $issuccess
echo $issuccess2
#[ $1 -gt 100 ]
#if [[grep -Fxq CONGRATULATIONS "$capture"]]
echo issuccess=$issuccess
echo [ $issuccess -eq 1 ]
if [ $issuccess == 1 ]
then
# code if found
((++isuc))
echo 'test' "${myarray1[$i]}" 'is job' "${myarray2[$i]}" success=$issuccess OK
else
((++ifail))
echo 'test' "${myarray1[$i]}" 'is job' "${myarray2[$i]}" success=$issuccess not found
# code if not found
fi
((++i))
done
echo i=$i
echo isuc=$isuc
echo ifail=$ifail
#output-prod-cn08-113896.out
#!/bin/bash
#OUTPUT="$(ls -1 *.sl)"
OUTPUTdefault="$(ls -1 *.sl)"
OUTPUT=${OUTPUTvar:-$OUTPUTdefault}
echo $OUTPUT
rm joblist
for i in ${OUTPUT}
do
echo sbatch $i | tee -a joblist1$group
sbatch $i | tee -a joblist2$group
done
......@@ -147,6 +147,7 @@ module par_mod
! ECMWF
! integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=359 ! 1.0 degree 92 level
!integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359 ! 1.0 degree 138 level
integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=0 ! 1.0 degree 138 level
! integer,parameter :: nxmax=721,nymax=361,nuvzmax=138,nwzmax=138,nzmax=138,nxshift=359 ! 0.5 degree 138 level
! integer,parameter :: nxmax=181,nymax=91,nuvzmax=92,nwzmax=92,nzmax=92,nxshift=0 ! CERA 2.0 degree 92 level
......