Re: RANDOMIZ WHAT(2) field and the effect on rfluka "chained" samples

From: Santana, Mario <msantana_at_slac.stanford.edu>
Date: Thu, 17 Jan 2013 09:41:59 -0800

Hi Razvan,

Yes, if you are willing to run parallel jobs you should not have the same RANDOMIZ WHAT(2) card in each of them, otherwise each of the jobs (and each sequence if you run more than one job in series) will be identical.

I copy below a bash script that you could use to send parallel jobs. This is just an example, there are several ways to do it and you may choose to make seed numbers more different to one another (although randomization should be fine even if each seed differs by one unit, as in the example).

You will have to edit the submittal card (bsug -q …) to match the syntax and instructions compatible with your cluster or computer system.

Mario

#!/bin/bash
echo "auto.sh input_file_name(no .inp suffix) first_random last_random"
#
file=`echo $1 | sed 's/\.inp//'`
i=$2
while [ $i -le $3 ]
do
  if [ $i -le 9 ]
  then
   sed "s/\(RANDOMIZ[ ]*1.0[ ]*\)1/\1$i/" $file.inp > $file.$i.inp
  elif [ $i -le 99 ]
  then
   sed "s/\(RANDOMIZ[ ]*1.0[ ]*\) 1/\1$i/" $file.inp > $file.$i.inp
  elif [ $i -le 999 ]
  then
   sed "s/\(RANDOMIZ[ ]*1.0[ ]*\) 1/\1$i/" $file.inp > $file.$i.inp
  elif [ $i -le 9999 ]
  then
   sed "s/\(RANDOMIZ[ ]*1.0[ ]*\) 1/\1$i/" $file.inp > $file.$i.inp
  elif [ $i -le 99999 ]
  then
   sed "s/\(RANDOMIZ[ ]*1.0[ ]*\) 1/\1$i/" $file.inp > $file.$i.inp
  fi
  bsub -q xxl rfluka -e ./flukahp -N 0 -M 1 $file.$i
  i=`expr $i + 1`
done

On Jan 14, 2013, at 2:09 PM, Popescu, Razvan wrote:

Hi,

Is there a way to run a multiple sample calculation, driven for example by something like “rfluka –M5 <inputfile>”, but with an externally given random seed (by RANDOMIZ WHAT(2) field)…?
I’m trying to schedule parallel runs on a computing cluster, dispatching each with a different RANDOMIZ card, but would like to have each job calculate 5-10 samples instead of only one. It appears that the presence of the RANDOMIZ card overrides the random seed with the same value, at the beginning of each cycle, nullifying the neat propagation of rand seed from a cycle to the next, done in rfluka…

Am I mistaken?
Is there a way to override the default random seed just at the beginning of cycle 1…?

Thanks,
Razvan
Received on Thu Jan 17 2013 - 22:08:21 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 17 2013 - 22:08:35 CET