User Tools

Site Tools


exercises:2017_ethz_mmm:replica_2017

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
exercises:2017_ethz_mmm:replica_2017 [2017/05/10 15:11] dpasseroneexercises:2017_ethz_mmm:replica_2017 [2017/05/11 08:05] dpasserone
Line 159: Line 159:
 **Example**. Processor 0 starts with temperature T0=2 K, processor 1 with temperature T1=2.44 K.  **Example**. Processor 0 starts with temperature T0=2 K, processor 1 with temperature T1=2.44 K. 
 After 1000 steps, an exchange step is attempted and accepted with some probability (see theory slides, and also the paper  After 1000 steps, an exchange step is attempted and accepted with some probability (see theory slides, and also the paper 
-doi::10.1063/1.481671  +[[doi>10.1063/1.481671]]. After the exchange move, the temperature of processor 0 is 2.44 and the one of processor 1 is 2 K.  
-</note> +But you can see it also as the **configurations** of T0=2 K and the one of T1=2.44 K are changing, thus improving the sampling at both temperature. 
 + </note>  
 + 
 +The script ''01_adapt_files'' performs the following operations: 
 + 
 +<note tip> 
 +  - prunes the ''log.lammps'' file which contains a log of all exchanges between the replicas. Take only the steps for which we also have a dump of the atomic coordinates. 
 +  - For all the ''log.lammps.*'' files from each replica take only the lines for which we also have a dump of the atomic coordinates. These lines are put in a file *.nxyz, one for each replica. Each line contains temperatures, potential energies, etc. 
 +  - Compute the **q4** order parameter for all structure files and create ''*.q4'' files, one for each replica. 
 +  - now paste the ''*.nxyz'' and the ''*.q4'' files into a file ''t_epot_q4_etot.*.out'' containing the dump of temperature, energy, q4 every 10000 steps. 
 +</note> 
 + 
 + 
 +===== Reordering the replica: one temperature, one files ===== 
 + 
 +At this point, we have a set of ''t_ene_q4_etot.*.out'', one for each replica (processor). But along each of these files, the temperatures change a lot due to the exchanges. So, we use the file ''exchanges_nxyz.log'' that keeps track of the exchanges, and tells us at a given timestep which replica has which temperature: we scramble the ''t_ene_q4_etot.*.out'' files, and at the end we will have one file for each temperature. This is accomplished by the script ''02_reorder''.  
 + 
 +<note tip> 
 +  * Consider each file t_epot_q4_etot.*.out (processor by processor). Say you consider the number 5 (6th replica): ''t_epot_q4_etot.5.out''
 +  * At the step 50000, the file shows the following line: 
 +''50000 6.7133746 -1.7636174 0.189 -1.7315099'' 
 + 
 +indicating a temperature of 6.7133746.  
 +  * The file ''exchanges_nxyz.log'', at the step 50000, gives us the following line: 
 +''50000 7 0 3 2 1 6 10 5 12 8 11 4 9 13 15 14'' 
 + 
 +indicating that at the 6th replica (column **7**), we have the temperature **6**, which is (see input file) T=6.63 K. Meaning that at step 50000, the thermostat is keeping replica 5 around the temperature T=6.63 K. 
 +  * This means that this line has to be stored in the temperature file number **6**.  
 +</note> 
 + 
 +At the end of the procedure performed by the small script section: 
 +<code bash> 
 +NP=16 
 +NP1=$[NP-1] 
 +rm torder* 
 +for repl in `seq 0 $NP1` 
 +do 
 +   echo $repl 
 +   awk -v rep=$repl '{r2=rep+2;print $r2}'  < exchanges_nxyz.log  > rep_$repl 
 +   i=0 
 +   for a in `cat rep_$repl` 
 +   do 
 +        i=$[i+1] 
 +        head -$i t_epot_q4_etot.$repl.out | tail -1  >> torder.$a 
 +   done 
 +done 
 +</code>
  
exercises/2017_ethz_mmm/replica_2017.txt · Last modified: 2020/08/21 10:15 by 127.0.0.1