# configuration for replica exchange scripts # run simulation: # mkdir output # (cd output; mkdir 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) # mpirun -np 16 -hostfile hostfile $bindir/namd2 +replicas 16 job0.conf +stdout output/%d/job0.%d.log # the number of MPI ranks (-np) must be a multiple of the number of replicas (+replicas) # to continue: # mpirun -np 16 -hostfile hostfile $bindir/namd2 +replicas 16 job1.conf +stdout output/%d/job1.%d.log # increase num_runs below if job completed, or use latest restartXXX.tcl file available # be sure to increment jobX for +stdout option on command line # view in VMD: source job0.conf; source ../show_replicas.vmd # add continued: source job1.conf; source ../show_replicas.vmd # show both: vmd -e load_all.vmd # sort into single-temperature trajectories: # $bindir/sortreplicas output/%s/stretch_alanin.job0 16 10 # $bindir/sortreplicas output/%s/stretch_alanin.job1 16 10 set num_replicas 16 set temperature 300 set steps_per_run 1000 set num_runs 10000 # num_runs should be divisible by runs_per_frame * frames_per_restart set runs_per_frame 10 set frames_per_restart 10 set namd_config_file "alanin_base.namd" set output_root "output/%s/stretch_alanin" ; # directories must exist set input_root "input/alanin.initial.%d" ; # initial configurations # this function returns the center of a biasing potential proc replica_bias { i } { return [list lenpot "centers [expr 17 + $i]"] } # this function returns a list of the neighbors of a replica proc replica_neighbors { i } { global num_replicas if { $i % 2 } { set s -1 } { set s 1 } set result {} foreach { d } { $s -$s } { set j [expr $i + $d] if { $j < 0 || $j >= $num_replicas } { lappend result $i ; # swap with self } { lappend result $j } } return $result } # the following used only by show_replicas.vmd set psf_file "alanin.psf" set initial_pdb_file "alanin.pdb" set fit_pdb_file "alanin.pdb"