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

feat: allow threads as input #103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ven-k
Copy link

@ven-k ven-k commented Mar 28, 2024

No description provided.

@ven-k ven-k requested a review from a team as a code owner March 28, 2024 14:14
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (3a055a9) to head (876ad3d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #103   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines            2         2           
=========================================
  Hits             2         2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

action.yml Outdated
@@ -35,6 +35,10 @@ inputs:
compiled_modules:
description: 'Whether to run tests with `compiled-modules`. For possible values, refer to https://docs.julialang.org/en/v1/manual/command-line-interface/#command-line-interface'
default: 'yes'
threads:
description: 'Value passed to the --threads flag. Default value: auto.'
default: 'auto'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto isn't the julia default unfortunately, so this will need to be a bit cleverer. Basically not set the arg by default

Copy link
Author

@ven-k ven-k Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah.
This might suffice:
default: "${JULIA_NUM_THREADS:=1}"

Or I can do a

if [[ -n ${{ input.threads }} ]]; then
   julia ... --threads ${{ input.threads }} -e ...
else
   julia ...
fi

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to populate a var for the threads arg and interpolate it in, as if any other args need the same behavior different if paths for the top level cmd would make for a mess of if statements

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I meant a different approach like threads_arg = inputs.threads == "default" ? "" : "--threads=${{ inputs.threads}}

Then interpolate threads_arg into the cmd, making use of it being empty to avoid setting the arg

@ven-k
Copy link
Author

ven-k commented Mar 28, 2024

Looks like --threads wasn't allowed in Julia 1.0.5.

I suppose, we would want to avoid a version based statement. So, instead of this, setting JULIA_NUM_THREADS in env is the best way.

@ven-k ven-k closed this Mar 28, 2024
@ven-k ven-k reopened this Mar 28, 2024
@ven-k ven-k force-pushed the patch-1 branch 2 times, most recently from 90693c8 to 6d8e68b Compare March 28, 2024 16:21
@ven-k ven-k marked this pull request as draft March 28, 2024 16:24
@ven-k ven-k marked this pull request as ready for review March 28, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants