PROFASI  Version 1.5
Tutorial 4: Replica-exchange or parallel tempering MC simulations

Parallel tempering or replica exchange method is one of the most commonly used Monte Carlo methods today. In this method, several copies, or replicas of the system are simulated simultaneously at different temperatures, and occasionally, the configurations (or equivalently the temperatures) are swapped between runs at adjacent temperatures with a probability. This probability is a function of the energies and temperatures of the two runs undergoing the exchange. Seen from the point of view of one replica as it goes through different temperatures, parallel tempering resembles simulated tempering.

In PROFASI, the implementation of parallel tempering is done using MPICH2, and so, you need to run this tutorial on a system which has MPICH2. It is not necessary that you go to a cluster. For testing purposes, one can install MPICH2 even on single processor PCs, and that would suffice for this tutorial. So, to run the same simulation as

prompt> mpirun -np 4 $profasi_dir/bin/ParTempRun.mex -ac 1 "*KLVFFAE*"\
 -tmin "274 Kelvin" -tmax "374 Kelvin" -ncyc 10000 \n\n

This starts parallel tempering runs with 4 replicas with temperatures distributed in a geometric series between 274 and 374 Kelvin. Notice that we did not need an ntmp option, as that can be inferred from the number of runs. This run will create 4 output directories, n0, n1, n2 and n3, containing output from different replicas. The run-time history files in those directories will show that each replica indeed travels across the different temperatures.

The averages file in each of the output directory contains averages of each of the measurements as a function of temperature index, for that run. It is now very easy to make data files with averages of all the variables vs temperature for plotting:

$profasi_dir/bin/find_avg.pl

This detects and parses all the averages files in all the output directories, finds out what measurements are stored in there, and makes separate files for them, such as "Etot.avg" etc. In those files, apart from the temperature indices, there will be the actual temperature values in model units and Kelvin, the inverse temperature values (beta), and the statistics for the measurement. There will be columns in the ".avg" files for the mean of local-means (n0, n1, n2 etc. ), standard deviation of the local-means, etc. The first line in each of those files is a comment on what is printed in various columns.

Parallel tempering needs very little pre-run preparation. There are no special system dependent parameters to be determined by iteration to self-consistency as for instance in simulated tempering. But, although it may not be too apparent in this run, parallel tempering in PROFASI runs somewhat slower than simulated tempering. This is because, the different replicas in parallel tempering must be kept in sync, so that the run can proceed at most at the speed of the slowest replica. In PROFASI, because of the aggressive optimisation of the energy calculations, the lower temperatures (typically featuring more compact structures) run much slower than the high temperatures. So, parallel tempering runs as fast as the lowest temperature run with most compact structures does. Simulated tempering on the other hand runs at about the average speed across all temperatures, as all runs are independent. It is therefore not a forgone conclusion that one should always use parallel tempering. PROFASI provides both, so that the users can make their own choice.

Note that the simple geometric distribution of the temperatures (constant ratio between adjacent temperatures) is not the best choice for parallel tempering. Optimizing the temperature distribution for rapid thermalisation of the system is an active area of research. The ParTempRun program can be asked to use a temperature distribution you have calculated by other means. Just put the values in a file (specified with the "tfile" option) in a single column. Like in the case of simulated annealing schema files, you can put a line "#temperature inverted" or "#temperature Kelvin" to change the interpretation of the values in that file as beta values or temperature values in Kelvin. The values in the file will be sorted as required.

Users of PROFASI v. 1.0 should note that the parallel tempering program no longer looks for a "beta.dat" file by default. Even if such a file is present, it is not used by default, unless that is what is asked for in the settings file, or on the command line, through the "tfile" option.

The following is an example of a temperature distribution file for the above run:

#temperature Kelvin
500
400
300
200

You can force the program to use this temperature distribution (saved as, e.g. "temps.dat"), by

prompt> mpirun -np 4 $profasi_dir/bin/ParTempRun.mex -s "*KLVFFAE*" \ -ncyc 10000 -lcyc -1 -b 45 -tf temps.dat

You can skip the command line options if you use a settings file. If you use command line options in addition to a settings file, the command line has preference in case of a conflict. Good luck!


PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2