[cpp]#include
#include
int main () // I have no access to this part
{
//If I had access I can simply add VTPause()
time_t seconds;
while(...)
{
seconds = time (NULL);
// VTResume()
for(...)
printf ("%ld hours since January 1, 1970", seconds/3600);
// VTPause
}
return 0;
}[/cpp]
Link Copied
Not quite right. When using VTune API, you start VTune collection in "paused" mode. This means that VTune doesn't collect any data until program execution reached VTResume() call. After that collection starts and then it goes until reaching VTPause() call. So, you can collect profiling data on any code region within your program, just put VTResume() before and VTPause() after the code of interest.
[cpp]#include
#include
int main () // I have no access to this part
{
//If I had access I can simply add VTPause()
time_t seconds;
while(...)
{
seconds = time (NULL);
// VTResume()
for(...)
printf ("%ld hours since January 1, 1970", seconds/3600);
// VTPause
}
return 0;
}[/cpp]
Hi,
May be I didn't get it what do you mean by saying that you "want to do the opposite of what is written there", but if you put the VTResume()call right before the omp for' pragma and the VTPause() call right after the end of scope, you'll get the sampling results over threads created ror your function. If you interested in measuring performance gain only, you may want to insert only time calls instead.
Hi,
May be I didn't get it what do you mean by saying that you "want to do the opposite of what is written there", but if you put the VTResume()call right before the omp for' pragma and the VTPause() call right after the end of scope, you'll get the sampling results over threads created ror your function. If you interested in measuring performance gain only, you may want to insert only time calls instead.
Hi,
May be I didn't get it what do you mean by saying that you "want to do the opposite of what is written there", but if you put the VTResume()call right before the omp for' pragma and the VTPause() call right after the end of scope, you'll get the sampling results over threads created ror your function. If you interested in measuring performance gain only, you may want to insert only time calls instead.
Not quite right. When using VTune API, you start VTune collection in "paused" mode. This means that VTune doesn't collect any data until program execution reached VTResume() call. After that collection starts and then it goes until reaching VTPause() call. So, you can collect profiling data on any code region within your program, just put VTResume() before and VTPause() after the code of interest.
Not quite right. When using VTune API, you start VTune collection in "paused" mode. This means that VTune doesn't collect any data until program execution reached VTResume() call. After that collection starts and then it goes until reaching VTPause() call. So, you can collect profiling data on any code region within your program, just put VTResume() before and VTPause() after the code of interest.
For more complete information about compiler optimizations, see our Optimization Notice.