Commit 36a94e63 authored by Matthieu Tristram's avatar Matthieu Tristram
Browse files

Merge branch 'master' of https://gitlab.in2p3.fr/cosmotools/CAMEL

Conflicts:
	cmt/requirements-icc
parents c4e81efd 5c880e4b
...@@ -5,6 +5,7 @@ use class * ...@@ -5,6 +5,7 @@ use class *
#compiler options #compiler options
macro cpp "icpc" macro cpp "icpc"
macro cppflags " -O2 -ip -ansi_alias -align -Wbrief -Wdeprecated -Wuninitialized -align -Wbrief -Wunused-function -Wpointer-arith -Wreturn-type" macro cppflags " -O2 -ip -ansi_alias -align -Wbrief -Wdeprecated -Wuninitialized -align -Wbrief -Wunused-function -Wpointer-arith -Wreturn-type"
macro_append cppflags " -g "
#CAMEL includes #CAMEL includes
include_dirs " $(CAMELROOT)/src" include_dirs " $(CAMELROOT)/src"
...@@ -27,6 +28,8 @@ application test_jla -group=test -s=$(CAMELROOT)/src/camel test/test_jla.cc ...@@ -27,6 +28,8 @@ application test_jla -group=test -s=$(CAMELROOT)/src/camel test/test_jla.cc
#include_dirs "$(CLIKDIR)/include" #include_dirs "$(CLIKDIR)/include"
#macro_append CAMEL_linkopts " -L$(CLIKDIR)/lib -lcfitsio " #macro_append CAMEL_linkopts " -L$(CLIKDIR)/lib -lcfitsio "
#include_dirs "$(CFITSIODIR)/include"
#macro_append CAMEL_linkopts " -L$(CFITSIODIR)/lib -lcfitsio "
include_dirs "/usr/include/cfitsio" include_dirs "/usr/include/cfitsio"
macro_append CAMEL_linkopts " -lcfitsio " macro_append CAMEL_linkopts " -lcfitsio "
#PLANCK #PLANCK
......
#!/bin/bash
#script to embed Minimize executable in batch at cc-in2p3
#optionally you can pecify a range for runs with different starting points (as "1-5" for 5 points)
#arguments
nargs=$#
if ! [ $nargs -eq 1 -o $nargs -eq 2 ]; then
echo "usage: Minimize.sh parFile (range) "
echo "the optional \"range\" parameter can be used to specify different starting points "
echo "It must be given in the form: begin-end (eg. 1-5 for jobs 1 to 5)"
echo "Job 1 corresponding to not changing the parFile starting values, while other values"
echo "will send jobs shuffling the parameters randomly within the min-max bounds of the parFile"
exit
fi
parFile=$1
range="1-1"
if [ $# -eq 2 ] ; then
range=$2
fi
#default is running on 8 cores.
#if you wish to change it, set the environment variable NCORES to another value.
if [ -z "$NCORES" ] ; then
NCORES=8
fi
##some checks
if [ -z "${CAMELROOT}" ] ; then
echo "CAMELROOT undefined: did you sourced camel_setup.sh?"
exit
fi
if [ -z "$CLIKDIR" ] ; then
echo "miss CLIKDIR"
fi
if ! [ -f $CAMELROOT/$CMTCONFIG/Minimize ] ; then
echo "missing Minimize executable: rum make exec in cmt/"
fi
file=$(readlink -e $parFile)
if [ ! -f "$file" ] ; then
echo "no parfile=$file"
exit
fi
parbase=$(basename $file)
dirout=${parbase%".par"}_"min"
OUTDIR=$PWD/$dirout
if [ -d "$dirout" ] ; then
echo "Output directory $dirout already exists: still want to run? (y/n)"
read answer
if [ $answer != 'y' ] ; then
echo "exiting"
exit 1
fi
else
mkdir $dirout
fi
#
cd $OUTDIR
###################################################
cat > camelrun <<EOBATCH
#!/bin/bash
cd \$TMPDIR
uname -a
echo "NSLOTS=\$NSLOTS"
source /sps/lsst/Library/CMT/v1r26/mgr/setup.sh
#mes compilos
source /usr/local/shared/bin/gcc_env.sh 5.2.0
COMPILERVARS_ARCHITECTURE=intel64
COMPILERVARS_PLATFORM=linux
source /usr/local/intel/icc/bin/iccvars.sh
gcc --version | grep gcc
icc --version | grep icc
# copies localeS
cp $CAMELROOT/\$CMTCONFIG/Minimize .
cp $CAMELROOT/work/tools/awk/genrand.awk .
#
#input file
# enleve lo:w-l
cp $file parfile_in
echo "init par:"
cat parfile_in
#================================
#randomize si id ne 1
#================================
echo "***************************************************************"
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
cp parfile $OUTDIR/camel\${SGE_TASK_ID}.par
echo "***************************************************************"
#================================
# Camel run
#================================
export PYTHONPATH="${PICO_CODE}"
export OMP_NUM_THREADS=$NCORES
./Minimize parfile bestfit covmat
cp -f bestfit $OUTDIR/best_fit\${SGE_TASK_ID}
cp -f covmat $OUTDIR/covmat\${SGE_TASK_ID}.dat
EOBATCH
##############################################################################################
if [ -z "${QSUB_CMD}" ] ; then
QSUB_CMD="qsub -P P_$GROUP -pe multicores $NCORES -q mc_long -R y -j y -l sps=1,os=\"sl6|cl7\""
fi
jobsub="${QSUB_CMD} -o $PWD -N $(basename $dirout) -t $range camelrun"
echo "about to run : $jobsub"
echo "OK? [y/n]"
read answer
if [ $answer != 'y' ] ; then
echo "exiting"
exit 1
fi
eval $jobsub
echo ">>>> Ouptuts in: $OUTDIR"
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