Run method with an option to pass data back to the parent process when running
in Python multiprocessing mode. If the user does not want to share data with
the parent process, this function can be overriden with run(self)
or run(self, *args) as long as self.state = None.
If self.state points to anything but None, the user must use
`run(self, *args).

Notes

When in multiprocessing, *args has two elements: comm_idx and comm_state.
To pass back the state of the module, the user should insert the provided
index comm_idx and the state into the queue as follows:

arg[1] (multiprocessing.Queue) – When using the Python multiprocessing library state_comm must have
the module’s self.state in it. That is,
state_comm.put((idx_comm,self.state)) must be the last command in the
method before return. In addition, self.state must be pickle-able.