Loading src/scripts/model_maker.py +18 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,16 @@ def load_model(model_file): } gconf['use_refinement'] = use_refinement gconf['dyn_orders'] = dyn_orders gconf['max_host_ram_gb'] = 0 try: gconf['max_host_ram_gb'] = float(model['system_settings']['max_host_ram']) except KeyError as ex: print("WARNING: no host RAM declared. Cannot estimate recommended execution.") gconf['max_gpu_ram_gb'] = 0 try: gconf['max_gpu_ram_gb'] = float(model['system_settings']['max_gpu_ram']) except KeyError as ex: print("WARNING: no GPU RAM declared.") gconf['nsph'] = sconf['nsph'] gconf['application'] = model['particle_settings']['application'] gconf['li'] = int(model['geometry_settings']['li']) Loading Loading @@ -1016,6 +1026,14 @@ def write_legacy_gconf(conf): else: str_line = "USE_DYN_ORDERS=0\n" output.write(str_line) max_host_ram_gb = conf['max_host_ram_gb'] if (max_host_ram_gb > 0.0): str_line = "HOST_RAM_GB={0:.3f}\n".format(max_host_ram_gb) output.write(str_line) max_gpu_ram_gb = conf['max_gpu_ram_gb'] if (max_gpu_ram_gb > 0.0): str_line = "GPU_RAM_GB={0:.3f}\n".format(max_gpu_ram_gb) output.write(str_line) output.close() return result Loading Loading
src/scripts/model_maker.py +18 −0 Original line number Diff line number Diff line Loading @@ -353,6 +353,16 @@ def load_model(model_file): } gconf['use_refinement'] = use_refinement gconf['dyn_orders'] = dyn_orders gconf['max_host_ram_gb'] = 0 try: gconf['max_host_ram_gb'] = float(model['system_settings']['max_host_ram']) except KeyError as ex: print("WARNING: no host RAM declared. Cannot estimate recommended execution.") gconf['max_gpu_ram_gb'] = 0 try: gconf['max_gpu_ram_gb'] = float(model['system_settings']['max_gpu_ram']) except KeyError as ex: print("WARNING: no GPU RAM declared.") gconf['nsph'] = sconf['nsph'] gconf['application'] = model['particle_settings']['application'] gconf['li'] = int(model['geometry_settings']['li']) Loading Loading @@ -1016,6 +1026,14 @@ def write_legacy_gconf(conf): else: str_line = "USE_DYN_ORDERS=0\n" output.write(str_line) max_host_ram_gb = conf['max_host_ram_gb'] if (max_host_ram_gb > 0.0): str_line = "HOST_RAM_GB={0:.3f}\n".format(max_host_ram_gb) output.write(str_line) max_gpu_ram_gb = conf['max_gpu_ram_gb'] if (max_gpu_ram_gb > 0.0): str_line = "GPU_RAM_GB={0:.3f}\n".format(max_gpu_ram_gb) output.write(str_line) output.close() return result Loading