As I understand it, magma can be called in a multiprocessing environment as long as initialization and finalization are done after all processes have finished.
However, trying to call magma_zgeev for multiple processes (with locking) generates exceptions
Error in magma_getdevice_arch: MAGMA not initialized (call magma_init() first) or bad device
Process Process-2:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/daneel/PycharmProjects/floquet_theory/run_parallel_tasks.py", line 123, in get_eigsys
w, v = gpu_eig(lock, mat, left=False, right=True)
File "/home/daneel/PycharmProjects/floquet_theory/run_parallel_tasks.py", line 99, in gpu_eig
work.ctypes.data, lwork, rwork.ctypes.data)
File "/home/daneel/.local/lib/python3.6/site-packages/skcuda/magma.py", line 2699, in magma_zgeev
magmaCheckStatus(status)
File "/home/daneel/.local/lib/python3.6/site-packages/skcuda/magma.py", line 64, in magmaCheckStatus
raise MagmaError(status)
skcuda.magma.MagmaError: b'cannot allocate memory on GPU device' (Code: -113)
Process finished with exit code 0