Commit 3f388cca authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

do not need this one anymore

parent fc2a00eb
EXPECTED_ARGS=5
parFile=$1
var=$2
xmin=$3
xmax=$4
N=$5
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` parfile var xmin xmax N"
exit 1
fi
if [ -z "${CAMELROOT}" ] ; then
echo "CAMELROOT undefined"
exit
fi
if [ -z "$CLIKDIR" ] ; then
echo "miss CLIKDIR"
exit
fi
#parfile et creation dossier associe
cd `dirname $1`
dirpar=$PWD
cd -
parbase=`basename $1`
file=$dirpar/$parbase
if [ ! -f "$file" ] ; then
echo "mssing par $file"
exit
fi
dirout=${parbase%".par"}_prof_$2
if [ -d "$dirout" ] ; then
echo "directory $dirout exists: still want to run? (o/n)"
read answer
if [ $answer != 'o' ] ; then
echo "exiting"
exit 1
fi
fi
mkdir $dirout
cd $dirout
OUTDIR=$PWD
# boucle jobs
for ((i=1;i<=N;i++))
do
val=$(echo | awk -v xmin=$xmin -v xmax=$xmax -v N=$N -v i=$i 'BEGIN{step=(xmax-xmin)/(N-1)} {printf("%f",xmin+(i-1)*step)}')
echo "$var=$val"
###################################################
cat > camelrun <<EOBATCH
#!/bin/bash
#$ -l os=sl6
#$ -R y
#$ -j y
#$ -o $PWD
#$ -e $PWD
cd \$TMPDIR
# copies localeS
cp $CAMELROOT/$CMTCONFIG/Minimize .
#
grep -v $var $file > parfile
#compute var
echo "fix $var cosmo $val" >> parfile
cp parfile $OUTDIR/camel.par$val
export PYTHONPATH=${PICO_CODE}
./Minimize parfile bestfit
cp bestfit $OUTDIR/best_fit$val
qstat -j \${JOB_ID} -nenv
EOBATCH
#NPROC=1
#sed -i "s/NPROC/$NPROC/g" camelrun
#qsub -N $dirout-$val -l vmem=16G camelrun
#ou
NPROC=8
sed -i "s/NPROC/$NPROC/g" camelrun
qsub -pe openmpi_8 8 -q pa_long -N $dirout-$val camelrun
#qsub -pe multicores 8 -q mc_long -l -N $dirout-$val 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