Commit 0eb12d53 authored by vlabarre's avatar vlabarre
Browse files

small changes

parent a844d59764f2
Pipeline #53949 passed with stage
in 15 minutes and 14 seconds
......@@ -6,7 +6,9 @@ from fluidsim.util import (
from util import path_base, couples, get_t_end
nh = 320
from shutil import copyfile, rmtree
nh = 640
print(couples[nh])
print(len(couples[nh]), "x2 simulations to launch")
......@@ -43,6 +45,13 @@ for proj in ["None", "poloidal"]:
print(f"{params:40s}: not started")
continue
try:
path_init_file = next(path.glob(f"state_phys_t*.h5"))
except StopIteration:
print(f"No state_phys_t*.h5 in the directory, we remove it")
rmtree(path, ignore_errors=True)
continue
t_start, t_last = times_start_last_from_path(path)
if t_last >= t_end:
......
......@@ -76,7 +76,8 @@ for path in paths:
link_last_state.parent.mkdir(exist_ok=True)
link_last_state.symlink_to(path_end_state)
N_str = "_N" + re.search(r"_N(.*?)_", path.name).group(1)
Fh = 1.0 / N
Fh_str = f"_Fh{Fh:.3e}"
Rb_str = re.search(r"_Rb(.*?)_", path.name).group(1)
Rb = float(Rb_str)
......@@ -84,7 +85,7 @@ for path in paths:
try:
corresponding_path640 = next(
p for p in paths640 if N_str in p.name and Rb_str in p.name
p for p in paths640 if Fh_str in p.name and Rb_str in p.name
)
except StopIteration:
corresponding_path640 = False
......@@ -94,10 +95,10 @@ for path in paths:
except StopIteration:
path_init_file = False
if not corresponding_path640:
if True: # not corresponding_path640:
if not path_init_file:
command = f"fluidsim-modif-resolution --t_approx {t_end} {path} 2"
# os.system(command)
os.system(command)
else:
if path_init_file:
......
......@@ -16,7 +16,7 @@ This directory can be synchronized on Jean-Zay with:
```
du -h /scratch/vlabarre/aniso/init_jeanzay
rsync -rvz -L /scratch/vlabarre/aniso/init_jeanzay/ns3d* uey73qw@jean-zay.idris.fr:/gpfsscratch/rech/zmr/uey73qw/aniso &
rsync -rvz -L /scratch/vlabarre/aniso/init_jeanzay/ns3d* uey73qw@jean-zay.idris.fr:/gpfsscratch/rech/uzc/uey73qw/aniso &
```
3. compute the spatiotemporal spectra
......
......@@ -12,6 +12,7 @@ python submit640.py
import subprocess
from math import pi
import os
from shutil import copyfile, rmtree
from fluidsim.util import (
times_start_last_from_path,
......@@ -34,7 +35,8 @@ nh_init = nh // 2
walltime = "23:59:59"
max_elapsed = "23:45:00"
nb_nodes = 1
nb_mpi_processes = 40
nb_cores_per_node = cluster.nb_cores_per_node
nb_mpi_processes = nb_nodes * nb_cores_per_node
for proj in ["None", "poloidal"]:
for N, Rb in sorted(couples[nh]):
......@@ -106,12 +108,11 @@ for proj in ["None", "poloidal"]:
command = (
f"fluidsim-restart {path_init_file} --t_end {t_end} --new-dir-results "
f"--max-elapsed {max_elapsed} "
f"--modify-params 'params.nu_4 /= 10; params.output.periods_save.phys_fields = 0.5; "
f"--modify-params 'params.nu_4 /= 10.; params.output.periods_save.phys_fields = 0.5; "
"params.output.periods_print.print_stdout = 0.02; "
f"params.output.periods_save.spatiotemporal_spectra = {period_spatiotemp};'"
)
print(f"run: {command} \n")
cluster.submit_command(
command,
name_run=name_run,
......@@ -136,6 +137,13 @@ for proj in ["None", "poloidal"]:
elif len(path_runs) == 1:
# See if we restart the simulation
try:
path_init_file = next(path_runs[0].glob(f"state_phys_t*.h5"))
except StopIteration:
print("No state_phys_t*.h5 in the directory, we remove it")
rmtree(path_runs[0], ignore_errors=True)
continue
t_start, t_last = times_start_last_from_path(path_runs[0])
if t_last >= t_end:
params = f"{proj=} {N=} {Rb=} {nh=}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment