DISPATCH
|
Execute a task list. Since only the master thread is calling check_mpi(), we need to make sure that it handles all send/recv, hence send_priv=.false. and recv_priv=.false., and we can use the simplest receive mechanism (recv_active =.true.), with no buffering needed (queue_unpack=.false.). These values are imposed after the input namelists are read, to make sure the choices are correct. More...
Data Types | |
type | dispatcher3_t |
Variables | |
integer | n_fail =0 |
type(dispatcher3_t), public | dispatcher3 |
Execute a task list. Since only the master thread is calling check_mpi(), we need to make sure that it handles all send/recv, hence send_priv=.false. and recv_priv=.false., and we can use the simplest receive mechanism (recv_active =.true.), with no buffering needed (queue_unpack=.false.). These values are imposed after the input namelists are read, to make sure the choices are correct.
Strategy: Keep track of, separately, the number of ready tasks, the number of currently spawned tasks, and the number of currently busy tasks. To this end, define the following states:
state=0: task is inactive or new state=1: the task is ready to update, but not yet spawned state=2: the task has been spawned state=3: the task is busy updating state=4: the task has finished updating
The simplest strategy for counting is to keep track of the number of tasks in each state, by incrementing the count for the new state and decrementing the count for the old state, whenever the state changes. These counts should be part of the dispatcher data type.