Skip to content

By default, propagate Base.active_project(), Base.LOAD_PATH, and Base.DEPOT_PATH to the workers (but allow the user to override that behavior by specifying JULIA_{PROJECT,LOAD_PATH,DEPOT_PATH} in params[:env]) #30

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

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

DilumAluthge
Copy link
Member

@DilumAluthge DilumAluthge commented Dec 31, 2024

Fixes #16.
Alternative to #17 (closes #17).
Alternative to #19 (closes #19).

Depends on:

@DilumAluthge
Copy link
Member Author

This PR depends on #20. #20 should be merged first.

@DilumAluthge DilumAluthge changed the title By default, propagate Base.active_project(), Base.LOAD_PATH, and Base.DEPOT_PATH to the workers (but allow the user to override that behavior by specifying JULIA_{PROJECT,LOAD_PATH,DEPOT_PATH} in params[:env] By default, propagate Base.active_project(), Base.LOAD_PATH, and Base.DEPOT_PATH to the workers (but allow the user to override that behavior by specifying JULIA_{PROJECT,LOAD_PATH,DEPOT_PATH} in params[:env]) Jan 1, 2025
@MilesCranmer
Copy link

Ping on this as well. @kleinhenz could this be merged when you have a chance? I'm really eager to try this out for PySR.

@DilumAluthge
Copy link
Member Author

I think I'll need to rebase this, but after that I think this should be good to go. I'll try to get to this later this week.

@DilumAluthge DilumAluthge marked this pull request as ready for review January 15, 2025 22:24
@DilumAluthge
Copy link
Member Author

Alright, I've rebased this one.

@kleinhenz This one should be ready for review now.

user_did_specify_JULIA_PROJECT = false
user_did_specify_JULIA_LOAD_PATH = false
user_did_specify_JULIA_DEPOT_PATH = false

for (name, value) in pairs(params_env)
# For each key-value mapping in `params[:env]`, we respect that mapping and we pass it
# to the workers.
env2[name] = value
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I think this would be slightly clearer if we refactored to use merge and haskey instead of explicitly looping over keys.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've done some refactoring (0bde517). I got rid of the loop over key-value pairs. Instead of using merge() with an empty Dict, I just did a copy(). However, if desired, I'm happy to instead construct an empty Dict and then do a merge().

And I added haskey()s for the places where we check if the keys exist.

@DilumAluthge
Copy link
Member Author

@kleinhenz Would you mind making a new release of SlurmClusterManager.jl before we merge this PR? That way, if this PR breaks anyone's existing workflows, they can just pin to the previous release.

@DilumAluthge
Copy link
Member Author

I'll convert to draft just so that we don't accidentally merge this until we make a release first.

@DilumAluthge DilumAluthge marked this pull request as draft January 17, 2025 00:00
@kleinhenz
Copy link
Collaborator

Just made a new release.

…`Base.DEPOT_PATH` to the workers (but allow the user to override that behavior by specifying `JULIA_{PROJECT,LOAD_PATH,DEPOT_PATH}` in `params[:env]`)
@DilumAluthge DilumAluthge marked this pull request as ready for review January 20, 2025 20:58
@DilumAluthge
Copy link
Member Author

Alright, @kleinhenz this is ready for another round of review.

@DilumAluthge
Copy link
Member Author

Bump @kleinhenz

@kleinhenz kleinhenz merged commit 4798f3f into JuliaParallel:master Jan 26, 2025
4 checks passed
@kleinhenz
Copy link
Collaborator

looks good to me, thanks!

@DilumAluthge DilumAluthge deleted the dpa/project-depot-loadpath branch January 26, 2025 20:05
@DilumAluthge
Copy link
Member Author

Thanks so much @kleinhenz!

Can you register a new release?

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.

addprocs does not activate workers in current project
3 participants