Skip to content
Snippets Groups Projects
Commit 526554ad authored by RIETTE Sébastien's avatar RIETTE Sébastien
Browse files

Bugfixes and hard coded path removal

Hard coded path are removed
env.sh added to hep update environment variables (in particular PATH)
Update the separator used to build pack directori names
parent 858cf0e0
No related branches found
No related tags found
No related merge requests found
...@@ -5,16 +5,16 @@ This document describes how to build reference packs on sxphynh and belenos. ...@@ -5,16 +5,16 @@ This document describes how to build reference packs on sxphynh and belenos.
The following instructions focuse on the 'phyex' pack in which the physics The following instructions focuse on the 'phyex' pack in which the physics
have been put in a new gmkpack project, named phyex. have been put in a new gmkpack project, named phyex.
An other pack ('main') have been produced as a super-reference without code Another pack ('main') have been produced as a super-reference without code
move. Only a recompilation have been done. move. Only a recompilation has been done.
This document ends with instruction on how to use these packs. This step This document ends with instruction on how to use these packs. This step
is now automatically performed with the prep_code.sh script. is now automatically performed with the prep_code.sh script.
On belenos, it is not possible to use the wget used on sxphynh. The file In these instructions, the git package have been installed in:
must be put on a reachable place. On sxphynh: sxphynh:/cnrm/phynh/data1/riette/DATA/202005_externalisation_physique
cd /cnrm/phynh/data1/riette/DATA/202005_externalisation_physique/pack/ belenos:/scratch/work/riette/202005_externalisation_physique
wget http://anonymous:mto@webdav.cnrm.meteo.fr/public/algo/khatib/src/48t1_main.01.tgz Pathes must be adapted.
####################################################################### #######################################################################
Creation on sxphynh, to be done only once and to be shared among users: Creation on sxphynh, to be done only once and to be shared among users:
...@@ -65,7 +65,7 @@ gmkpack -a -r 48t1 -b phyex -n $version -l MIMPIIFC1805 -o 2y -p masterodb -h /s ...@@ -65,7 +65,7 @@ gmkpack -a -r 48t1 -b phyex -n $version -l MIMPIIFC1805 -o 2y -p masterodb -h /s
#populate main pack with source code #populate main pack with source code
cd /scratch/work/riette/202005_externalisation_physique/pack/48t1_phyex.${version}.MIMPIIFC1805.2y/src/local/ cd /scratch/work/riette/202005_externalisation_physique/pack/48t1_phyex.${version}.MIMPIIFC1805.2y/src/local/
scp sxphynh.cnrm.meteo.fr:/cnrm/phynh/data1/riette/DATA/202005_externalisation_physique/pack/48t1_main.01.tgz . ssh sxphynh.cnrm.meteo.fr "wget http://anonymous:mto@webdav.cnrm.meteo.fr/public/algo/khatib/src/48t1_main.01.tgz -O -" > 48t1_main.01.tg
tar xf 48t1_main.01.tgz tar xf 48t1_main.01.tgz
rm -f 48t1_main.01.tgz rm -f 48t1_main.01.tgz
for rep in turb micro conv; do for rep in turb micro conv; do
......
...@@ -17,19 +17,21 @@ set -e ...@@ -17,19 +17,21 @@ set -e
specialPack="ori split recompil" specialPack="ori split recompil"
availTests="small_3D,small_3D_np2,small_3D_alt1,small_3D_alt2,small_3D_alt3,small_3D_alt4,small_3D_alt5" availTests="small_3D,small_3D_np2,small_3D_alt1,small_3D_alt2,small_3D_alt3,small_3D_alt4,small_3D_alt5"
defaultTest="small_3D" defaultTest="small_3D"
separator='_' #- be carrefull, gmkpack (at least on belenos) has multiple allergies (':', '.', '@')
#- seprator must be in sync with prep_code.sh separator
if [ $(hostname | cut -c 1-7) == 'belenos' ]; then PHYEXTOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
dirpack=$PHYEXTOOLSDIR/pack
dirconf=$PHYEXTOOLSDIR/conf_tests
if [ $(hostname | cut -c 1-7) == 'belenos' -o $(hostname | cut -c 1-7) == 'taranis' ]; then
HPC=1 HPC=1
dirpack=/scratch/work/riette/202005_externalisation_physique/pack
dirconf=/scratch/work/riette/202005_externalisation_physique/conf_tests
gmkpack_l=MIMPIIFC1805 gmkpack_l=MIMPIIFC1805
gmkpack_o=2y gmkpack_o=2y
defaultMainPackVersion=01 defaultMainPackVersion=01
defaultRef=split defaultRef=split
else else
HPC=0 HPC=0
dirpack=/cnrm/phynh/data1/riette/DATA/202005_externalisation_physique/pack
dirconf=/cnrm/phynh/data1/riette/DATA/202005_externalisation_physique/conf_tests
gmkpack_l=MPIGFORTRAN920DBL gmkpack_l=MPIGFORTRAN920DBL
gmkpack_o=xfftw gmkpack_o=xfftw
defaultMainPackVersion=01 defaultMainPackVersion=01
...@@ -99,6 +101,7 @@ while [ -n "$1" ]; do ...@@ -99,6 +101,7 @@ while [ -n "$1" ]; do
done done
HOMEPACK=${HOMEPACK:=$HOME/pack} HOMEPACK=${HOMEPACK:=$HOME/pack}
function exescript () { function exescript () {
#usage: exescript <output file> <script> [arg [arg ...]] #usage: exescript <output file> <script> [arg [arg ...]]
output=$1 output=$1
...@@ -139,7 +142,7 @@ fi ...@@ -139,7 +142,7 @@ fi
fromdir='' fromdir=''
if echo $commit | grep '/' > /dev/null; then if echo $commit | grep '/' > /dev/null; then
fromdir=$commit fromdir=$commit
packBranch=$(echo $commit | sed 's/\//@/g' | sed 's/:/@/g') packBranch=$(echo $commit | sed 's/\//'${separator}'/g' | sed 's/:/'${separator}'/g' | sed 's/\./'${separator}'/g')
name="PHYEX/48t1_${packBranch}.01.${gmkpack_l}.${gmkpack_o}" name="PHYEX/48t1_${packBranch}.01.${gmkpack_l}.${gmkpack_o}"
[ $suppress -eq 1 -a -d $HOMEPACK/$name ] && rm -rf $HOMEPACK/$name [ $suppress -eq 1 -a -d $HOMEPACK/$name ] && rm -rf $HOMEPACK/$name
elif echo $specialPack | grep -w $commit > /dev/null; then elif echo $specialPack | grep -w $commit > /dev/null; then
...@@ -154,7 +157,7 @@ if [ ! -z "${reference-}" ]; then ...@@ -154,7 +157,7 @@ if [ ! -z "${reference-}" ]; then
reffromdir='' reffromdir=''
if echo $reference | grep '/' > /dev/null; then if echo $reference | grep '/' > /dev/null; then
reffromdir=$reference reffromdir=$reference
name="PHYEX/48t1_$(echo $reference | sed 's/\//@/g' | sed 's/:/@/g').01.${gmkpack_l}.${gmkpack_o}" name="PHYEX/48t1_$(echo $reference | sed 's/\//'${separator}'/g' | sed 's/:/'${separator}'/g' | sed 's/\./'${separator}'/g').01.${gmkpack_l}.${gmkpack_o}"
elif echo $specialPack | grep -w $reference > /dev/null; then elif echo $specialPack | grep -w $reference > /dev/null; then
refname="PHYEX/$reference" refname="PHYEX/$reference"
else else
...@@ -190,7 +193,11 @@ if [ $compilation -eq 1 ]; then ...@@ -190,7 +193,11 @@ if [ $compilation -eq 1 ]; then
gmkpack -a -r 48t1 -b ${packBranch} -n 01 -l ${gmkpack_l} -o ${gmkpack_o} -p masterodb -h $HOMEPACK/PHYEX gmkpack -a -r 48t1 -b ${packBranch} -n 01 -l ${gmkpack_l} -o ${gmkpack_o} -p masterodb -h $HOMEPACK/PHYEX
#Populate (we keep everything from the official source code except internals and module subdirectories of mpa) #Populate (we keep everything from the official source code except internals and module subdirectories of mpa)
cd $HOMEPACK/$name/src/local/ cd $HOMEPACK/$name/src/local/
scp sxphynh.cnrm.meteo.fr:/cnrm/phynh/data1/riette/DATA/202005_externalisation_physique/pack/48t1_main.01.tgz . if [ $HPC -eq 1 ]; then
ssh sxphynh.cnrm.meteo.fr "wget http://anonymous:mto@webdav.cnrm.meteo.fr/public/algo/khatib/src/48t1_main.01.tgz -O -" > 48t1_main.01.tgz
else
wget http://anonymous:mto@webdav.cnrm.meteo.fr/public/algo/khatib/src/48t1_main.01.tgz
fi
tar xf 48t1_main.01.tgz tar xf 48t1_main.01.tgz
rm -f 48t1_main.01.tgz rm -f 48t1_main.01.tgz
for rep in turb micro conv; do for rep in turb micro conv; do
...@@ -211,7 +218,7 @@ if [ $compilation -eq 1 ]; then ...@@ -211,7 +218,7 @@ if [ $compilation -eq 1 ]; then
subs="" #There is nothing to exclude from compilation because (normally) only needed files are copied into the pack subs="" #There is nothing to exclude from compilation because (normally) only needed files are copied into the pack
fi fi
MNH_EXPAND_DIR=$(dirname "${BASH_SOURCE[0]}")/mnh_expand MNH_EXPAND_DIR=$PHYEXTOOLSDIR/mnh_expand
export PATH=$MNH_EXPAND_DIR/filepp:$MNH_EXPAND_DIR/MNH_Expand_Array:$PATH export PATH=$MNH_EXPAND_DIR/filepp:$MNH_EXPAND_DIR/MNH_Expand_Array:$PATH
cd $HOMEPACK/$name/src/local/phyex cd $HOMEPACK/$name/src/local/phyex
...@@ -221,10 +228,10 @@ if [ $compilation -eq 1 ]; then ...@@ -221,10 +228,10 @@ if [ $compilation -eq 1 ]; then
expand_options="" expand_options=""
fi fi
subs="$subs -s turb -s micro -s aux -s ext -s conv -s externals" #externals is the old name for aux/ext subs="$subs -s turb -s micro -s aux -s ext -s conv -s externals" #externals is the old name for aux/ext
prep_code=$(dirname "${BASH_SOURCE[0]}")/prep_code.sh prep_code=$PHYEXTOOLSDIR/prep_code.sh
if [ "$fromdir" == '' ]; then if [ "$fromdir" == '' ]; then
echo "Clone repository, and checkout commit $commit (using prep_code.sh)" echo "Clone repository, and checkout commit $commit (using prep_code.sh)"
if [[ $commit == arome@* ]]; then if [[ $commit == arome${separator}* ]]; then
$prep_code -c $commit PHYEX #This commit is ready for inclusion $prep_code -c $commit PHYEX #This commit is ready for inclusion
else else
$prep_code -c $commit $expand_options $subs -m arome PHYEX $prep_code -c $commit $expand_options $subs -m arome PHYEX
...@@ -366,7 +373,7 @@ if [ $check -eq 1 ]; then ...@@ -366,7 +373,7 @@ if [ $check -eq 1 ]; then
[ ! -d /d0/images/$USER ] && mkdir /d0/images/$USER [ ! -d /d0/images/$USER ] && mkdir /d0/images/$USER
ddh_images="$ddh_images /d0/images/$USER/ddh_diff_${tag}.png" ddh_images="$ddh_images /d0/images/$USER/ddh_diff_${tag}.png"
fi fi
cmd="$(dirname "${BASH_SOURCE[0]}")/comp_DDH.py" cmd="$PHYEXTOOLSDIR/comp_DDH.py"
if [ ! -x $cmd ]; then if [ ! -x $cmd ]; then
echo "Command not found: \"$cmd\"" echo "Command not found: \"$cmd\""
exit 10 exit 10
...@@ -375,7 +382,7 @@ if [ $check -eq 1 ]; then ...@@ -375,7 +382,7 @@ if [ $check -eq 1 ]; then
output='stdout' output='stdout'
elif [ $(basename $file) == NODE.001_01 ]; then elif [ $(basename $file) == NODE.001_01 ]; then
#Output listing #Output listing
cmd="$(dirname "${BASH_SOURCE[0]}")/diffNODE.001_01" cmd="$PHYEXTOOLSDIR/diffNODE.001_01"
if [ ! -x $cmd ]; then if [ ! -x $cmd ]; then
echo "Command not found: \"$cmd\"" echo "Command not found: \"$cmd\""
exit 11 exit 11
......
env.sh 0 → 100644
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MNH_EXPAND_DIR=$DIR/mnh_expand
export PATH=$DIR:$MNH_EXPAND_DIR/filepp:$MNH_EXPAND_DIR/MNH_Expand_Array:$PATH
...@@ -39,7 +39,9 @@ function usage { ...@@ -39,7 +39,9 @@ function usage {
echo "To use mnh_expand... it must be installed (alongside the filepp tool)" echo "To use mnh_expand... it must be installed (alongside the filepp tool)"
} }
full_command="${BASH_SOURCE[0]} $@" full_command="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) $@"
separator='_' #- be carrefull, gmkpack (at least on belenos) has multiple allergies (':', '.', '@')
#- seprator must be in sync with prep_code.sh separator
directory="" directory=""
checkout_point="" checkout_point=""
...@@ -73,7 +75,7 @@ fi ...@@ -73,7 +75,7 @@ fi
###### BRANCH OR NOT BRANCH ###### BRANCH OR NOT BRANCH
if [ -n "${checkout_point-}" -a -n "${model-}" -a $push == 1 ]; then if [ -n "${checkout_point-}" -a -n "${model-}" -a $push == 1 ]; then
branch=${model}@${checkout_point} branch=${model}${separator}${checkout_point}
fi fi
###### WORKING DIRECTORY ###### WORKING DIRECTORY
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment