Commit ce01dbd2 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Write system settings runtime options in model_maker

parent 3641144c
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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'])
@@ -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