Hello Hui --

It's interesting that you should ask about this right now!

I was just working yesterday on simplifying this code.  The fifo tasking
layer is not our default and normally I wouldn't spend much time on it.
But because if the way it is coded to use both a task list and a task
pool, it requires all four of the tasking layer interface functions that
initiate a the tasks for a Chapel parallel construct:
  chpl_task_addToTaskList()
  chpl_task_processTaskList()
  chpl_task_executeTasksInList()
  chpl_task_freeTaskList()

What I am working on is to get rid of the task list, which will let us
get rid of at least 2 and perhaps 3 of the above functions, simplifying
task management a lot.  (If you look at the Qthreads and massivethreads
tasking layers you can see that they only need addToTaskList(); the
others are empty functions.)

Basically, the task pool holds descriptors for the tasks that are
waiting to start, and the task list holds very similar descriptors for
the tasks that will constitute an upcoming parallel construct.  The main
purpose of the task list in fifo is really to optimize execution by
causing the thread hosting the parent task of a parallel construct to be
proactive in executing the children which make up that construct, while
the parent task is waiting for the parallel construct to complete.  In
essence, it allows the fifo tasking layer to execute parallel constructs
using something similar to LIFO task scheduling, even though the overall
scheduling algorithm is FIFO (hance the name).

As I said, I'm currently working on simplfying this code, and you can
expect to see the result of that work soon after the first of the new
year.

greg



On Wed, 23 Dec 2015, Hui Zhang wrote:

Hello,

I'm a little confused of two structs that Chapel runtime uses: chpl_task_list
and task_pool_struct: the definitions are in:
chapel/runtime/src/tasks/fifo/tasks-fifo.c


​When there's parallel block, it creates​ tasks and add them to the task list,
then somehow later, thread get task from the task_pool, so why runtime needs to
manipulate tasks between list and pool ? and What's the difference between them
?

thanks ![cleardot.gif]


--
Best regards


Hui Zhang

------------------------------------------------------------------------------
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to