ISISNeutronMuon / MDANSE

MDANSE: Molecular Dynamics Analysis for Neutron Scattering Experiments
https://www.isis.stfc.ac.uk/Pages/MDANSEproject.aspx
GNU General Public License v3.0
18 stars 4 forks source link

Multiprocessing jobs #452

Closed MBartkowiakSTFC closed 2 weeks ago

MBartkowiakSTFC commented 1 month ago

Description of work At the moment, multicore jobs work, but do not report progress correctly, and cannot be aborted from the GUI. This PR adds a mechanism for aborting multicore jobs, and changes the way progress is reported for multicore jobs.

closes #447 closes #361

Fixes

  1. Added an extra Event (end_event) to the JobStatus. This is checked by a running job, and can be used to abort a job
  2. Added a new method to Status, which allows a Job to report progress directly from the main thread and not from subprocesses. The progress is now the size of the output queue.
  3. Set OMP_NUM_THREADS to 1 in the GUI launcher, suppressing numpy multithreading.

To test Run a job using multiple cores. Check if the progress is updated correctly. Run a long job using multiple cores. Abort it before it finishes, and confirm that every child process terminates eventually, without being killed manually by the user. (For slower jobs this may take some time, but should happen eventually).

ChiCheng45 commented 1 month ago

The progress update and the terminate seem to kill most of the child processes.

However, it looks like there is still one more child process that it doesn't kill. Not sure if I needed to wait longer but I gave it a few minutes.

image

Also, I noticed that the MSD job goes to 100% then 0% then back to 100%. I guess this the multiprocessing version of #361.

Animation19

MBartkowiakSTFC commented 2 weeks ago

This PR will be replaced by #471