Performance and profiling of OpenMP C++ code in VS107
up vote
0
down vote
favorite
I have a performance critical piece of C++ code running in Visual Studio 2017 that I've been profiling to look for potential bottlenecks. The profiler at a high level shows about 80% CPU usage across my eight cores executing this code. Having loaded in all the kernel symbols, the profiler shows that the busiest function is NTYieldExecution at 52% usage.
My guess is that this 52% is not correct, possibly 52% of one thread, but even then I'd be keen to know what's going on under the hood. I also have my own thread pool code which lead to 100% CPU usage on other code, so I'm wondering whether to move this code to an alternative multi-threading model. OpenMP is very convenient, but is it inefficient in Visual Studio 2017? More importantly, is it possible to isolate and remove any such inefficiencies?
c++ visual-studio-2017 openmp
add a comment |
up vote
0
down vote
favorite
I have a performance critical piece of C++ code running in Visual Studio 2017 that I've been profiling to look for potential bottlenecks. The profiler at a high level shows about 80% CPU usage across my eight cores executing this code. Having loaded in all the kernel symbols, the profiler shows that the busiest function is NTYieldExecution at 52% usage.
My guess is that this 52% is not correct, possibly 52% of one thread, but even then I'd be keen to know what's going on under the hood. I also have my own thread pool code which lead to 100% CPU usage on other code, so I'm wondering whether to move this code to an alternative multi-threading model. OpenMP is very convenient, but is it inefficient in Visual Studio 2017? More importantly, is it possible to isolate and remove any such inefficiencies?
c++ visual-studio-2017 openmp
This call stack looks very strange. It does not seem to contain your code at all. Time spent in openmp runtime or in system libraries.
– VTT
Nov 7 at 10:41
@VTT, it doesn't, which is what leads me to suspect that OpenMP on Visual Studio 2017 may be taking a separate thread of its own, or at least significant CPU usage. That said, the section of call tree which includes my own code is listed as 14.5% usage, which I also suspect is totally incorrect. I know this because if I run the same code without OMP enabled it is about 5-6 times slower.
– SmacL
Nov 7 at 10:58
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a performance critical piece of C++ code running in Visual Studio 2017 that I've been profiling to look for potential bottlenecks. The profiler at a high level shows about 80% CPU usage across my eight cores executing this code. Having loaded in all the kernel symbols, the profiler shows that the busiest function is NTYieldExecution at 52% usage.
My guess is that this 52% is not correct, possibly 52% of one thread, but even then I'd be keen to know what's going on under the hood. I also have my own thread pool code which lead to 100% CPU usage on other code, so I'm wondering whether to move this code to an alternative multi-threading model. OpenMP is very convenient, but is it inefficient in Visual Studio 2017? More importantly, is it possible to isolate and remove any such inefficiencies?
c++ visual-studio-2017 openmp
I have a performance critical piece of C++ code running in Visual Studio 2017 that I've been profiling to look for potential bottlenecks. The profiler at a high level shows about 80% CPU usage across my eight cores executing this code. Having loaded in all the kernel symbols, the profiler shows that the busiest function is NTYieldExecution at 52% usage.
My guess is that this 52% is not correct, possibly 52% of one thread, but even then I'd be keen to know what's going on under the hood. I also have my own thread pool code which lead to 100% CPU usage on other code, so I'm wondering whether to move this code to an alternative multi-threading model. OpenMP is very convenient, but is it inefficient in Visual Studio 2017? More importantly, is it possible to isolate and remove any such inefficiencies?
c++ visual-studio-2017 openmp
c++ visual-studio-2017 openmp
asked Nov 7 at 10:24
SmacL
16.4k1075137
16.4k1075137
This call stack looks very strange. It does not seem to contain your code at all. Time spent in openmp runtime or in system libraries.
– VTT
Nov 7 at 10:41
@VTT, it doesn't, which is what leads me to suspect that OpenMP on Visual Studio 2017 may be taking a separate thread of its own, or at least significant CPU usage. That said, the section of call tree which includes my own code is listed as 14.5% usage, which I also suspect is totally incorrect. I know this because if I run the same code without OMP enabled it is about 5-6 times slower.
– SmacL
Nov 7 at 10:58
add a comment |
This call stack looks very strange. It does not seem to contain your code at all. Time spent in openmp runtime or in system libraries.
– VTT
Nov 7 at 10:41
@VTT, it doesn't, which is what leads me to suspect that OpenMP on Visual Studio 2017 may be taking a separate thread of its own, or at least significant CPU usage. That said, the section of call tree which includes my own code is listed as 14.5% usage, which I also suspect is totally incorrect. I know this because if I run the same code without OMP enabled it is about 5-6 times slower.
– SmacL
Nov 7 at 10:58
This call stack looks very strange. It does not seem to contain your code at all. Time spent in openmp runtime or in system libraries.
– VTT
Nov 7 at 10:41
This call stack looks very strange. It does not seem to contain your code at all. Time spent in openmp runtime or in system libraries.
– VTT
Nov 7 at 10:41
@VTT, it doesn't, which is what leads me to suspect that OpenMP on Visual Studio 2017 may be taking a separate thread of its own, or at least significant CPU usage. That said, the section of call tree which includes my own code is listed as 14.5% usage, which I also suspect is totally incorrect. I know this because if I run the same code without OMP enabled it is about 5-6 times slower.
– SmacL
Nov 7 at 10:58
@VTT, it doesn't, which is what leads me to suspect that OpenMP on Visual Studio 2017 may be taking a separate thread of its own, or at least significant CPU usage. That said, the section of call tree which includes my own code is listed as 14.5% usage, which I also suspect is totally incorrect. I know this because if I run the same code without OMP enabled it is about 5-6 times slower.
– SmacL
Nov 7 at 10:58
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187550%2fperformance-and-profiling-of-openmp-c-code-in-vs107%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
This call stack looks very strange. It does not seem to contain your code at all. Time spent in openmp runtime or in system libraries.
– VTT
Nov 7 at 10:41
@VTT, it doesn't, which is what leads me to suspect that OpenMP on Visual Studio 2017 may be taking a separate thread of its own, or at least significant CPU usage. That said, the section of call tree which includes my own code is listed as 14.5% usage, which I also suspect is totally incorrect. I know this because if I run the same code without OMP enabled it is about 5-6 times slower.
– SmacL
Nov 7 at 10:58