Skip to content
Snippets Groups Projects
Commit 87135e6f authored by Pierre Augier's avatar Pierre Augier
Browse files

examples/time_stepping/3d: prepare a big simulation

parent ac7af09e
No related branches found
No related tags found
1 merge request!156Topic/default/phaseshift3d
......@@ -14,7 +14,6 @@
```
"""
from contextlib import redirect_stdout
from pathlib import Path
import sys
......
......@@ -95,6 +95,13 @@
"--length_noise", help="noise length", type=float, default=L / 5,
)
parser.add_argument(
"--truncation_shape",
help='Truncation shape (can be "cubic", "spherical" or "no_multiple_aliases")',
type=str,
default=None,
)
def init_params(args):
......@@ -130,9 +137,13 @@
params.oper.nx = params.oper.ny = params.oper.nz = args.nx
params.oper.Lx = params.oper.Ly = params.oper.Lz = 2 * np.pi * L
params.oper.coef_dealiasing = args.coef_dealiasing
params.oper.truncation_shape = "spherical"
if args.coef_dealiasing > np.sqrt(2) * 2 / 3:
params.oper.truncation_shape = "no_multiple_aliases"
if args.truncation_shape is None:
params.oper.truncation_shape = "spherical"
if args.coef_dealiasing > np.sqrt(2) * 2 / 3:
params.oper.truncation_shape = "no_multiple_aliases"
else:
params.oper.truncation_shape = args.truncation_shape
if mpi.nb_proc > 1:
params.oper.type_fft = "fft3d.mpi_with_fftw1d"
......
from util_submit import submit_simul
submit_simul(1.0, 400, "RK4", cfl_coef=None, nb_proc=20)
submit_simul(1.0, 800, "RK4", cfl_coef=None, nb_proc=None)
......@@ -15,7 +15,7 @@
def submit_simul(
coef_dealiasing, nx, type_time_scheme, cfl_coef=None, nb_proc=None
):
nb_nodes = 1
if nb_proc is None:
if nx < 480:
nb_proc = 10
......@@ -19,6 +19,9 @@
if nb_proc is None:
if nx < 480:
nb_proc = 10
if nx >= 640:
nb_proc = 40
nb_nodes = 2
else:
nb_proc = 20
......@@ -22,6 +25,9 @@
else:
nb_proc = 20
tmp = nx / 2 / nb_proc
assert round(tmp) == tmp
nb_mpi_processes = nb_proc
command = (
......@@ -46,8 +52,8 @@
cluster.submit_script(
command,
name_run=name_run,
nb_nodes=1,
nb_cores_per_node=nb_proc,
nb_nodes=nb_nodes,
nb_cores_per_node=nb_proc // nb_nodes,
nb_mpi_processes=nb_mpi_processes,
omp_num_threads=1,
idempotent=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment