#!/bin/bash # Georges Kunstler 14/05/2014 # read one variable export LD_LIBRARY_PATH=/usr/lib64/R/library mkdir -p trait.workshop iter=50000 warmup=5000 thin=50 # test parameter nbargs=$# echo "number of arguments="$nbargs if [ $nbargs -ne 1 ] then echo "need one and only one argument" echo " usage :" echo " ./launch_all_lmer.sh sample.size" exit 100 fi samplesize=$1 # for trait in "'SLA'" "'Wood.density'" "'Max.height'" "'Seed.mass'" "'Leaf.N'"; do echo "/usr/local/R/R-3.1.1/bin/Rscript -e \"source('R/analysis/jags.run.R'); run.multiple.model.for.set.one.trait(c(model.files.jags.Tf.1), run.jags,$trait,type.filling='species', sample.size = $samplesize, var.sample = 'ecocode.id',iter = $iter, warmup = $warmup, chains = 3, thin = $thin, init.TF = TRUE);print('done')\"" > trait.workshop/speciesjags${trait}.sh qsub trait.workshop/speciesjags${trait}.sh -l nodes=1:ppn=1,mem=8gb -N "jags${trait}" -q opt32G -j oe done