Skip to content
Snippets Groups Projects
Commit fc3f0ee4 authored by Moritz Hanke's avatar Moritz Hanke
Browse files

replaces Plotter and NetcdfWriter with Statistics-example in test_multithreading.sh

* matplotlib.pyplot and netCDF4 can have issues with multithreading
parent 94db1818
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
""":"
@TEST_MPI_FALSE@exit 77
@PYTHON@ -c 'import mpi4py, netCDF4' || exit 77
@PYTHON@ -c 'import mpi4py' || exit 77
PYTHONPATH="@abs_top_builddir@/python:$PYTHONPATH"
export PYTHONPATH
......@@ -16,12 +16,13 @@ exec @MPI_LAUNCH@ -n 2 @PYTHON@ "$0"
":"""
import sys
import numpy as np
from datetime import timedelta
from mpi4py import MPI
from yac import YAC
from yac.examples import Driver, NoiseGenerator, Plotter, NetCDF_Writer
from yac.examples import Driver, NoiseGenerator, Statistics
yac = YAC(default_instance=True)
......@@ -36,14 +37,15 @@ if rank == 0:
driver.run(NoiseGenerator(timestep="PT1H"))
elif rank == 1:
driver.run(
NetCDF_Writer(
"test_multithreading.noise1.nc",
timestep=timedelta(hours=1),
gridfile="@top_builddir@/grids/icon_grid_0030_R02B03_G.nc",
Statistics(
variables=[("noisegenerator", "noise_grid", "noise")],
comp_name="statistics_global",
grid_name="stat_grid_global",
),
Plotter(
variables=[("noisegenerator", "noise_grid", "noise")],
outdir="test_multithreading.plots",
Statistics(
variables=[("noisegenerator", "noise_grid", "noise")],
comp_name="statistics_europe",
grid_name="stat_grid_europe",
bounds = [34*np.pi/180, 70*np.pi/180, -16*np.pi/180, 42*np.pi/180]
),
)
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