Skip to content

ENH: Profile VMS as well as RSS #2331

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 4 commits into from
Dec 6, 2017
Merged

ENH: Profile VMS as well as RSS #2331

merged 4 commits into from
Dec 6, 2017

Conversation

effigies
Copy link
Member

@effigies effigies commented Dec 4, 2017

Given that some systems are limited on virtual memory allocation, and not actual memory consumption, being able to profile both memory metrics would be useful

@effigies effigies requested a review from oesteban December 4, 2017 17:20
@effigies effigies changed the title ENH: Profile VMS as well as RMS ENH: Profile VMS as well as RSS Dec 4, 2017
Copy link
Contributor

@oesteban oesteban left a comment

Choose a reason for hiding this comment

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

Very much needed 👍

'cpus': vals[:, 2].tolist(),
'vms_gb': (vals[:, 3] / 1024).tolist(),
Copy link
Member

Choose a reason for hiding this comment

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

just a nitpick here - should we make the gb be gib or GiB to maintain consistency with the term Gibibytes.

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 guess I'd either prefer GiB (since gib does not say "gibibyte" to me) or just to switch to decimal factors and keep variable names as gb. I'm not sure whether changing the variable name or the log base would be least disruptive, so I'll leave that to your call @oesteban @satra.

Copy link
Member

Choose a reason for hiding this comment

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

i think both are disruptive. since more people will use the name, i think changing the name ensures that people using it accounts for it. changing the log base implies that people using it may interpret the data incorrectly. it's possible this is already happening.

my vote would be for changing the name.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think there are a critical mass of people to maintain a name that poorly represents the concept. Let's change it to GiB before more people start using the monitor, following @effigies preference 👍 .

@effigies
Copy link
Member Author

effigies commented Dec 5, 2017

I'm leaving alone non-profiler uses of _gb, as these go pretty deep and will definitely break people's code when annotating their nodes. That refactor will need a deprecation schedule and may be better to do post-1.0.

except psutil.NoSuchProcess:
pass

print('%f,%f,%f' % (time(), (mem / _MB), cpu),
print('%f,%f,%f,%f' % (time(), rss / _MB, cpu, vms / _MB),
Copy link
Contributor

Choose a reason for hiding this comment

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

a little nitpick here: maybe best putting cpu right after the timestamp? - sorry I didn't suggest this in the first round.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. I was trying to leave anything that depends on the old columns usable, but I agree that I'd rather have time,cpu,rss,vms.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's make the change now, better than after people start using this for real.

@effigies
Copy link
Member Author

effigies commented Dec 5, 2017

@oesteban What do you think about moving run() to constant-interval instead of constant-wait (as in #2317) here as well?

https://github.com/effigies/nipype/blob/a15e08600798e56bcd616cd81fc8f918e8b1b0c5/nipype/utils/profiler.py#L101-L105

Might as well do it in this PR if we're going to do it.

@oesteban
Copy link
Contributor

oesteban commented Dec 5, 2017

Sounds very good 👍

@oesteban oesteban merged commit 373bddd into nipy:master Dec 6, 2017
@effigies effigies deleted the profile/vms branch December 6, 2017 15:19
@effigies effigies added this to the 1.0 milestone Aug 30, 2018
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