@@ -139,6 +139,8 @@ def main():
139139 if REXEE .fixed_weights is not True and os .path .isfile (args .equil ) is True :
140140 REXEE .equil = np .load (args .equil )
141141 print (f'equil: { REXEE .equil } ' )
142+ if REXEE .proposal == 'random_range' and os .path .isfile ('track_swap_frame.npy' ):
143+ REXEE .track_swap_frame = np .load ('track_swap_frame.npy' )
142144 else :
143145 start_idx = None
144146
@@ -268,6 +270,16 @@ def main():
268270 # In run_REXEE(i, swap_pattern), where the tpr files will be generated, we use the top file at the
269271 # level of the simulation (the file that will be shared by all simulations). For the gro file, we
270272 # pass swap_pattern to the function to figure it out internally.
273+
274+ if REXEE .proposal == 'random_range' :
275+ # 3-5. Keep track of the frames used for swapping in each trajectory
276+ track_frame = np .full (REXEE .n_sim , - 1 )
277+ for s in range (len (swap_list )):
278+ swap = swap_list [s ]
279+ track_frame [swap [0 ]] = swap_index [s ][0 ]
280+ track_frame [swap [1 ]] = swap_index [s ][1 ]
281+ REXEE .track_swap_frame .append (track_frame )
282+ print (track_frame )
271283 else :
272284 swap_pattern , swap_list = None , None
273285
@@ -343,6 +355,8 @@ def main():
343355 np .save (args .ckpt , REXEE .rep_trajs )
344356 if REXEE .fixed_weights is not True :
345357 np .save (args .equil , REXEE .equil )
358+ if REXEE .proposal == 'random_range' :
359+ np .save ('track_swap_frame.npy' , REXEE .track_swap_frame )
346360
347361 # Save the npy files at the end of the simulation anyway.
348362 if rank == 0 :
0 commit comments