amirakbarnejad

button button

Section 7: PyDmed Process Tree

PyDmed is implemented using python multiprocessing. You don’t need to know about multiprocessing. But this section introduces some general variables so that you can get the best performance from PyDmed based on your machine (s).

The hierarchy of processes

The below figure illustrates the process tree of PyDmed.

PyDmed process tree

Each BigChunkLoader is a child (i.e. subprocess) of a SmallChunkCollector. Once the BigChunk is loaded, the BigChunkLoader iteself is terminated. But the parent SmallChunkCollector will continue working on the BigChunk.

Each SmallChunkCollector (and its child BigChunkLoader) correspond to one Patient. Indeed, a SmallChunkCollector and the child BigChunkLoader work on a specific Patient. Moreover, the dataloader makes sure that at all times at most one active SmallChunkCollector works on a specific Patient.

Life Cycle of Subprocesses

In regular intervals:

  1. The scheduler selects a patient from the dataset.
  2. A BigChunkLoader extracts a big chunk from the patient’s records. The BigChunkLoader has access to the patient by self.patient.
  3. The extracted big chunk is passed to a SmallChunkCollector. The SmallChunkCollector has access to the patient by self.patient.

Tailoring the dataloader to your machine (s)

sample output 1

The parameters of the dataloader are managed by a dictionary called const_global_info. It has the following fields:

As we saw in section 2 we can use the default const_global_info as follows:

const_global_info =\
    pydmed.lightdl.get_default_constglobinf()

Here are some points that may help you customize const_global_info:

button button