Loading restart/restart.py +8 −5 Original line number Diff line number Diff line Loading @@ -10,13 +10,14 @@ def rerun_simulation(restart_data_zipped): seed = restart_data_zipped[0] filepath = restart_data_zipped[1] path_to_simdata_group = restart_data_zipped[2] targetdirectory = restart_data_zipped[3] simulationparameters = mn.datman.get_restart_simdata(filepath,path_to_simdata_group,readpickled=True) #regenerate fitting simulation object #automatic construction based on filename and included documentation simulation = mn.datman.get_restart_simulation_object(filepath, path_to_simdata_group) #restart the simulation; if it needed hidden_parameters (typically Python #restart the simulation; if needed hidden_parameters (typically Python #objects like shared variables for communication between parallel processes) #reinitialize those and provide them here simdata = simulation.restart_simulation(simulationparameters, maximum_runtime=2*85800) Loading @@ -25,8 +26,9 @@ def rerun_simulation(restart_data_zipped): #get a network descriptor from reading the provided file (allows for simple use of the #same function for saving data as beforehand) network_descriptor_dict = mn.datman.get_restart_parameter_documentation(filepath, path_to_simdata_group) for key in network_descriptor_dict.keys(): print("\n",network_descriptor_dict[key]) mn.datman.save_simulation_output(network_descriptor_dict, simdata_dict, simulation.simulationname, simulation.simulationdoc, suffix=str(seed), overwritemode = True, targetdirectory = targetdirectory) print("done with sim of seed", seed) return (network_descriptor_dict, simdata_dict, simulation.simulationname, simulation.simulationdoc) if __name__ == "__main__": Loading @@ -37,10 +39,11 @@ if __name__ == "__main__": for seed in range(1010, 1050): filepath = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_length}/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" targetdirectory = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_length}/" filepath = targetdirectory + f"FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" grouppath_bundle = mn.datman.bundle_all_sub_groups(filepath, ["simulationdata"], flaglist=[["partial", True]]) path_to_simdata_group = grouppath_bundle[0] restart_data_zipped.append([seed, filepath, path_to_simdata_group]) restart_data_zipped.append([seed, filepath, path_to_simdata_group, targetdirectory]) with Pool(50) as p: results = p.map(rerun_simulation, restart_data_zipped) Loading Loading
restart/restart.py +8 −5 Original line number Diff line number Diff line Loading @@ -10,13 +10,14 @@ def rerun_simulation(restart_data_zipped): seed = restart_data_zipped[0] filepath = restart_data_zipped[1] path_to_simdata_group = restart_data_zipped[2] targetdirectory = restart_data_zipped[3] simulationparameters = mn.datman.get_restart_simdata(filepath,path_to_simdata_group,readpickled=True) #regenerate fitting simulation object #automatic construction based on filename and included documentation simulation = mn.datman.get_restart_simulation_object(filepath, path_to_simdata_group) #restart the simulation; if it needed hidden_parameters (typically Python #restart the simulation; if needed hidden_parameters (typically Python #objects like shared variables for communication between parallel processes) #reinitialize those and provide them here simdata = simulation.restart_simulation(simulationparameters, maximum_runtime=2*85800) Loading @@ -25,8 +26,9 @@ def rerun_simulation(restart_data_zipped): #get a network descriptor from reading the provided file (allows for simple use of the #same function for saving data as beforehand) network_descriptor_dict = mn.datman.get_restart_parameter_documentation(filepath, path_to_simdata_group) for key in network_descriptor_dict.keys(): print("\n",network_descriptor_dict[key]) mn.datman.save_simulation_output(network_descriptor_dict, simdata_dict, simulation.simulationname, simulation.simulationdoc, suffix=str(seed), overwritemode = True, targetdirectory = targetdirectory) print("done with sim of seed", seed) return (network_descriptor_dict, simdata_dict, simulation.simulationname, simulation.simulationdoc) if __name__ == "__main__": Loading @@ -37,10 +39,11 @@ if __name__ == "__main__": for seed in range(1010, 1050): filepath = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_length}/FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" targetdirectory = f"/FASTTEMP/p7/lpyka/hierarchical_interface/5_precracked/a_{crack_length}/" filepath = targetdirectory + f"FDB_PARSOL_SIRC-FCVC_SOG-IVCG_HFBA_CPC-NIC_-_{seed}.h5" grouppath_bundle = mn.datman.bundle_all_sub_groups(filepath, ["simulationdata"], flaglist=[["partial", True]]) path_to_simdata_group = grouppath_bundle[0] restart_data_zipped.append([seed, filepath, path_to_simdata_group]) restart_data_zipped.append([seed, filepath, path_to_simdata_group, targetdirectory]) with Pool(50) as p: results = p.map(rerun_simulation, restart_data_zipped) Loading