stan-dev / stan-dev/cmdstan

Parallelize gcc lto

Open
#1,224 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
238
Forks
106
Avg merge
2h 29m
Merged PRs (30d)
6

Description

gcc allows passing the number of threads for parallelization to use at link time with LTO. Since gcc 10.x this can be set automatically with -flto=auto which will use either GNU Make's job server or fallback to detecting the number of available CPU threads (see the gcc documentation)

An additional ifeq check can be added to makefile around line 74. This will silence the lto-wrapper warning that currently pops up about serial compilation of LTRANS jobs when compiling with gcc and STAN_CPP_OPTIMS enabled and hopefully decrease the linking time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in makefile around line 74 and review the GCC LTO options described in the linked GCC documentation. Check the build path used when STAN_CPP_OPTIMS is enabled, then verify with GCC that the LTRANS serial-compilation warning is silenced and linking uses parallelism.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.