FABLE-3DXRD / ImageD11

ImageD11 is a python code for identifying individual grains in spotty area detector X-ray diffraction images.

Home Page:https://imaged11.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiprocessing fork changes has broken sinograms/properties

jadball opened this issue · comments

I believe issue #216 is to blame for the following bug when calling ImageD11.sinograms.properties.main():

read ds ds_name
Nscans 1001 NPROC 63
Options {'algorithm': 'lmlabel', 'wtmax': 70000, 'save_overlaps': False}

  0%|          | 0/1063 [00:00<?, ?it/s]Process ForkServerPoolWorker-10:
Traceback (most recent call last):
  File ".../python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File ".../python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File ".../python3.11/multiprocessing/pool.py", line 109, in worker
    initializer(*initargs)
  File ".../ImageD11/sinograms/properties.py", line 709, in process
    scan.motors['omega'] = omega[i]
                           ^^^^^
NameError: name 'omega' is not defined

I feel that the changes to multiprocessing logic caused the global variable omega defined in main() to not be in scope inside process()

Indeed - so this is a bug that needs to be fixed without relying on fork.

Fixed by 6ab3ff8