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

ENH: Ignore n_jobs in config if flags specifying single recording are passed #1023

Open
berkgercek opened this issue Nov 14, 2024 · 2 comments

Comments

@berkgercek
Copy link

Describe the new feature or enhancement

Currently when n_jobs is specified in the config file and is not 1, processes are restricted to use only 1 core even when the command mne_bids_pipeline is called with the --subject MySub flag, and only one subject is being processed. It would be nice if, should the command-level override be passed, the n_jobs parameter would also be ignored and a single python process run that has access to all available cores.

Describe your proposed implementation

mne_bids_pipeline --config myconf.py should respect the n_jobs: int parameter in myconf.py

mne_bids_pipeline --config myconf.py --subject MySub --session 01 --task MyTask should ignore the n_jobs parameter and implicitly set n_jobs = 1

possibly: mne_bids_pipeline --config myconf.py --subject MySub --task MyTask should respect the n_jobs parameter to process sessions in parallel, or tasks in parallel should there be one session specified and multiple possible tasks. My use case only has one session and task per subject so I'm not sure of the mechanics here.

Describe possible alternatives

The current solution is to also set the flag --n_jobs 1 when calling with a single subject/session/task, which is more explicit but causes possible confusion when omitted as the pipeline will only use a single core despite processing a single datum.

Copy link

welcome bot commented Nov 14, 2024

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

@berkgercek berkgercek changed the title Ignore n_jobs in config if --subject flag is passed ENH: Ignore n_jobs in config if --subject flag is passed Nov 14, 2024
@berkgercek berkgercek changed the title ENH: Ignore n_jobs in config if --subject flag is passed ENH: Ignore n_jobs in config if flags specifying single recording are passed Nov 14, 2024
@hoechenberger
Copy link
Member

Parallelization is hard, this will require quite some thinking and fiddling, I'm afraid. But I would welcome such a change

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

No branches or pull requests

2 participants