Commit 5ab7128c authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

also cleaning multiprof2

parent 09944eba
......@@ -24,12 +24,13 @@ fi
##############define the scanned variable###############
# define the variable/values that is scanned
var="log(10^10A_s)"
#var="log(10^10A_s)"
var="100*theta_s"
#values : methods 1 specify number of points N and boudaries [xmin,xmax]
N=50
xmin=2.9
xmax=3.2
N=8
xmin=1.0423
xmax=1.0430
#compute
for ((i=0;i<N;i++)) ; do
val[$i]=$(echo | awk -v xmin=$xmin -v xmax=$xmax -v N=$N -v i=$i 'BEGIN{step=(xmax-xmin)/(N-1)} {printf("%f",xmin+(i)*step)}')
......
#!/bin/bash
EXPECTED_ARGS=2
if [ $# -ne $EXPECTED_ARGS ]
then
echo ">>>> Usage: `basename $0` parfile range"
echo " runing batch arrays with serveral starting points ***with PICO initalisation***"
echo "DO NOT USE IF SOME VARIABLES ARE NOT SUPPORTED"
echo "range should be specified as an interval in the form: I-J (as \"1-3\")"
echo "which corresponds to each array-job interval (ie. starting points)"
echo "parfile values are not shuffled (randomly) for job 1"
exit 1
fi
range=$2
if [ -z "${CAMELROOT}" ] ; then
echo "CAMELROOT undefined"
exit
fi
file=$(readlink -e $1)
parbase=$(basename $file)
dirout=${parbase%".par"}_mprof_"${var}"
if [ ! -f "$file" ] ; then
echo "mssing $file"
exit
fi
####################DEFINE VARIABLE##################################
var=Alens
#values through array
N=20
xmin=0.9
xmax=1.5
......@@ -9,7 +41,7 @@ for ((i=0;i<N;i++)) ; do
val[$i]=$(echo | awk -v xmin=$xmin -v xmax=$xmax -v N=$N -v i=$i 'BEGIN{step=(xmax-xmin)/(N-1)} {printf("%f",xmin+(i)*step)}')
done
#or given as constants
#var=tau_reio
#val=(0.025 0.035 0.045 0.055 0.065 0.075 0.085 0.095)
#val=(0.01 0.02 0.025 0.03 0.035 0.04 0.045 0.05 0.055 0.06 0.065 0.07 0.075 0.08 0.085 0.09 0.095 0.10 0.12)
......@@ -20,22 +52,26 @@ done
#val[$i]=$(echo | awk -v xmin=$xmin -v xmax=$xmax -v N=$N -v i=$i 'BEGIN{step=(xmax-xmin)/(N-1)} {printf("%f",xmin+(i)*step)}')
#done
###########################################################################
echo "Scannning variable $var"
echo "values=${val[*]}"
file=$(readlink -e $1)
parbase=$(basename $file)
dirout=${parbase%".par"}_mprof_"${var}"
if [ -z "${CAMELROOT}" ] ; then
echo "CAMELROOT undefined"
exit
#fix number of cores for openMP
NCORE=8
#default QSUB command (if not overriden by user)
if [ -z "${QSUB_CMD}" ] ; then
QSUB_CMD="qsub -P P_$GROUP -pe multicores $NCORE -q mc_long -R y -j y -l sps=1"
fi
echo "QSUB command will be: ${QSUB_CMD} -t $range"
if [ ! -f "$file" ] ; then
echo "mssing $file"
exit
echo "Is this OK? [y/n]"
read answer
if [ $answer != 'y' ] ; then
echo "exiting"
exit 1
fi
if [ -d "$dirout" ] ; then
echo "directory $dirout exists: still want to run? (o/n)"
read answer
......@@ -78,13 +114,13 @@ export PYTHONPATH=${PICO_CODE}
# copies localeS
cp $CAMELROOT/$CMTCONFIG/Minimize .
cp $CAMELROOT/$CMTCONFIG/FitClassFromPico .
cp $CAMELROOT/batch/awk/genrand.awk .
cp $CAMELROOT/batch/awk/toPico.awk .
cp $CAMELROOT/batch/python/changepars.py .
cp $CAMELROOT/work/tools/awk/genrand.awk .
cp $CAMELROOT/work/tools/awk/toPico.awk .
cp $CAMELROOT/work/tools/python/changepars.py .
#
#input file -> transforme en pico et enleve var
awk -f toPico.awk $file | grep -v "$var" > parfile_in
awk -f toPico.awk $file | grep -v "${var/\*/\\*}" > parfile_in
#compute var
echo "fix $var cosmo $zeval" >> parfile_in
......@@ -132,8 +168,9 @@ cp -f bestfit_class "$OUTDIR"/best_fitClass\${SGE_TASK_ID}
EOBATCH
#####################################################################################################################################
qsub -P P_planck_prod -t 1-5 -pe openmpi_8 8 -q pa_long camelrun
qsub -P P_planck_prod -t 6-10 -pe multicores 8 -q mc_long camelrun
#####################################################################################################################################
######################################################################
#submit an array job for this scanned value
jobsub="${QSUB_CMD} -t \"$range\" camelrun_$zeval"
eval $jobsub
######################################################################
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