Commit d8897b1e authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

passage en fonction

parent 5948a673
......@@ -4,8 +4,8 @@
NCORES=8
#QUEUE="pa_long -pe openmpi_$NCORES $NCORES"
QUEUE="mc_long -pe multicores $NCORES"
#QUEUE="long"
#QUEUE="mc_long -pe multicores $NCORES"
QUEUE="long"
if [ "$QUEUE" = "long" ] ; then
NCORES=1
......@@ -42,7 +42,7 @@ dirpar=$PWD
cd -
parbase=`basename $parFile`
zeroot=$CAMELROOT/batch/${parbase%".par"}
zeroot=$CAMELROOT/batch/${parbase%".par"}_min
echo "Ouptut will be in: $zeroot"
if [ -d $zeroot ] ; then
......@@ -90,4 +90,7 @@ exit 1
fi
qsub -P P_$GROUP -q $QUEUE -l sps=1 -R y -j y -o $PWD -e $PWD -N $(basename $zeroot) zerun.sh
cd -
......@@ -77,7 +77,9 @@ export OMP_NUM_THREADS=8
export PYTHONPATH=${PICO_CODE}
# copies localeS
cp $CAMELROOT/batch/awk/toPico.awk .
cp $CAMELROOT/$CMTCONFIG/Minimize .
#
#input file -> transforme en pico et enleve var
awk -f toPico.awk $file | grep -v "$var" > parfile_in
......@@ -107,7 +109,6 @@ cat > camelrun <<EOBATCH
#$ -o $PWD
#$ -e $PWD
cd \$TMPDIR
export OMP_NUM_THREADS=8
export PYTHONPATH=${PICO_CODE}
......@@ -125,40 +126,74 @@ cp $CAMELROOT/$CMTCONFIG/FitClassFromPico .
cp $CAMELROOT/batch/awk/genrand.awk .
cp $CAMELROOT/batch/python/changepars.py .
function mini2()
{
#input is a class_par
echo "2 steps MINIMIZATION ********************************"
#build pico par
awk -f toPico.awk \$1 | grep -v "$var" > pico_par
echo "fix $var cosmo $zeval" >> pico_par
echo "*************************************************"
echo "pico init .par:"
cat pico_par
echo "*************************************************"
#PICO RUN
./Minimize pico_par bestfit_pico
echo "PICO BESTFIT="
cat bestfit_pico
cp -f bestfit_pico $OUTDIR/best_fitPico\${SGE_TASK_ID}
echo "*************************************************"
#adjust class_par
python ./changepars.py \$1 bestfit_pico > parfile3
echo "CLASS PAR(pico improved)"
cat parfile3
cp parfile3 $OUTDIR/camelClass\${SGE_TASK_ID}.par
#CLASS RUN
./FitClassFromPico parfile3 bestfit_class
cp -f bestfit_class $OUTDIR/best_fitClass\${SGE_TASK_ID}
}
#
#
#MODIFY input .par according to pico bestfit
grep -v "$var" $file > parfile2
echo "fix $var cosmo $zeval" >> parfile2
python ./changepars.py parfile2 bestfit.pico > parfile_in
echo "***************************************************************"
echo "raw input .par:"
cat parfile_in
echo "***************************************************************"
#radomize it
if [ \${SGE_TASK_ID} -eq 1 ] ; then
cp parfile_in parfile
else
RANDOM=\${SGE_TASK_ID}
awk -v seed=\$RANDOM -f genrand.awk parfile_in > parfile
fi
echo "CLASS .par:"
cat parfile
cp parfile $OUTDIR/camelClass\${SGE_TASK_ID}.par
#CLASS RUN
./FitClassFromPico parfile bestfit_class
cp -f bestfit_class $OUTDIR/best_fitClass\${SGE_TASK_ID}
#now minimize
mini2 parfile
EOBATCH
#####################################################################################################################################
#qsub -P P_planck_prod -t 1-10 -pe openmpi_8 8 -q pa_long camelrun
#qsub -P P_planck_prod -t 1-10 -pe multicores 8 -q mc_long camelrun
picojob="pico_${dirout}_$zeval"
classjob="class_${dirout}_$zeval"
#mc
#qsub -P P_planck_prod -pe multicores 8 -q mc_long -N $picojob bfrun
#qsub -P P_planck_prod -t 1-10 -pe multicores 8 -q mc_long -hold_jid $picojob -N "class_$base" camelrun
#pa
qsub -P P_planck_prod -pe openmpi_8 8 -q pa_long -N "$picojob" bfrun
qsub -P P_planck_prod -t 1-5 -pe openmpi_8 8 -q pa_long -hold_jid "$picojob" -N "$classjob" camelrun
#bestfit
#qsub -P P_planck_prod -q pa_long -pe openmpi_8 8 -N "$picojob" bfrun
qsub -P P_planck_prod -q mc_long -pe multicores 8 -N "$picojob" bfrun
#array job
#qsub -P P_planck_prod -t 1-5 -q pa_long -pe openmpi_8 8 -hold_jid "$picojob" -N "$classjob" camelrun
qsub -P P_planck_prod -t 1-5 -q mc_long -pe multicores 8 -hold_jid "$picojob" -N "$classjob" camelrun
#####################################################################################################################################
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment