You can add an atexit hook which is called when Julia shuts down.
Note that, for this specific example, MPI.Init() adds this hook by default for you, see MPI.jl/src/environment.jl.
You can add an atexit hook which is called when Julia shuts down.
Note that, for this specific example, MPI.Init() adds this hook by default for you, see MPI.jl/src/environment.jl.