-
Notifications
You must be signed in to change notification settings - Fork 530
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
FIX: Restore generate_gantt_chart functionality #3290
base: master
Are you sure you want to change the base?
Conversation
* exclude nodes without timing information from Gantt chart * fall back on "id" or empty string if no "name" in node
As noted
Originally posted by @ccraddock in FCP-INDI/C-PAC#1404 (comment)
I see the profile uses Originally posted by @shnizzedy in FCP-INDI/C-PAC#1404 (comment)
Originally posted by @shnizzedy in FCP-INDI/C-PAC#1404 (comment) I think the issues of
are related to this PR and issue, but beyond the scope of these changes. C-PAC has its own callback function in which I'm dividing and rounding, so I made no changes regarding |
Codecov Report
@@ Coverage Diff @@
## master #3290 +/- ##
==========================================
+ Coverage 64.70% 68.57% +3.87%
==========================================
Files 302 302
Lines 39869 48743 +8874
Branches 5288 7226 +1938
==========================================
+ Hits 25796 33425 +7629
- Misses 12984 14091 +1107
- Partials 1089 1227 +138
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, though I don't have any experience with this bit of the code. Inclined to merge tomorrow unless someone complains.
My only hesitance is the potentially misleading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just some minor nits.
My only hesitance is the potentially misleading runtime_threads ― maybe that should be fixed before restoring this functionality?
I agree 👍
nipype/utils/draw_gantt_chart.py
Outdated
try: | ||
all_res += float(event[resource]) | ||
except ValueError: | ||
next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next | |
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, good catch! I actually meant
nipype/nipype/utils/draw_gantt_chart.py
Line 147 in 25dd1fc
continue |
nipype/utils/draw_gantt_chart.py
Outdated
try: | ||
all_res -= float(event[resource]) | ||
except ValueError: | ||
next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next | |
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, good catch! I actually meant
nipype/nipype/utils/draw_gantt_chart.py
Line 154 in 25dd1fc
continue |
Co-authored-by: Mathias Goncalves <goncalves.mathias@gmail.com>
Co-authored-by: Mathias Goncalves <goncalves.mathias@gmail.com>
Ref nipy#3290 (comment), nipy#3290 (comment) Co-authored-by: Mathias Goncalves <goncalves.mathias@gmail.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Was this fixed? What needs doing? |
I haven't fixed it (yet at least). The issue is that the chart uses nipype/nipype/utils/profiler.py Line 143 in e9217c2
This leads to thread counts in the hundreds when they're expected to be in the ones, like So I think the "threads" part of these charts should be changed before the chart functionality is restored, either
|
Yeah, seems like we want something like:
|
An existing unit test does nipype/nipype/interfaces/base/tests/test_resource_monitor.py Lines 76 to 78 in 6c06030
which is similar to what we're doing for now in C-PAC: if runtime_threads != 'N/A':
runtime_threads = math.ceil(runtime_threads/100) My concern is that, as I read
― psutil documentation: Process.cpu_percent this number can be a misleading estimate. For example, if a process is using 25% of each of 4 CPUs, I believe this would report 100%, which would reduce to 1 or 2 threads depending on how we're rounding up or not. I'd be happy to learn that either I'm misunderstanding the number or that the number is good enough. |
Summary
Fixes #2982. Maybe fixes #3527.
All tests pass locally. 8/13 jobs pass on Travis. The Travis failures seem unrelated to the changes in this PR.
List of changes proposed in this PR (pull-request)
nipype/nipype/utils/draw_gantt_chart.py
Line 391 in fa65caf
name
, useid
or an empty string forname
instead of crashingstart
andfinish
values like"N/A"
and"Unknown"
nipype/nipype/utils/draw_gantt_chart.py
Lines 144 to 147 in a08ee57
nipype/nipype/utils/draw_gantt_chart.py
Lines 151 to 154 in a08ee57
nipype/nipype/pipeline/plugins/tests/test_callback.py
Lines 66 to 98 in fa65caf
Acknowledgment