Fix state_phys files using h5py mpio driver
Created originally on Bitbucket by avmo (Ashwin Vishnu)
While an implementation already exists, and it almost seems to work, by running from gfdyn/fluidsim 's fix/hdf5-mpi bookmark, i.e. PR #7 (closed).
$ mpirun -np 2 python fluidsim/solvers/ns2d/solver.py
--------
nb_proc: 2
N0 = 32 ; N1 = 32
Initialization (FFT2DMPIWithFFTWMPI2D) done in 0.046057 s
*************************************
Program fluidsim
sim: <class '__main__.Simul'>
sim.oper: <class 'fluidsim.operators.operators2d.OperatorsPseudoSpectral2D'>
sim.output: <class 'fluidsim.solvers.ns2d.output.Output'>
sim.state: <class 'fluidsim.solvers.ns2d.state.StateNS2D'>
sim.time_stepping: <class 'fluidsim.base.time_stepping.pseudo_spect_cy.TimeSteppingPseudoSpectral'>
sim.init_fields: <class 'fluidsim.solvers.ns2d.init_fields.InitFieldsNS2D'>
solver NS2D, RK4 and parallel (2 proc.)
type fft: fluidfft.fft2d.mpi_with_fftwmpi2d
nx = 32 ; ny = 32
lx = 2pi ; ly = 2pi
path_run =
/scratch/avmo/tmp/tests/NS2D_test_32x32_S2pix2pi_2018-10-23_15-31-19
init_fields.type: dipole
Initialization outputs:
sim.output.phys_fields: <class 'fluidsim.base.output.phys_fields2d.PhysFieldsBase2D'>
sim.output.spectra: <class 'fluidsim.solvers.ns2d.output.spectra.SpectraNS2D'>
sim.output.spectra_multidim: <class 'fluidsim.solvers.ns2d.output.spectra_multidim.SpectraMultiDimNS2D'>
sim.output.increments: <class 'fluidsim.base.output.increments.Increments'>
sim.output.spatial_means: <class 'fluidsim.solvers.ns2d.output.spatial_means.SpatialMeansNS2D'>
sim.output.spect_energy_budg: <class 'fluidsim.solvers.ns2d.output.spect_energy_budget.SpectralEnergyBudgetNS2D'>
Memory usage at the end of init. (equiv. seq.): 195.42578125 Mo
Size of state_spect (equiv. seq.): 0.008704 Mo
*************************************
Beginning of the computation
save state_phys in file state_phys_t000.000.h5
1 writing ux x=16:32, y=0:32, (16, 32)
0 writing ux x=0:16, y=0:32, (16, 32)
0 writing uy x=0:16, y=0:32, (16, 32)
1 writing uy x=16:32, y=0:32, (16, 32)
0 writing rot x=0:16, y=0:32, (16, 32)
1 writing rot x=16:32, y=0:32, (16, 32)
compute until t = 10
it = 0 ; t = 0 ; deltat = 0.12839
energy = 9.578e-02 ; Delta energy = +0.000e+00
The result are empty hdf5 files with no ux, uy, rot arrays. Barely the parameters and info_simul tree are stored.