public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Janne Blomqvist <blomqvist.janne@gmail.com>
To: 김규래 <msca8h@naver.com>
Cc: gcc mailing list <gcc@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [GSoC'19, libgomp work-stealing] Task parallelism runtime
Date: Wed, 05 Jun 2019 20:36:00 -0000	[thread overview]
Message-ID: <CAO9iq9EpiAaS1mMRoyeffJ=h6k-H_xtA4Z9rKPf5DPeLbtZhMQ@mail.gmail.com> (raw)
In-Reply-To: <eac1d7f8a21f43e595d8778f8065a445@cweb018.nm.nfra.io>

On Wed, Jun 5, 2019 at 10:42 PM 김규래 <msca8h@naver.com> wrote:

> > On Wed, Jun 5, 2019 at 9:25 PM 김규래 <msca8h@naver.com> wrote:
>
> >
> > > Hi, thanks for the detailed explanation.
> > > I think I now get the picture.
> > > Judging from my current understanding, the task-parallelism currently
> works as follows:
> > > 1. Tasks are placed in a global shared queue.
> > > 2. Workers consume the tasks by bashing the queue in a while loop,
> just as self-scheduling (dynamic scheduling)/
> > >
> > > Then the improvements including work-stealing must be done by:
> > > 1. Each worker holds a dedicated task queue reducing the resource
> contention.
> > > 2. The tasks are distributed in a round-robin fashion
>
> > For nested task submission (does OpenMP support that?) you probably
> > want to submit to the local queue rather than round-robin, no?
>
>
>
> Hi Janne,
>
> I believe you're talking about spawning child tasks within an already
> running task, which I believe is supported by OpenMP.
>
> In this case, pushing to the local queue could introduce a deadlock if the
> master thread waits on the spawned tasks.
>
> A short one though since work-stealing can resolve the deadlock.
>
> A better way to handle this is to round-robin the child tasks to the
> queues excluding the queue of the thread consuming the current task.
>
> Then waiting on the tasks should never cause a deadlock.
>
> Or did I misunderstand your question?
>
> Maybe there is a specific reason for avoiding avoid round-robin that I
> missed?
>
Better cache locality.

Another option, which I guess starts to go out of scope of your gsoc, is
parallel depth first (PDF) search (Blelloch 1999) as an alternative to work
stealing. Here's a presentation about some recent work in this area,
although for Julia and not OpenMP (no idea if PDF would fit with OpenMP at
all): https://www.youtube.com/watch?v=YdiZa0Y3F3c

-- 
Janne Blomqvist

  reply	other threads:[~2019-06-05 20:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 18:01 김규래
2019-06-03 18:21 ` Jakub Jelinek
2019-06-05 18:25   ` 김규래
2019-06-05 18:52     ` Jakub Jelinek
2019-06-05 19:06     ` Janne Blomqvist
2019-06-05 19:42       ` 김규래
2019-06-05 20:36         ` Janne Blomqvist [this message]
2019-06-06 17:54           ` 김규래
     [not found] <e2a9f7c55311795785d0f2c47f70acbd@cweb001.nm.nfra.io>
2019-06-24 19:55 ` 김규래
2019-07-09 12:56 ` 김규래

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAO9iq9EpiAaS1mMRoyeffJ=h6k-H_xtA4Z9rKPf5DPeLbtZhMQ@mail.gmail.com' \
    --to=blomqvist.janne@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=msca8h@naver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).