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.
NTYieldExecution 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?










share|improve this question






















  • 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















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.
NTYieldExecution 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?










share|improve this question






















  • 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













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.
NTYieldExecution 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?










share|improve this question













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.
NTYieldExecution 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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()