ai2cm / fv3gfs-wrapper

Python wrapper for the FV3-based global climate model
Other
27 stars 3 forks source link

cleanup short-circuits python clean ups. #210

Open nbren12 opened 3 years ago

nbren12 commented 3 years ago

I think calling fv3gfs.wrapper.cleanup short-circuits python's cleanup routines. For example, I think it can skip the __del__ of non-garbage-collected python objects (see e.g. https://github.com/VulcanClimateModeling/fv3net/pull/907).

mcgibbon commented 3 years ago

There's a possibility this is due to fv3gfs.wrapper.cleanup calling MPI's Finalize, which then causes mpi4py to crash when it also calls Finalize. This would short-circuit any cleanup routines which happened to be scheduled for after mpi4py's cleanup.

I wonder whether this issue still happens when using mpirun python3 -m mpi4py <script> instead of mpirun python3 <script>.

nbren12 commented 3 years ago

I think we would need to develop a short test since there is too much going on in the fv3net runfile to narrow it down.