litebird / litebird_sim

Simulation tools for LiteBIRD
GNU General Public License v3.0
18 stars 13 forks source link

Mbs conflict while using a parallel script #273

Closed nraffuzz closed 6 months ago

nraffuzz commented 9 months ago

When generating a synthetic map with Mbs in a parallel script there is a conflict between different ranks. While more than a rank tries to execute os.remove(self.name), the following error is printed:

File "/marconi/home/userexternal/nraffuzz/.conda/envs/hwp_env/lib/python3.9/site-packages/astropy/io/fits/file.py", line 615, in _open_filename
    os.remove(self.name)
FileNotFoundError: [Errno 2] No such file or directory: '/marconi_scratch/userexternal/nraffuzz/hwp_ns512/cmb/0000/cmb_0000_date_231016.fits'

given that the file exists.

Is it possible that this issue originates from astropy, and if so, is there anything we can do on our end within litebird_sim?

marcobortolami commented 9 months ago

What about generating the maps with rank 0 and then broadcasting them to the other ranks?

nraffuzz commented 9 months ago

That's for sure a workaround, I was wondering if this could be solved differently

ziotom78 commented 9 months ago

Is the call to os.remove placed within AstroPy or PySM? I ran grep on the litebird_sim folder and wasn't able to find any occurrence.