3.4.2. Adding a new task

When a thread adds a new task, either as a consequence of AMR on the same rank, or because of AMR on another rank, or because of load balancing, it takes these actions:

  • Adds an nbor list to the task link

  • Cause the new task to be added to the nbor lists of the nbors, by calling list_t%set_init_nbors(), which sets bits%init_nbors in all nbor tasks.

  • Increments the task total and task level counts on the rank

  • Calls check_nbors() on the new task link, which runs check_ready() on all the nbors first, and finally runs check_ready() on the task link itself.

These actions are taken in a procedure list_t%add_new_task() that is called from both the AMR procedure that created new tasks, and from the task_mesg_t%unpack() procedure that creates virtual copies of new tasks.