#==============================================================================#
#                 SCRIPT FOR BIAS-EXCHANGE SIMULATIONS                         #
#                 compatible with Plumed 1.3                                   #
#                                                                              #
#                 version 1.0 - 7 Nov 2011                                     #
#                 Fabio Pietrucci  (fabio.pietrucci@gmail.com)                 #
#                 Katsumasa Kamiya (kka2masa@gmail.com)                        #
#                                                                              #
#  HOW TO USE: (see also the Plumed 1.3 manual and directory "example")        #
#                                                                              #
#  1) compile exchange-tool.f90 with the command "make"                        #
#     (modify the Makefile if necessary)                                       #
#                                                                              #
#  2) modify the 4 variables at the beginning of the script bias-exchange.sh   #
#     to suit your setup                                                       #
#                                                                              #
#  3) create NWALKER directories called walker1, walker2, etc.                 #
#                                                                              #
#  4) in each walker-directory prepare all the necessary input for             #
#     a Plumed simulation on one replica, including the command                #
#     HILLS_LABEL [label_for_this_walker]                                      #
#     into the Plumed input file                                               #
#                                                                              #
#  5) in each walker-directory start the simulation,                           #
#     using an executable script called run-walker.sh of this form:            #
#                                                                              #
#       [command to run MD+Plumed, not in background]                          #
#       touch READY                                                            #
#       ../bias-exchange.sh &                                                  #
#                                                                              #
#  6) at this point, all walkers are running: when they will all               #
#     have finished, the present script will take care of                      #
#     performing bias exchanges and re-launching the simulation                #
#     for each walker using the corresponding run-walker.sh script;            #
#     details will be written in bias-exchange.log                             #
#                                                                              #
#==============================================================================#
