Compare commits
No commits in common. "e189ca9a7b699552c0d21aa98529fc42a2530d88" and "cd5546899780dffaf10b0746eabe0d5c2c8f7d7f" have entirely different histories.
e189ca9a7b
...
cd55468997
19 changed files with 234 additions and 134 deletions
11
.gitignore
vendored
11
.gitignore
vendored
|
@ -1,11 +0,0 @@
|
||||||
# Ignore some symbolic links
|
|
||||||
install
|
|
||||||
|
|
||||||
# Ignore specific directories and files
|
|
||||||
.ipynb_checkpoints/
|
|
||||||
*/.ipynb_checkpoints/
|
|
||||||
.vscode/
|
|
||||||
*.pyc
|
|
||||||
__pycache__/
|
|
||||||
sbmy_control.egg-info/
|
|
||||||
*.h5
|
|
35
sbmy_control.egg-info/PKG-INFO
Normal file
35
sbmy_control.egg-info/PKG-INFO
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
Metadata-Version: 2.4
|
||||||
|
Name: sbmy_control
|
||||||
|
Version: 0.1.0
|
||||||
|
Summary: Simbelmyne control package
|
||||||
|
Home-page: https://git.aquila-consortium.org/maubin/sbmy_control
|
||||||
|
Author: Mayeul Aubin
|
||||||
|
Author-email: mayeul.aubin@iap.fr
|
||||||
|
License: GPL-3.0
|
||||||
|
Classifier: Development Status :: 3 - Alpha
|
||||||
|
Classifier: Intended Audience :: Science/Research
|
||||||
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
||||||
|
Classifier: Programming Language :: Python :: 3
|
||||||
|
Classifier: Programming Language :: Python :: 3.8
|
||||||
|
Classifier: Programming Language :: Python :: 3.9
|
||||||
|
Classifier: Programming Language :: Python :: 3.10
|
||||||
|
Classifier: Programming Language :: Python :: 3.11
|
||||||
|
Requires-Python: >=3.8
|
||||||
|
Description-Content-Type: text/markdown
|
||||||
|
Requires-Dist: pysbmy
|
||||||
|
Requires-Dist: numpy
|
||||||
|
Requires-Dist: matplotlib
|
||||||
|
Requires-Dist: h5py
|
||||||
|
Requires-Dist: tqdm
|
||||||
|
Dynamic: author
|
||||||
|
Dynamic: author-email
|
||||||
|
Dynamic: classifier
|
||||||
|
Dynamic: description
|
||||||
|
Dynamic: description-content-type
|
||||||
|
Dynamic: home-page
|
||||||
|
Dynamic: license
|
||||||
|
Dynamic: requires-dist
|
||||||
|
Dynamic: requires-python
|
||||||
|
Dynamic: summary
|
||||||
|
|
||||||
|
This package provides control functionalities for Simbelmyne. It allows to create automatically all the required files and scripts to run a N-body simulation with Simbelmyne, using monofonIC for initial conditions. The subpackage `analysis` provides tools to analyze the results of the simulation (slices and power spectra), while the subpackage `scripts` includes tools to handle snapshots, tiles and density fields.
|
30
sbmy_control.egg-info/SOURCES.txt
Normal file
30
sbmy_control.egg-info/SOURCES.txt
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
setup.py
|
||||||
|
sbmy_control/ICs.py
|
||||||
|
sbmy_control/__init__.py
|
||||||
|
sbmy_control/args_main.py
|
||||||
|
sbmy_control/cosmo_params.py
|
||||||
|
sbmy_control/low_level.py
|
||||||
|
sbmy_control/main.py
|
||||||
|
sbmy_control/monofonic.py
|
||||||
|
sbmy_control/parameters_card.py
|
||||||
|
sbmy_control/parameters_monofonic.py
|
||||||
|
sbmy_control/progress_bar.py
|
||||||
|
sbmy_control/scola.py
|
||||||
|
sbmy_control/simbelmyne.py
|
||||||
|
sbmy_control/slurm_submission.py
|
||||||
|
sbmy_control/timestepping.py
|
||||||
|
sbmy_control.egg-info/PKG-INFO
|
||||||
|
sbmy_control.egg-info/SOURCES.txt
|
||||||
|
sbmy_control.egg-info/dependency_links.txt
|
||||||
|
sbmy_control.egg-info/entry_points.txt
|
||||||
|
sbmy_control.egg-info/requires.txt
|
||||||
|
sbmy_control.egg-info/top_level.txt
|
||||||
|
sbmy_control/analysis/__init__.py
|
||||||
|
sbmy_control/analysis/colormaps.py
|
||||||
|
sbmy_control/analysis/power_spectrum.py
|
||||||
|
sbmy_control/analysis/slices.py
|
||||||
|
sbmy_control/scripts/__init__.py
|
||||||
|
sbmy_control/scripts/convert_snapshot_to_density.py
|
||||||
|
sbmy_control/scripts/field_to_field.py
|
||||||
|
sbmy_control/scripts/gather_tiles.py
|
||||||
|
sbmy_control/scripts/scola_submit.py
|
1
sbmy_control.egg-info/dependency_links.txt
Normal file
1
sbmy_control.egg-info/dependency_links.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
8
sbmy_control.egg-info/entry_points.txt
Normal file
8
sbmy_control.egg-info/entry_points.txt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[console_scripts]
|
||||||
|
convert_snapshot_to_density = sbmy_control.scripts.convert_snapshot_to_density:console_main
|
||||||
|
field_to_field = sbmy_control.scripts.field_to_field:console_main
|
||||||
|
gather_tiles = sbmy_control.scripts.gather_tiles:console_main
|
||||||
|
power_spectrum = sbmy_control.analysis.power_spectrum:console_main
|
||||||
|
sbmy_control = sbmy_control.main:console_main
|
||||||
|
scola_submit = sbmy_control.scripts.scola_submit:console_main
|
||||||
|
slices = sbmy_control.analysis.slices:console_main
|
5
sbmy_control.egg-info/requires.txt
Normal file
5
sbmy_control.egg-info/requires.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
pysbmy
|
||||||
|
numpy
|
||||||
|
matplotlib
|
||||||
|
h5py
|
||||||
|
tqdm
|
1
sbmy_control.egg-info/top_level.txt
Normal file
1
sbmy_control.egg-info/top_level.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
sbmy_control
|
30
sbmy_control/.gitignore
vendored
Normal file
30
sbmy_control/.gitignore
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Ignore feature_* directory (usually used as git worktree)
|
||||||
|
feature_*/
|
||||||
|
|
||||||
|
# Ignore extensions directory
|
||||||
|
extensions/*
|
||||||
|
!extensions/__init__.py
|
||||||
|
|
||||||
|
# Ignore some symbolic links
|
||||||
|
install
|
||||||
|
|
||||||
|
# Ignore specific directories and files
|
||||||
|
.ipynb_checkpoints/
|
||||||
|
*/.ipynb_checkpoints/
|
||||||
|
.vscode/
|
||||||
|
*.pyc
|
||||||
|
__pycache__/
|
||||||
|
pysbmy.egg-info/
|
||||||
|
*.h5
|
||||||
|
*.rng
|
||||||
|
*.gadget1
|
||||||
|
*.gadget2
|
||||||
|
*.gadget3
|
||||||
|
log.txt
|
||||||
|
testpdf.txt
|
||||||
|
tests/
|
||||||
|
params/
|
||||||
|
results/
|
||||||
|
slurm_logs/
|
||||||
|
slurm_scripts/
|
||||||
|
work/
|
|
@ -3,9 +3,9 @@ def main_ICs(parsed_args):
|
||||||
"""
|
"""
|
||||||
Main function for the initial conditions generator.
|
Main function for the initial conditions generator.
|
||||||
"""
|
"""
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
from .parameters_card import parse_arguments_card_for_ICs
|
from parameters_card import parse_arguments_card_for_ICs
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module
|
from low_level import print_starting_module, print_message, print_ending_module
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
|
|
||||||
main_dict = parse_arguments_main(parsed_args)
|
main_dict = parse_arguments_main(parsed_args)
|
||||||
|
@ -52,10 +52,10 @@ def main_ICs(parsed_args):
|
||||||
|
|
||||||
|
|
||||||
def ICs_monofonic(parsed_args):
|
def ICs_monofonic(parsed_args):
|
||||||
from .monofonic import main_monofonic
|
from monofonic import main_monofonic
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .low_level import print_message
|
from low_level import print_message
|
||||||
from .parameters_monofonic import parse_arguments_monofonic
|
from parameters_monofonic import parse_arguments_monofonic
|
||||||
|
|
||||||
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
||||||
|
|
||||||
|
@ -67,9 +67,9 @@ def ICs_monofonic(parsed_args):
|
||||||
|
|
||||||
|
|
||||||
def ICs_sbmy(parsed_args):
|
def ICs_sbmy(parsed_args):
|
||||||
from .low_level import print_starting_module, print_message
|
from low_level import print_starting_module, print_message
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .parameters_card import parse_arguments_card_for_ICs
|
from parameters_card import parse_arguments_card_for_ICs
|
||||||
|
|
||||||
print_starting_module("sbmy IC", verbose=parsed_args.verbose)
|
print_starting_module("sbmy IC", verbose=parsed_args.verbose)
|
||||||
|
|
||||||
|
@ -99,14 +99,14 @@ def ICs_sbmy(parsed_args):
|
||||||
|
|
||||||
|
|
||||||
def create_sbmy_power_spectrum_file(parsed_args, card_dict, power_spectrum_file):
|
def create_sbmy_power_spectrum_file(parsed_args, card_dict, power_spectrum_file):
|
||||||
from .cosmo_params import parse_arguments_cosmo
|
from cosmo_params import parse_arguments_cosmo
|
||||||
from pysbmy.power import PowerSpectrum
|
from pysbmy.power import PowerSpectrum
|
||||||
|
|
||||||
cosmo_dict = parse_arguments_cosmo(parsed_args)
|
cosmo_dict = parse_arguments_cosmo(parsed_args)
|
||||||
|
|
||||||
if parsed_args.verbose < 2:
|
if parsed_args.verbose < 2:
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from .low_level import stdout_redirector, stderr_redirector
|
from low_level import stdout_redirector, stderr_redirector
|
||||||
f = BytesIO()
|
f = BytesIO()
|
||||||
g = BytesIO()
|
g = BytesIO()
|
||||||
with stdout_redirector(f):
|
with stdout_redirector(f):
|
||||||
|
@ -138,7 +138,7 @@ def create_sbmy_power_spectrum_file(parsed_args, card_dict, power_spectrum_file)
|
||||||
def create_sbmy_white_noise_field(parsed_args, card_dict, white_noise_field_file):
|
def create_sbmy_white_noise_field(parsed_args, card_dict, white_noise_field_file):
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from gc import collect
|
from gc import collect
|
||||||
from .low_level import print_message
|
from low_level import print_message
|
||||||
from pysbmy.field import BaseField
|
from pysbmy.field import BaseField
|
||||||
|
|
||||||
print_message(f"Seed: {parsed_args.seed}", 3, "sbmy IC", verbose=parsed_args.verbose)
|
print_message(f"Seed: {parsed_args.seed}", 3, "sbmy IC", verbose=parsed_args.verbose)
|
||||||
|
@ -161,7 +161,7 @@ def create_sbmy_white_noise_field(parsed_args, card_dict, white_noise_field_file
|
||||||
|
|
||||||
if parsed_args.verbose < 2:
|
if parsed_args.verbose < 2:
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from .low_level import stdout_redirector, stderr_redirector
|
from low_level import stdout_redirector, stderr_redirector
|
||||||
f = BytesIO()
|
f = BytesIO()
|
||||||
g = BytesIO()
|
g = BytesIO()
|
||||||
with stdout_redirector(f):
|
with stdout_redirector(f):
|
||||||
|
@ -175,11 +175,11 @@ def create_sbmy_white_noise_field(parsed_args, card_dict, white_noise_field_file
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .parameters_card import register_arguments_card_for_ICs
|
from parameters_card import register_arguments_card_for_ICs
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
from .parameters_monofonic import register_arguments_monofonic
|
from parameters_monofonic import register_arguments_monofonic
|
||||||
from .slurm_submission import register_arguments_slurm
|
from slurm_submission import register_arguments_slurm
|
||||||
|
|
||||||
parser = ArgumentParser(description="Generate initial conditions for a Simbelmyne simulation.")
|
parser = ArgumentParser(description="Generate initial conditions for a Simbelmyne simulation.")
|
||||||
# TODO: reduce the volume of arguments
|
# TODO: reduce the volume of arguments
|
||||||
|
|
|
@ -2,6 +2,7 @@ import numpy as np
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
sys.path.append('/home/aubin/Simbelmyne/sbmy_control/')
|
||||||
|
|
||||||
fs = 18
|
fs = 18
|
||||||
fs_titles = fs - 4
|
fs_titles = fs - 4
|
||||||
|
@ -39,7 +40,7 @@ def plot_imshow_with_reference( data_list,
|
||||||
"""
|
"""
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
from sbmy_control.analysis.colormaps import register_colormaps
|
from colormaps import register_colormaps
|
||||||
register_colormaps(plt.colormaps)
|
register_colormaps(plt.colormaps)
|
||||||
|
|
||||||
if titles is None:
|
if titles is None:
|
||||||
|
@ -108,7 +109,7 @@ def plot_imshow_diff(data_list,
|
||||||
|
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
from sbmy_control.analysis.colormapss import register_colormaps
|
from colormaps import register_colormaps
|
||||||
register_colormaps(plt.colormaps)
|
register_colormaps(plt.colormaps)
|
||||||
|
|
||||||
if reference is None:
|
if reference is None:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
|
|
||||||
def main(parsed_args):
|
def main(parsed_args):
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module, wait_until_file_exists
|
from low_level import print_starting_module, print_message, print_ending_module, wait_until_file_exists
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
|
|
||||||
print_starting_module("control", verbose=parsed_args.verbose)
|
print_starting_module("control", verbose=parsed_args.verbose)
|
||||||
main_dict = parse_arguments_main(parsed_args)
|
main_dict = parse_arguments_main(parsed_args)
|
||||||
|
@ -12,22 +12,22 @@ def main(parsed_args):
|
||||||
|
|
||||||
case "ICs" | "InitialConditions" | "InitialConditionsGenerator" | "ICsGenerator" | "ICsGen" | "ini":
|
case "ICs" | "InitialConditions" | "InitialConditionsGenerator" | "ICsGenerator" | "ICsGen" | "ini":
|
||||||
print_message("Running initial conditions generator.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Running initial conditions generator.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .ICs import main_ICs
|
from ICs import main_ICs
|
||||||
main_ICs(parsed_args)
|
main_ICs(parsed_args)
|
||||||
print_message("Initial conditions generator finished.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Initial conditions generator finished.", 1, "control", verbose=parsed_args.verbose)
|
||||||
|
|
||||||
|
|
||||||
case "TS" | "timestepping":
|
case "TS" | "timestepping":
|
||||||
print_message("Running timestepping generator.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Running timestepping generator.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .timestepping import main_timestepping
|
from timestepping import main_timestepping
|
||||||
main_timestepping(parsed_args)
|
main_timestepping(parsed_args)
|
||||||
print_message("Timestepping generator finished.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Timestepping generator finished.", 1, "control", verbose=parsed_args.verbose)
|
||||||
|
|
||||||
|
|
||||||
case "PM" | "LPT" | "tCOLA" | "simbelmyne" | "sbmy":
|
case "PM" | "LPT" | "tCOLA" | "simbelmyne" | "sbmy":
|
||||||
print_message(f"Running Simbelmyne in mode {main_dict["mode"]}.", 1, "control", verbose=parsed_args.verbose)
|
print_message(f"Running Simbelmyne in mode {main_dict["mode"]}.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .simbelmyne import main_simbelmyne
|
from simbelmyne import main_simbelmyne
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
@ -47,8 +47,8 @@ def main(parsed_args):
|
||||||
|
|
||||||
case "pre_sCOLA":
|
case "pre_sCOLA":
|
||||||
print_message("Running pre-sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Running pre-sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .scola import main_pre_scola
|
from scola import main_pre_scola
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ def main(parsed_args):
|
||||||
|
|
||||||
case "post_sCOLA":
|
case "post_sCOLA":
|
||||||
print_message("Running post-sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Running post-sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .scola import main_post_scola
|
from scola import main_post_scola
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
|
||||||
|
@ -73,8 +73,8 @@ def main(parsed_args):
|
||||||
|
|
||||||
case "sCOLA":
|
case "sCOLA":
|
||||||
print_message("Running sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
print_message("Running sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .scola import main_scola
|
from scola import main_scola
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
|
||||||
|
@ -86,12 +86,12 @@ def main(parsed_args):
|
||||||
|
|
||||||
case "alltCOLA" | "allPM":
|
case "alltCOLA" | "allPM":
|
||||||
print_message(f"Running ICs and Simbelmyne in mode {main_dict["mode"]}.", 1, "control", verbose=parsed_args.verbose)
|
print_message(f"Running ICs and Simbelmyne in mode {main_dict["mode"]}.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .parameters_card import parse_arguments_card, main_parameter_card
|
from parameters_card import parse_arguments_card, main_parameter_card
|
||||||
from .timestepping import main_timestepping
|
from timestepping import main_timestepping
|
||||||
from .ICs import main_ICs
|
from ICs import main_ICs
|
||||||
from .simbelmyne import main_simbelmyne
|
from simbelmyne import main_simbelmyne
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .low_level import wait_until_file_exists
|
from low_level import wait_until_file_exists
|
||||||
|
|
||||||
card_dict = main_parameter_card(parsed_args)
|
card_dict = main_parameter_card(parsed_args)
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ def main(parsed_args):
|
||||||
|
|
||||||
## Check consistency of ICs_gen and ICs
|
## Check consistency of ICs_gen and ICs
|
||||||
if main_dict["ICs_gen"] == "monofonic":
|
if main_dict["ICs_gen"] == "monofonic":
|
||||||
from .parameters_monofonic import parse_arguments_monofonic
|
from parameters_monofonic import parse_arguments_monofonic
|
||||||
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
||||||
if monofonic_dict["output"]+"DM_delta.h5" != card_dict["ICs"]:
|
if monofonic_dict["output"]+"DM_delta.h5" != card_dict["ICs"]:
|
||||||
raise ValueError(f"ICs {card_dict['ICs']} does not match monofonic output {monofonic_dict['output']+'DM_delta.h5'}")
|
raise ValueError(f"ICs {card_dict['ICs']} does not match monofonic output {monofonic_dict['output']+'DM_delta.h5'}")
|
||||||
|
@ -133,10 +133,10 @@ def main(parsed_args):
|
||||||
|
|
||||||
case "allsCOLA":
|
case "allsCOLA":
|
||||||
print_message(f"Running ICs, pre_sCOLA, sCOLA and post_sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
print_message(f"Running ICs, pre_sCOLA, sCOLA and post_sCOLA.", 1, "control", verbose=parsed_args.verbose)
|
||||||
from .parameters_card import parse_arguments_card, main_parameter_card
|
from parameters_card import parse_arguments_card, main_parameter_card
|
||||||
from .timestepping import main_timestepping
|
from timestepping import main_timestepping
|
||||||
from .ICs import main_ICs
|
from ICs import main_ICs
|
||||||
from .scola import main_scola, main_pre_scola, main_post_scola, have_all_tiles
|
from scola import main_scola, main_pre_scola, main_post_scola, have_all_tiles
|
||||||
|
|
||||||
card_dict = main_parameter_card(parsed_args)
|
card_dict = main_parameter_card(parsed_args)
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ def main(parsed_args):
|
||||||
|
|
||||||
## Check consistency of ICs_gen and OutputLPTPotential
|
## Check consistency of ICs_gen and OutputLPTPotential
|
||||||
if main_dict["ICs_gen"] == "monofonic":
|
if main_dict["ICs_gen"] == "monofonic":
|
||||||
from .parameters_monofonic import parse_arguments_monofonic
|
from parameters_monofonic import parse_arguments_monofonic
|
||||||
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
||||||
if monofonic_dict["output"]+"DM_phi.h5" != card_dict["OutputLPTPotential1"]:
|
if monofonic_dict["output"]+"DM_phi.h5" != card_dict["OutputLPTPotential1"]:
|
||||||
raise ValueError(f"OutputLPTPotential1 {card_dict['OutputLPTPotential1']} does not match monofonic output {monofonic_dict['output']+'DM_phi.h5'}")
|
raise ValueError(f"OutputLPTPotential1 {card_dict['OutputLPTPotential1']} does not match monofonic output {monofonic_dict['output']+'DM_phi.h5'}")
|
||||||
|
@ -179,7 +179,7 @@ def main(parsed_args):
|
||||||
main_scola(parsed_args)
|
main_scola(parsed_args)
|
||||||
if parsed_args.execution == "slurm" and not have_all_tiles(parsed_args):
|
if parsed_args.execution == "slurm" and not have_all_tiles(parsed_args):
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from .low_level import progress_bar_from_logfile
|
from low_level import progress_bar_from_logfile
|
||||||
for b in tqdm(range(1,parsed_args.N_tiles**3+1), desc="sCOLA", unit="box", disable=(parsed_args.verbose==0)):
|
for b in tqdm(range(1,parsed_args.N_tiles**3+1), desc="sCOLA", unit="box", disable=(parsed_args.verbose==0)):
|
||||||
progress_bar_from_logfile(main_dict["logdir"]+main_dict["simname"]+".log_"+str(b), desc=f"Box {b}/{parsed_args.N_tiles**3}", verbose=parsed_args.verbose, leave=False)
|
progress_bar_from_logfile(main_dict["logdir"]+main_dict["simname"]+".log_"+str(b), desc=f"Box {b}/{parsed_args.N_tiles**3}", verbose=parsed_args.verbose, leave=False)
|
||||||
print_message("sCOLA finished.", 1, "control", verbose=parsed_args.verbose)
|
print_message("sCOLA finished.", 1, "control", verbose=parsed_args.verbose)
|
||||||
|
@ -222,13 +222,13 @@ def check_consistency(card_dict, mode):
|
||||||
|
|
||||||
def console_main():
|
def console_main():
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .timestepping import register_arguments_timestepping, main_timestepping
|
from timestepping import register_arguments_timestepping, main_timestepping
|
||||||
from .parameters_card import register_arguments_card, main_parameter_card
|
from parameters_card import register_arguments_card, main_parameter_card
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
from .parameters_monofonic import register_arguments_monofonic
|
from parameters_monofonic import register_arguments_monofonic
|
||||||
from .slurm_submission import register_arguments_slurm
|
from slurm_submission import register_arguments_slurm
|
||||||
from .low_level import wait_until_file_exists
|
from low_level import wait_until_file_exists
|
||||||
|
|
||||||
parser = ArgumentParser(description="Run sCOLA.")
|
parser = ArgumentParser(description="Run sCOLA.")
|
||||||
register_arguments_main(parser)
|
register_arguments_main(parser)
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
path_to_monofonic_binary = "/home/aubin/monofonic/build/monofonIC"
|
path_to_monofonic_binary = "/home/aubin/monofonic/build/monofonIC"
|
||||||
|
|
||||||
def main_monofonic(parsed_args):
|
def main_monofonic(parsed_args):
|
||||||
from .parameters_monofonic import main_parameters_monofonic
|
from parameters_monofonic import main_parameters_monofonic
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module
|
from low_level import print_starting_module, print_message, print_ending_module
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ def main_monofonic(parsed_args):
|
||||||
print_message("Monofonic finished.", 1, "monofonic", verbose=parsed_args.verbose)
|
print_message("Monofonic finished.", 1, "monofonic", verbose=parsed_args.verbose)
|
||||||
|
|
||||||
elif parsed_args.execution == "slurm":
|
elif parsed_args.execution == "slurm":
|
||||||
from .slurm_submission import create_slurm_script, parse_arguments_slurm
|
from slurm_submission import create_slurm_script, parse_arguments_slurm
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
print_message("Running monofonic in slurm mode.", 1, "monofonic", verbose=parsed_args.verbose)
|
print_message("Running monofonic in slurm mode.", 1, "monofonic", verbose=parsed_args.verbose)
|
||||||
slurm_dict=parse_arguments_slurm(parsed_args)
|
slurm_dict=parse_arguments_slurm(parsed_args)
|
||||||
main_dict=parse_arguments_main(parsed_args)
|
main_dict=parse_arguments_main(parsed_args)
|
||||||
|
@ -67,11 +67,11 @@ def main_monofonic(parsed_args):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from .parameters_monofonic import register_arguments_monofonic
|
from parameters_monofonic import register_arguments_monofonic
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .parameters_card import register_arguments_card_for_ICs
|
from parameters_card import register_arguments_card_for_ICs
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
from .slurm_submission import register_arguments_slurm
|
from slurm_submission import register_arguments_slurm
|
||||||
|
|
||||||
parser = ArgumentParser(description="Run monofonIC initial conditions generator for a Simbelmyne simulation.")
|
parser = ArgumentParser(description="Run monofonIC initial conditions generator for a Simbelmyne simulation.")
|
||||||
# TODO: reduce the volume of arguments
|
# TODO: reduce the volume of arguments
|
||||||
|
|
|
@ -73,8 +73,8 @@ def parse_arguments_card(parsed_args):
|
||||||
"""
|
"""
|
||||||
Parse the arguments for the parameter card.
|
Parse the arguments for the parameter card.
|
||||||
"""
|
"""
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
from .cosmo_params import parse_arguments_cosmo
|
from cosmo_params import parse_arguments_cosmo
|
||||||
|
|
||||||
cosmo_dict=parse_arguments_cosmo(parsed_args)
|
cosmo_dict=parse_arguments_cosmo(parsed_args)
|
||||||
card_dict=dict(
|
card_dict=dict(
|
||||||
|
@ -212,7 +212,7 @@ def parse_arguments_card_for_ICs(parsed_args):
|
||||||
"""
|
"""
|
||||||
Parse the arguments for the parameter card for ICs.
|
Parse the arguments for the parameter card for ICs.
|
||||||
"""
|
"""
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
|
|
||||||
main_dict = parse_arguments_main(parsed_args)
|
main_dict = parse_arguments_main(parsed_args)
|
||||||
card_dict = dict(
|
card_dict = dict(
|
||||||
|
@ -252,7 +252,7 @@ def parse_arguments_card_for_timestepping(parsed_args):
|
||||||
"""
|
"""
|
||||||
Parse the arguments for the parameter card for timestepping.
|
Parse the arguments for the parameter card for timestepping.
|
||||||
"""
|
"""
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
|
|
||||||
main_dict = parse_arguments_main(parsed_args)
|
main_dict = parse_arguments_main(parsed_args)
|
||||||
card_dict = dict(
|
card_dict = dict(
|
||||||
|
@ -401,7 +401,7 @@ def write_parameter_card(parameter_card_dict:dict, filename:str, verbose:int = 1
|
||||||
|
|
||||||
if verbose < 2:
|
if verbose < 2:
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from .low_level import stdout_redirector, stderr_redirector
|
from low_level import stdout_redirector, stderr_redirector
|
||||||
|
|
||||||
f = BytesIO()
|
f = BytesIO()
|
||||||
g = BytesIO()
|
g = BytesIO()
|
||||||
|
@ -420,7 +420,7 @@ def main_parameter_card(parsed_args):
|
||||||
"""
|
"""
|
||||||
Main function for the parameter card.
|
Main function for the parameter card.
|
||||||
"""
|
"""
|
||||||
from .low_level import print_message, print_starting_module, print_ending_module
|
from low_level import print_message, print_starting_module, print_ending_module
|
||||||
print_starting_module("card", verbose=parsed_args.verbose)
|
print_starting_module("card", verbose=parsed_args.verbose)
|
||||||
print_message("Parsing arguments for the parameter card.", 1, "card", verbose=parsed_args.verbose)
|
print_message("Parsing arguments for the parameter card.", 1, "card", verbose=parsed_args.verbose)
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
@ -436,8 +436,8 @@ def main_parameter_card(parsed_args):
|
||||||
return card_dict
|
return card_dict
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
|
|
||||||
parser = ArgumentParser(description="Create sbmy parameter card.")
|
parser = ArgumentParser(description="Create sbmy parameter card.")
|
||||||
register_arguments_main(parser)
|
register_arguments_main(parser)
|
||||||
|
|
|
@ -16,9 +16,9 @@ def parse_arguments_monofonic(parsed_args):
|
||||||
"""
|
"""
|
||||||
Parse the arguments for the monofonIC parameters.
|
Parse the arguments for the monofonIC parameters.
|
||||||
"""
|
"""
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
from .parameters_card import parse_arguments_card_for_ICs
|
from parameters_card import parse_arguments_card_for_ICs
|
||||||
from .cosmo_params import parse_arguments_cosmo
|
from cosmo_params import parse_arguments_cosmo
|
||||||
|
|
||||||
main_dict = parse_arguments_main(parsed_args)
|
main_dict = parse_arguments_main(parsed_args)
|
||||||
card_dict = parse_arguments_card_for_ICs(parsed_args)
|
card_dict = parse_arguments_card_for_ICs(parsed_args)
|
||||||
|
@ -131,7 +131,7 @@ def get_config_from_dict(monofonic_dict):
|
||||||
|
|
||||||
|
|
||||||
def main_parameters_monofonic(parsed_args):
|
def main_parameters_monofonic(parsed_args):
|
||||||
from .low_level import print_message
|
from low_level import print_message
|
||||||
|
|
||||||
print_message("Parsing arguments for the config file.", 1, "monofonic", verbose=parsed_args.verbose)
|
print_message("Parsing arguments for the config file.", 1, "monofonic", verbose=parsed_args.verbose)
|
||||||
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
monofonic_dict = parse_arguments_monofonic(parsed_args)
|
||||||
|
@ -144,9 +144,9 @@ def main_parameters_monofonic(parsed_args):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .parameters_card import register_arguments_card_for_ICs
|
from parameters_card import register_arguments_card_for_ICs
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
|
|
||||||
parser = ArgumentParser(description="Create monofonIC configuration file.")
|
parser = ArgumentParser(description="Create monofonIC configuration file.")
|
||||||
register_arguments_main(parser)
|
register_arguments_main(parser)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
from .low_level import progress_bar_from_logfile
|
from low_level import progress_bar_from_logfile
|
||||||
|
|
||||||
parser = ArgumentParser(description="Progress bar from log files.")
|
parser = ArgumentParser(description="Progress bar from log files.")
|
||||||
parser.add_argument("-l","--logdir", type=str, help="Log directory.")
|
parser.add_argument("-l","--logdir", type=str, help="Log directory.")
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
def main_scola(parsed_args):
|
def main_scola(parsed_args):
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module, progress_bar_from_logfile, wait_until_file_exists
|
from low_level import print_starting_module, print_message, print_ending_module, progress_bar_from_logfile, wait_until_file_exists
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ def main_scola(parsed_args):
|
||||||
return
|
return
|
||||||
|
|
||||||
if parsed_args.execution == "local":
|
if parsed_args.execution == "local":
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
print_message("Running sCOLA in local mode.", 1, "scola", verbose=parsed_args.verbose)
|
print_message("Running sCOLA in local mode.", 1, "scola", verbose=parsed_args.verbose)
|
||||||
|
@ -52,9 +52,9 @@ def main_scola(parsed_args):
|
||||||
print_message("sCOLA finished.", 1, "scola", verbose=parsed_args.verbose)
|
print_message("sCOLA finished.", 1, "scola", verbose=parsed_args.verbose)
|
||||||
|
|
||||||
elif parsed_args.execution == "slurm":
|
elif parsed_args.execution == "slurm":
|
||||||
from .slurm_submission import create_slurm_script, parse_arguments_slurm, limit_slurm_arrays
|
from slurm_submission import create_slurm_script, parse_arguments_slurm, limit_slurm_arrays
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
import os
|
import os
|
||||||
print_message("Running scola in slurm mode.", 1, "scola", verbose=parsed_args.verbose)
|
print_message("Running scola in slurm mode.", 1, "scola", verbose=parsed_args.verbose)
|
||||||
slurm_dict=parse_arguments_slurm(parsed_args)
|
slurm_dict=parse_arguments_slurm(parsed_args)
|
||||||
|
@ -148,15 +148,15 @@ def main_pre_scola(parsed_args):
|
||||||
If they already exist, it does nothing. If all tiles exist, raises error.
|
If they already exist, it does nothing. If all tiles exist, raises error.
|
||||||
"""
|
"""
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module
|
from low_level import print_starting_module, print_message, print_ending_module
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
print_starting_module("pre-scola", verbose=parsed_args.verbose)
|
print_starting_module("pre-scola", verbose=parsed_args.verbose)
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
|
||||||
if not isfile(card_dict["OutputLPTPotential1"]) or not isfile(card_dict["OutputLPTPotential2"]) or parsed_args.force:
|
if not isfile(card_dict["OutputLPTPotential1"]) or not isfile(card_dict["OutputLPTPotential2"]) or parsed_args.force:
|
||||||
if not have_all_tiles(parsed_args):
|
if not have_all_tiles(parsed_args):
|
||||||
print_message("Running pre-scola.", 1, "pre-scola", verbose=parsed_args.verbose)
|
print_message("Running pre-scola.", 1, "pre-scola", verbose=parsed_args.verbose)
|
||||||
from .simbelmyne import main_simbelmyne
|
from simbelmyne import main_simbelmyne
|
||||||
main_simbelmyne(parsed_args)
|
main_simbelmyne(parsed_args)
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("All tiles exists, so calling simbelmyne would generate the final output instead of the LPT potentials.")
|
raise NotImplementedError("All tiles exists, so calling simbelmyne would generate the final output instead of the LPT potentials.")
|
||||||
|
@ -172,8 +172,8 @@ def main_post_scola(parsed_args):
|
||||||
If the output already exists, it does nothing. If tiles are missing, print the missing tiles.
|
If the output already exists, it does nothing. If tiles are missing, print the missing tiles.
|
||||||
"""
|
"""
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module
|
from low_level import print_starting_module, print_message, print_ending_module
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
print_starting_module("post-scola", verbose=parsed_args.verbose)
|
print_starting_module("post-scola", verbose=parsed_args.verbose)
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ def main_post_scola(parsed_args):
|
||||||
if (card_dict["WriteFinalDensity"] and not isfile(card_dict["OutputFinalDensity"])) or (card_dict["WriteFinalSnapshot"] and not isfile(card_dict["OutputFinalSnapshot"])) or parsed_args.force:
|
if (card_dict["WriteFinalDensity"] and not isfile(card_dict["OutputFinalDensity"])) or (card_dict["WriteFinalSnapshot"] and not isfile(card_dict["OutputFinalSnapshot"])) or parsed_args.force:
|
||||||
if have_all_tiles(parsed_args):
|
if have_all_tiles(parsed_args):
|
||||||
print_message("Running post-scola.", 1, "post-scola", verbose=parsed_args.verbose)
|
print_message("Running post-scola.", 1, "post-scola", verbose=parsed_args.verbose)
|
||||||
from .simbelmyne import main_simbelmyne
|
from simbelmyne import main_simbelmyne
|
||||||
main_simbelmyne(parsed_args)
|
main_simbelmyne(parsed_args)
|
||||||
else:
|
else:
|
||||||
missing_tiles_arrays = get_missing_tiles_arrays(parsed_args)
|
missing_tiles_arrays = get_missing_tiles_arrays(parsed_args)
|
||||||
|
@ -203,7 +203,7 @@ def main_post_scola(parsed_args):
|
||||||
|
|
||||||
def have_all_tiles(parsed_args):
|
def have_all_tiles(parsed_args):
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
nboxes_tot = int(parsed_args.N_tiles**3)
|
nboxes_tot = int(parsed_args.N_tiles**3)
|
||||||
|
@ -216,7 +216,7 @@ def have_all_tiles(parsed_args):
|
||||||
|
|
||||||
def have_no_tiles(parsed_args):
|
def have_no_tiles(parsed_args):
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
nboxes_tot = int(parsed_args.N_tiles**3)
|
nboxes_tot = int(parsed_args.N_tiles**3)
|
||||||
|
@ -229,8 +229,8 @@ def have_no_tiles(parsed_args):
|
||||||
|
|
||||||
def get_missing_tiles_arrays(parsed_args):
|
def get_missing_tiles_arrays(parsed_args):
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
from .parameters_card import parse_arguments_card
|
from parameters_card import parse_arguments_card
|
||||||
from .slurm_submission import limit_slurm_arrays
|
from slurm_submission import limit_slurm_arrays
|
||||||
|
|
||||||
card_dict = parse_arguments_card(parsed_args)
|
card_dict = parse_arguments_card(parsed_args)
|
||||||
nboxes_tot = int(parsed_args.N_tiles**3)
|
nboxes_tot = int(parsed_args.N_tiles**3)
|
||||||
|
@ -260,13 +260,13 @@ def get_missing_tiles_arrays(parsed_args):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .timestepping import register_arguments_timestepping, main_timestepping
|
from timestepping import register_arguments_timestepping, main_timestepping
|
||||||
from .parameters_card import register_arguments_card, main_parameter_card
|
from parameters_card import register_arguments_card, main_parameter_card
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
from .parameters_monofonic import register_arguments_monofonic
|
from parameters_monofonic import register_arguments_monofonic
|
||||||
from .slurm_submission import register_arguments_slurm
|
from slurm_submission import register_arguments_slurm
|
||||||
from .low_level import wait_until_file_exists
|
from low_level import wait_until_file_exists
|
||||||
|
|
||||||
parser = ArgumentParser(description="Run sCOLA.")
|
parser = ArgumentParser(description="Run sCOLA.")
|
||||||
register_arguments_main(parser)
|
register_arguments_main(parser)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
def main_simbelmyne(parsed_args):
|
def main_simbelmyne(parsed_args):
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
from .low_level import print_starting_module, print_message, print_ending_module, progress_bar_from_logfile
|
from low_level import print_starting_module, print_message, print_ending_module, progress_bar_from_logfile
|
||||||
from os.path import isfile
|
from os.path import isfile
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ def main_simbelmyne(parsed_args):
|
||||||
print_message("Simbelyne finished.", 1, "simbelmyne", verbose=parsed_args.verbose)
|
print_message("Simbelyne finished.", 1, "simbelmyne", verbose=parsed_args.verbose)
|
||||||
|
|
||||||
elif parsed_args.execution == "slurm":
|
elif parsed_args.execution == "slurm":
|
||||||
from .slurm_submission import create_slurm_script, parse_arguments_slurm
|
from slurm_submission import create_slurm_script, parse_arguments_slurm
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
print_message("Running simbelmyne in slurm mode.", 1, "simbelmyne", verbose=parsed_args.verbose)
|
print_message("Running simbelmyne in slurm mode.", 1, "simbelmyne", verbose=parsed_args.verbose)
|
||||||
slurm_dict=parse_arguments_slurm(parsed_args)
|
slurm_dict=parse_arguments_slurm(parsed_args)
|
||||||
main_dict=parse_arguments_main(parsed_args)
|
main_dict=parse_arguments_main(parsed_args)
|
||||||
|
@ -76,12 +76,12 @@ def main_simbelmyne(parsed_args):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .timestepping import register_arguments_timestepping, main_timestepping
|
from timestepping import register_arguments_timestepping, main_timestepping
|
||||||
from .parameters_card import register_arguments_card, main_parameter_card
|
from parameters_card import register_arguments_card, main_parameter_card
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
from .parameters_simbelmyne import register_arguments_simbelmyne
|
from parameters_simbelmyne import register_arguments_simbelmyne
|
||||||
from .slurm_submission import register_arguments_slurm
|
from slurm_submission import register_arguments_slurm
|
||||||
|
|
||||||
parser = ArgumentParser(description="Run Simbelmyne.")
|
parser = ArgumentParser(description="Run Simbelmyne.")
|
||||||
register_arguments_main(parser)
|
register_arguments_main(parser)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from .args_main import parse_arguments_main
|
from args_main import parse_arguments_main
|
||||||
|
|
||||||
path_to_monofonic_binary = "/home/aubin/monofonic/build/monofonIC"
|
path_to_monofonic_binary = "/home/aubin/monofonic/build/monofonIC"
|
||||||
limit_slurm_arrays=799
|
limit_slurm_arrays=799
|
||||||
|
|
|
@ -18,8 +18,8 @@ def parse_arguments_timestepping(parsed_args):
|
||||||
"""
|
"""
|
||||||
Parse the arguments for the timestepping.
|
Parse the arguments for the timestepping.
|
||||||
"""
|
"""
|
||||||
from .parameters_card import parse_arguments_card_for_timestepping
|
from parameters_card import parse_arguments_card_for_timestepping
|
||||||
from .cosmo_params import parse_arguments_cosmo, z2a
|
from cosmo_params import parse_arguments_cosmo, z2a
|
||||||
|
|
||||||
card_dict = parse_arguments_card_for_timestepping(parsed_args)
|
card_dict = parse_arguments_card_for_timestepping(parsed_args)
|
||||||
cosmo_dict = parse_arguments_cosmo(parsed_args)
|
cosmo_dict = parse_arguments_cosmo(parsed_args)
|
||||||
|
@ -79,7 +79,7 @@ def create_timestepping(timestepping_dict, ts_filename:str, verbose:int=1):
|
||||||
TS = StandardTimeStepping(**timestepping_dict)
|
TS = StandardTimeStepping(**timestepping_dict)
|
||||||
if verbose < 2:
|
if verbose < 2:
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from .low_level import stdout_redirector, stderr_redirector
|
from low_level import stdout_redirector, stderr_redirector
|
||||||
f = BytesIO()
|
f = BytesIO()
|
||||||
g = BytesIO()
|
g = BytesIO()
|
||||||
with stdout_redirector(f):
|
with stdout_redirector(f):
|
||||||
|
@ -95,7 +95,7 @@ def main_timestepping(parsed_args):
|
||||||
"""
|
"""
|
||||||
Main function for the timestepping.
|
Main function for the timestepping.
|
||||||
"""
|
"""
|
||||||
from .low_level import print_message, print_ending_module, print_starting_module
|
from low_level import print_message, print_ending_module, print_starting_module
|
||||||
|
|
||||||
print_starting_module("timestepping", verbose=parsed_args.verbose)
|
print_starting_module("timestepping", verbose=parsed_args.verbose)
|
||||||
print_message("Parsing arguments for the timestepping file.", 1, "timestepping", verbose=parsed_args.verbose)
|
print_message("Parsing arguments for the timestepping file.", 1, "timestepping", verbose=parsed_args.verbose)
|
||||||
|
@ -110,9 +110,9 @@ def main_timestepping(parsed_args):
|
||||||
return timestepping_dict
|
return timestepping_dict
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from .args_main import register_arguments_main
|
from args_main import register_arguments_main
|
||||||
from .parameters_card import register_arguments_card_for_timestepping
|
from parameters_card import register_arguments_card_for_timestepping
|
||||||
from .cosmo_params import register_arguments_cosmo
|
from cosmo_params import register_arguments_cosmo
|
||||||
|
|
||||||
parser = ArgumentParser(description="Create timestepping file.")
|
parser = ArgumentParser(description="Create timestepping file.")
|
||||||
# TODO: reduce the volume of arguments
|
# TODO: reduce the volume of arguments
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue