On Wed, Sep 30, 2015 at 4:14 PM, Christina Berti <cberti.purdue.edu> wrote:
> My reason for looking into pbsa.mpi is to save time. I have to perform
> pbsa calculations on structures listed in a for loop; ideally, I'd like
> these for loop iterations to be divided over CPUs. I've tried rewriting my
> script to run over the iterations in parallel, but it is not successful
> (processes are killed randomly), even though my number of iterations is
> less than my number of available CPUs.
Maybe you are running out of memory. But I agree with Dave -- you are
better off parallelizing over frames than parallelizing *within* PBSA.
>
> I'm just trying to rule out all my options. Thank you.
You can use xargs to parallelize jobs in a shell script. For example,
suppose you want to run 10 independent simulations in parallel with the
following command-lines:
pbsa -O -i pbsa.in -o pbsa1.out -p prmtop1 -c inpcrd1
pbsa -O -i pbsa.in -o pbsa2.out -p prmtop2 -c inpcrd2
...
You can do something like the following:
python -c "print(' '.join(['-o pbsa%d.out -p prmtop%d -c inpcrd%d' % (i,
i, i) for i in range(1, 11)]))" | xargs -n 6 -P 4 pbsa -O -i pbsa.in
The -n tells xargs to apply 6 arguments from stdin to each process, and the
-P 4 tells xargs to run up to 4 concurrent jobs. It's a feature of xargs
that I think few people are aware of or use on a regular basis, but it's
pretty cool. The upside of this is that it makes optimal use of CPUs -- it
starts a new job as soon as one of the previous ones finishes, and makes
sure that only the requested number of jobs ever runs at one time. A lot
better for many things than the idiom
pbsa -O -i ... &
pbsa -O -i ... &
pbsa -O -i ... &
wait
pbsa -O -i ... &
pbsa -O -i ... &
pbsa -O -i ... &
wait
and so on.
HTH,
Jason
--
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Sep 30 2015 - 15:30:03 PDT