HERA-Team / hera_sim

Simple simulation code for HERA-like redundant interferometric arrays
Other
16 stars 8 forks source link

hera-sim-vis.py: call MPI.Init() only if neccessary #247

Closed piyanatk closed 1 year ago

piyanatk commented 1 year ago

The current codes below will error with comm not existed at the end of the script in the case that MPI is already initialized. https://github.com/HERA-Team/hera_sim/blob/126ec827a1350855b5b576b06b509f362db19df3/scripts/hera-sim-vis.py#L94-L99

The behavior seems to depend on the nature of the command line (login vs non-login maybe?). Running on a shell will work as expected - MPI is not initialized and the code block is executed. However, executing the script in Jupyter notebook with %run magic command will produce the error because MPI will be initialized.

This is an easy fix. I will add a commit to #237 .