- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[bash]#include#include using namespace std; //#define INTEL_NO_ITTNOTIFY_API #include int _tmain(int argc, _TCHAR* argv[]) { __itt_resume(); double total = 0; for( int i = 0; i < 10000; ++i ) { for( int j = 0; j < 10000; ++j ) { double a = sqrt( double( i )); double b = sqrt( double( j )); total += sqrt( a * b ); } } __itt_pause(); cout.setf( std::ios::floatfield, std::ios::fixed ); cout << total << std::endl; return 0; } [/bash]
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you starting the analysis in paused mode (for example, from the GUI by clicking Start or Start Paused)? If not, then it may be that you are starting the application analysis run not paused - in which case the first itt_notify is an attempt to resume the application analysis when the analysis is already running.
Attempt to pause first, and then resume.
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Christian,
So far I
have only been able to replicate the behavior with your original example if I
start collection un-paused. I may need
to know more about how you are starting the analysis (un-paused or paused). If I start the analysis in the GUI by
clicking the Start Paused button the example works as expected with no Sampling
API error: resume sampling collection failed. However, if I start the analysis
via the GUI regularly (not paused), the error occurs because there is nothing
to resume since the analysis is not paused.
With
your original example where you call a resume API first and then call the pause
API, if you start the application un-paused the error occurs. In your example, you need to either start the
application paused or alternatively start the application un-paused but swap
the resume / pause API so that the pause API is called first.
If you are starting the analysis normal (un-paused),
then in the code call the pause API first then call resume next presumably after
you have passed the uninteresting work you do not wish to collect data, the
error does not occur.
The
first URL link below shows two usage examples of pause / resume in different cases
depending on what you wish to accomplish.
Note that the first usage example starts the analysis via the GUI in
paused mode then the resume API is called.
This may be a usage case where you wish to ignore the uninteresting start-up
work of an application.
The
following documentation discusses Collection Control API (pause / resume) in
conjunction with pause / resume controls in the GUI.
Intel
Parallel Studio XE 2011 - Linux* OS
http://software.intel.com/sites/products/documentation/hpc/amplifierxe/en-us/lin/ug_docs/olh/common/pause_resume_api.html
Additionally
be aware that as the documentation notes, the call frequency should also be
taken into consideration.
The
Pause/Resume API call frequency is about 1Hz for a reasonable rate. Since this
operation pauses and resumes data collection in all processes in the analysis
run with the corresponding collection state notification to GUI, you are not
recommended to call it on frequent basis for small workloads.
Articles:
http://software.intel.com/en-us/articles/use-new-pause-and-resume-api-from-intel-vtune-amplifier-2011-xe/
http://software.intel.com/sites/products/documentation/hpc/amplifierxe/en-us/lin/ug_docs/olh/common/start_collection_paused.html
Thanks
Rob
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page