-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_experiment.sh
More file actions
29 lines (29 loc) · 1.08 KB
/
random_experiment.sh
File metadata and controls
29 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# shell for the job:
#PBS -S /bin/bash
# job requires at most 10 hours, 0 minutes
# and 0 seconds wallclock time and uses one 8-core node:
#PBS -lwalltime=2:00:00 -lnodes=1
#
# load the required modules
module load python/2.7.2
# cd to the directory where the program is to be called:
cd $HOME/stage/python/
# get the nr of cpu cores
ncores=`cat /proc/cpuinfo | grep bogomips | wc -l`
# run the program
echo starting working on problem $PBS_ARRAYID
(( nprocs = ncores - 1 ))
echo $nprocs
for (( i=1; i<=nprocs; i++ )) ; do
# very important the & at the end, so that they all run in parallel instead of sequential...
echo nr o :$i
python random_experiment.py -n $PBS_ARRAYID-$i $HOME/stage/python/models/random_test $HOME/stage/python/models/4geneWithVarProduction.model &
done
wait
echo ended working on problem $PBS_ARRAYID
#
# notes:
# call this with qsub -t 1-100 random_experiment.sh
# an advantage of using the '-t' flag is that you can kill all the jobs in one command.
# The jobnumbers will be for example 34445-1 34445-2 ... 34445-100.
# The command 'qdel 34445' will remove all these jobs.