Skip to content

Doc Fix? Setting STAN_THREADS=false (or FALSE, 0, etc) results in STAN_THREADS=true #1293

Description

@katrinabrock

Summary:

As concisely stated in this comment: #1179 (comment)

Most of our makefile logic just checks if STAN_THREADS is defined, not that it is set to a "truthy" value.

However, the documentation does not explicitly state this, leading users (including apparently cmdstanr developers) to incorrectly infer that falsy values will turn off multi-threading.

Description:

Not sure if the behavior should change or the doc should change here, but certainly if the behavior remains as-is, it would be good to make the doc more explicit. This issue likely impacts other flags as well.

It would also be helpful for make help-dev or a similar command to resolve the value to how it will be interpreted at compile time.

Reproducible Steps:

~/.cmdstan/cmdstan-2.35.0$ STAN_THREADS=false make examples/bernoulli/bernoulli
~/.cmdstan/cmdstan-2.35.0$ examples/bernoulli/bernoulli info|grep STAN_THREADS

Current Output:

STAN_THREADS=true

Expected Output:

STAN_THREADS=false

Current Version:

v2.35.0

Activity

  1. WardBrian commented on Aug 20, 2024

    @WardBrian
    Member

    I definitely agree this needs to be explained better!

    Re:

    It would also be helpful for make help-dev or a similar command to resolve the value to how it will be interpreted at compile time.

    You can use make print-compiler-flags to see a lot of good info. In particular, if you set STAN_THREADS, the define is included:

    ...
      - CXXFLAGS_THREADS             -DSTAN_THREADS
    ...
    
  2. katrinabrock commented on Aug 20, 2024

    @katrinabrock
    Author

    ah, thanks! re: make print-compiler-flags

  3. katrinabrock commented on Aug 21, 2024

    @katrinabrock
    Author

    ^ PR for doc fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions