[Tutor] Multiprocessing with many input input parameters

Shall, Sydney sydney.shall at kcl.ac.uk
Wed Jul 10 11:43:55 EDT 2019


I am using MAC OS X 10.14.5 on a MAC iBook
I use Python 3.7.0 from Anaconda, with Spyder 3.3.3

I am a relative beginner.

My program models cell reproduction. I have written a program that models this and it works.

Now I want to model a tissue with several types of cells. I did this by simply rerunning the program with different inputs (cell characteristics). But now I want to send and receive signals between the cells in each population. This requires some sort of concurrent processing with halts at appropriate points to pass and receive signals.

I thought to use multiprocessing. I have read the documentation and reproduced the models in the docs. But I cannot figure out how to feed in the data for multiple parameters.

I have tried using Pool and it works fine, but I can only get it to accept 1 input parameter, although multiple data inputs with one parameter works nicely.

So, my questions are;

  1.  Is multiprocessing the suitable choice.
  2.  if yes, how does one write a function with multiple input parameters.

Thank s in advance.

Sydney

Prodessor. Sydney Shall
Department of Haematological Medicine
King's College London
123 Coldharbour Lane
London SE5 9NU
ENGLAND
E-Mail: sydney.shall
(Correspondents outside the College should add @KCL.AC.UK)
TEL: +44 (0)208 48 59 01


More information about the Tutor mailing list