Closed ZeugAusHH closed 7 months ago
Really nice addition. I would change that each core has the loop with 1 second sleep and then do a MPI-Broadcast from the root node to either wait another second or continue the execution.
I have a code block that does that somewhere in my files. When I find it, I'll file another pull request to replace the busy waiting.
If I remember correctly, I think I used MPI_Isend
/MPI_Irecv
or so and periodic calls to MPI_Test
(with sleeps between).
Arriving at the newly introduced command block
&simple_handshake
(in the moment it has no parameters), the fileg4_hs.wait
is generated and the simulation process waits. Once the fileg4_hs.resume
appears in the working directory of the simulation run, the simulation resumes.Currently this function is useful mainly for testing and debugging. Provided the capability to replace already existing fields is added to GENESIS (it appears that only a few modifications and checks have to be added to field loading code), this could for instance be used to propagate the dumped light field through a complex optical system with external software and then continue the GENESIS simulation with the result of the propagation process.
While in the moment the wait is done with
MPI_Barrier
, resulting in busy waiting (all cores at 100% CPU utilization when executed with OpenMPI), this behavior could be changed in the future.