Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State of Parallel Gibbon #266

Open
ulysses4ever opened this issue Jul 8, 2024 · 1 comment
Open

State of Parallel Gibbon #266

ulysses4ever opened this issue Jul 8, 2024 · 1 comment
Labels
discussion parallelism Tasks related to adding parallelism/heartbeat to the compiler.

Comments

@ulysses4ever
Copy link
Collaborator

At the last group meeting, we discussed the issue with Parallel Gibbon relying on the Cilk library, which is not as easily available as it once used to be when it was a part of the GCC 7 distribution. As a consequence of this Cilk issue, we don't test anything about Parallel Gibbon in CI.

Our options for modernizing Parallel Gibbon and liberating from the GCCV 7 dependency seem to be:

  • Switch to the successor of Cilk Plus -- OpenCilk
    • Seemingly the most straightforward option but there's a catch: it's huge and compiling it means, among other things, compiling (a fork of) LLVM. Also, it's not packaged in nixpkgs , see Package request: OpenCilk NixOS/nixpkgs#144256
  • Switch to a Cilk alternative that's lighter than OpenCilk. E.g
  • Do nothing and wait until OpenCilk becomes more approachable
  • Roll out our own work-stealing task parallelism on top of Pthreads or similar. May be a good student project.

@vollmerm regarding the issue with observing steals that you mentioned: I dived a little into the implementation, and it looks like the current way to observe steals is to record the thread ID (and the ICFP'21 paper confirms it):

pure $ LetE (cont_id, [], IntTy, Ext GetCilkWorkerNum) $
LetE (not_stolen, [], BoolTy, PrimAppE EqIntP [VarE cont_id, VarE parent_id]) $
IfE (VarE not_stolen)
(Ext $ LetAvail [v] $
Ext $ LetLocE loc (AfterVariableLE v loc2 False) bod2) -- don't allocate in a fresh region
(Ext $ LetParRegionE newreg Undefined Nothing $ Ext $ LetLocE newloc (StartOfRegionLE newreg) bod1)

Getting the thread ID seems like a pretty basic operation that most alternatives would be capable of (e.g. OpenMP has omp_get_thread_num) Is that right?

/cc @ckoparkar @rrnewton

@ulysses4ever ulysses4ever added discussion parallelism Tasks related to adding parallelism/heartbeat to the compiler. labels Jul 8, 2024
@vollmerm
Copy link
Contributor

vollmerm commented Jul 9, 2024

👍 on just using OpenMP, since we only need to compare the thread number. We can use the OpenMP task pragma: https://www.ibm.com/docs/en/zos/3.1.0?topic=processing-pragma-omp-task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion parallelism Tasks related to adding parallelism/heartbeat to the compiler.
Projects
None yet
Development

No branches or pull requests

2 participants