Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF5 fluxes file not written during a set of parallel simulations #1313

Open
ilicog opened this issue Aug 12, 2020 · 1 comment
Open

HDF5 fluxes file not written during a set of parallel simulations #1313

ilicog opened this issue Aug 12, 2020 · 1 comment

Comments

@ilicog
Copy link

ilicog commented Aug 12, 2020

When running a set of parallel meep simulations, HDF5 flux output won't write when the sim.use_output_directory options is specified. MWE below:

import meep as mp

def main(group):
    a = 1
    tabs = 2
    tair = 2
    sz = 2*(tabs+tair)
    cell_size = mp.Vector3(a,a,sz)

    pml_layers = [mp.PML(thickness=tabs,direction=mp.Z,side=mp.High),
                  mp.Absorber(thickness=tabs,direction=mp.Z,side=mp.Low)]

    fcen = 1
    df = 0.5
    geometry = []
    src_pos = 0.5*sz-tabs-0.2*tair
    sources = [ mp.Source(mp.GaussianSource(fcen, fwidth=df), component=mp.Ey, center=mp.Vector3(0,0,src_pos),
                          size=mp.Vector3(a,a,0)) ]
    sim = mp.Simulation(cell_size=cell_size,
                        geometry=geometry,
                        sources=sources,
                        boundary_layers=pml_layers,
                        resolution=10)

    nfreq = 10
    refl = sim.add_flux(fcen, df, nfreq, mp.FluxRegion(center=mp.Vector3(0,0,+0.5*sz-tabs-0.5*tair),size=mp.Vector3(a,a,0)))
    sim.run(until=10)

    sim.use_output_directory("out_{}".format(group)) # <--- this causes issues when Ngroups > 1
    sim.save_flux('refl-flux', refl)
    
Ngroups = 4
group = mp.divide_parallel_processes(Ngroups)

main(group)

This is run via

mpirun -np 12 python test.py

Error message:

creating output file "out_0/test-refl-flux.h5"...
HDF5-DIAG: Error detected in HDF5 (1.10.4) MPI-process 3:
#000: H5F.c line 444 in H5Fcreate(): unable to create file
major: File accessibilty
minor: Unable to open file
#1: H5Fint.c line 1364 in H5F__create(): unable to open file
major: File accessibilty
minor: Unable to open file
#2: H5Fint.c line 1548 in H5F_open(): unable to open file: name = 'out_1/test-refl-flux.h5', tent_flags = 13

When Ngroups=1, the h5 file is written in the output directory just fine.

@ReDoDx09
Copy link

ReDoDx09 commented Jul 8, 2021

Hello @ilicog
did you find the solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants