Re: REMD exchange ratios

From: Jim Phillips (jim_at_ks.uiuc.edu)
Date: Fri Jun 17 2011 - 12:43:19 CDT

You can trivially modify lib/replica/replica_exchange.tcl to print this
data more often. Just change the end of the file from this:

...
     set old_restart_root $restart_root
   }
}

for {set i 0} {$i < $num_replicas} {incr i} {
   set attempts $sorted_data($i.exchanges_attempted)
   if $attempts {
     set i2 [expr $i + 1]
     set temp $sorted_data($i.temperature)
     set temp2 $sorted_data($i2.temperature)
     set accepts $sorted_data($i.exchanges_accepted)
     set ratio [expr 1.0*$accepts/$attempts]
     puts "EXCHANGE_RATIO $temp $temp2 $accepts $attempts $ratio"
   }
}

replica_eval exit {exit}

to something like this (untested):

     set old_restart_root $restart_root
   }

   if { $i_run % $runs_per_ratio == 0 || $i_run == $num_runs } {
     for {set i 0} {$i < $num_replicas} {incr i} {
       set attempts $sorted_data($i.exchanges_attempted)
       if $attempts {
         set i2 [expr $i + 1]
         set temp $sorted_data($i.temperature)
         set temp2 $sorted_data($i2.temperature)
         set accepts $sorted_data($i.exchanges_accepted)
         set ratio [expr 1.0*$accepts/$attempts]
         puts "EXCHANGE_RATIO $temp $temp2 $accepts $attempts $ratio"
       }
     }
   }
}

replica_eval exit {exit}

and set $runs_per_ratio in your replica master conf file. That will give
you the cumulative ratio since the start of the job. If you want the
acceptance ratio since the previous output you'll need to zero out
$sorted_data($i.exchanges_attempted) and
$sorted_data($i.exchanges_accepted) each time you output the ratios.

You could also write the data to a separate file so you don't have to look
in the log file for it. Using Tcl's built-in webserver to stream this
data to your smartphone is left as an exercise to the user. ;-)

-Jim

On Fri, 17 Jun 2011, Massimiliano Porrini wrote:

> Dear all,
>
> Is there any way to have a look at the exchange ratios between replica
> in a REMD simulation while
> it is running?
>
> I could notice that only at the end of the simulation NAMD outputs the
> exchange ratios, but
> I would like to check them "on the fly".
> Thanks in advance.
>
> Cheers,
> MP
>
>
> --
> Dr Massimiliano Porrini
> Institute for Condensed Matter and Complex Systems
> School of Physics & Astronomy
> The University of Edinburgh
> James Clerk Maxwell Building
> The King's Buildings
> Mayfield Road
> Edinburgh EH9 3JZ
>
> Tel +44-(0)131-650-5229
>
> E-mails : M.Porrini_at_ed.ac.uk
>              mozz76_at_gmail.com
>              maxp_at_iesl.forth.gr
>

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 05:24:07 CST