Re: Running multiple walker metadynamics on Stampede2

From: Giacomo Fiorin (
Date: Tue Dec 10 2019 - 12:01:12 CST

Hi Sebastian, you can use namd2 +replicas as you would for a
replica-exchange umbrella sampling run. If you are able to run that
example on Stampede (with some modification) for metadynamics with multiple
replicas you will use nearly the same NAMD command line.

The only difference is that metadynamics currently uses files to
communicate the Gaussians between replicas, so each replica won't know
their index number and you have to tell them using the replicaID keyword
(whose value can be a number or a string). (Note: the multiple-walkers
metadynamics code actually predates the replica-exchange code in NAMD.)
However, similarly to REUS you can use a single configuration file for the
variable and add the metadynamics configuration string in the NAMD script
including the myReplica command:
cv config "
metadynamics {
  multipleReplicas on
  replicasRegistry /shared-folder/mymtd-replicas.txt
  replicaID [myReplica]

In the most recent version of Colvars, this last step is automated by
getting the replica index number internally, so you don't even have to use
This change is not yet in the NAMD nightly build (first, the NAMD devs need
to approve other pending changes).


On Wed, Dec 4, 2019 at 10:46 PM Sebastian S <> wrote:

> Hi Josh,
> Thanks for your reply! I was actually wondering if there is something that
> sends all the jobs to run at the same time, similar to the one for
> replica exchange umbrella sampling presented here
> Regards,
> Sebastian
> On Tue, Dec 3, 2019 at 12:15 PM Vermaas, Joshua <>
> wrote:
>> Hi Sebastian,
>> I think
>> has
>> what you need. The usual ibrun command for NAMD would have one extra flag
>> to specify the offset (the -o argument), which would be used to make sure
>> that each instance of NAMD has its own distinct set of cores.
>> -Josh
>> On 2019-12-02 21:50:09-07:00 wrote:
>> Hi everyone,
>> I will be trying to run some multiple walker metadynamics simulations on
>> Stampede2 and wanted to know if there's an easy way of doing this.
>> I'm already able to run these simulations on my local cluster by using an
>> sh script (see below) but have no idea of how to do it on Stampede. Any
>> help would be appreciated!
>> As an example, let's say I want to run 24 replicas with namd files
>> testres.rep1.namd to testres.tep24.namd.
>> Since now thanks,
>> Sebastian
>> #!/bin/bash
>> #$ -pe mpi-24 576 # Specify parallel environment and legal core size
>> TASK=0
>> rm -f ./hostfile
>> cat $PE_HOSTFILE | while read -r line; do
>> host=`echo $line|cut -f1 -d" "|cut -f1 -d"."`
>> echo $host >> hostfile
>> done
>> hostfile="./hostfile"
>> while IFS= read -r host
>> do
>> let "TASK+=1"
>> /usr/kerberos/bin/rsh -F $host -n "uname -a; echo $TASK; cd XXX; pwd;
>> module load namd; mpirun -np 24 namd2 testres.rep$TASK.namd >
>> s$TASK.0.log ; exit" &
>> sleep 20
>> done < $hostfile
>> wait
>> rm ./hostfile

Giacomo Fiorin
Associate Professor of Research, Temple University, Philadelphia, PA
Research collaborator, National Institutes of Health, Bethesda, MD

This archive was generated by hypermail 2.1.6 : Thu Dec 31 2020 - 23:17:12 CST