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: Revise plugin and workflow initialization #983

Merged
merged 5 commits into from
Apr 21, 2022

Conversation

oesteban
Copy link
Member

It seems that confining the workflow creation within an isolated process does not meaningfully help with the VM allocation while increasing the complexity horribly.

On the other hand, the config file has been made considerably more lightweight by using importlib metadata to check versions instead of importing packages, and the plugin instance (MultiProc and LegacyMultiProc) are now created at earlier states so workers are initialized with smaller memory fingerprint.

@oesteban oesteban requested review from effigies and mgxd April 20, 2022 08:59
@oesteban
Copy link
Member Author

@mgxd and @effigies - I thought looking through this could be of your interest for fMRIPrep.

mriqc/config.py Outdated Show resolved Hide resolved
mriqc/cli/run.py Outdated Show resolved Hide resolved
_plugin = {
"plugin": Plugin(plugin_args=config.nipype.plugin_args),
}
gc.collect()
Copy link
Member

Choose a reason for hiding this comment

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

What is this collecting that doesn't get cleaned up on L95?

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 don't know what L95 could be possibly be collecting so... this is to say, I'm happy either way and maybe there are some unused variables in the plugin implementation that this would catch. Honestly, IDK. Happy to remove if it feels superfluous.

oesteban and others added 3 commits April 20, 2022 18:18
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu>
@pep8speaks
Copy link

pep8speaks commented Apr 20, 2022

Hello @oesteban, Thank you for updating!

Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, pip install flake8 and then run flake8 niworkflows.

Comment last updated at 2022-04-20 19:18:45 UTC

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Looks good. I think you could probably safely remove the garbage collection calls at this point, but no harm in keeping them in.

@oesteban oesteban merged commit 9fa756d into master Apr 21, 2022
@oesteban oesteban deleted the enh/early-multiproc-creation branch April 21, 2022 07:24
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.

3 participants