1

I'm using Intel Advisor XE, part of Parallel Studio XE 2013 with Ubuntu 2014. Program for Prime number is as:

#include "stdio.h"
#include "stdlib.h"

int isPrime(long unsigned int x)
{
    long unsigned int i;
    for (i = 2; i < x; i += 1)
    {
        if(x%i==0)
            return 0;
    }
    if(i==x)
        return i;
}

int main (int argc, char *argv[])
{
    double tic=omp_get_wtime();
    long unsigned int i,num;
    num=999999;
    for (i = 1; i <= num; i += 1)
    {
        if(isPrime(i)) printf("\t%lu",i);
    }
    return 0;
}

I run this program with both icc and gcc and tested it on Intel Parallel Studio XE Advisor XE 2013. It went well with resulting hotspots and resultant tree like res1. Now when I added Annotation code something like

#include "stdio.h"
#include "stdlib.h"
#include "/opt/intel/advisor_xe_2013/include/advisor-annotate.h" 

int isPrime(long unsigned int x)
{
    long unsigned int i;
    for (i = 2; i < x; i += 1)
    {
        if(x%i==0)
            return 0;
    }
    if(i==x)
        return i;
}

int main (int argc, char *argv[])
{
    long unsigned int i,num;
    num=999999;
    ANNOTATE_SITE_BEGIN( MySite1 );  //Loop control statement to begin a parallel code region (parallel site).
    for (i = 1; i <= num; i += 1)
    {
        ANNOTATE_ITERATION_TASK( MyTask1 );  // This annotation identifies an entire body as a task. 
        if(isPrime(i)) printf("\t%lu",i);
    }
    ANNOTATE_SITE_END();  // End the parallel code region, after task execution completes
    return 0;
}

It gave me error like "Can not load row collector data." I'm uploading images for the result.Seems like no error which seems like no errors but at last it shows like Error

Note 1 /proc/sys/kernel/yama/ptrace_scope has been updated to 0.
Note 2 I have set up LibPath LD_LIBRARY_PATH:/opt/intel/advisor_xe_2013/include

PS I tried for fibonacci of 6 digit number, and got the same result saying NO DATA

zam
  • 1,664
  • 9
  • 16
kAmol
  • 1,297
  • 1
  • 18
  • 29
  • It's not searching for the code file to suggest annotation, though I've specified work directory and source code directory. – kAmol Sep 15 '14 at 10:37
  • Kamol, could you please to try profiling your primes application using "Suitability" or "Correctness" analysis, available to the right side from Survey button on Advisor toolbar? (in your example you've actually used Survey analysis). It would be useful to know result of Suitability/Correctness run. Also, what Advisor version do you use? – zam Sep 15 '14 at 15:09
  • In general this is definitely a bug. I just tested it on fresh Advisor XE 2015; your test case seems working fine without any error messages. Thus I'm pretty sure this is a bug, which has been fixed in newer versions. So I would recommend one of 3 options to fix it: 1) upgrade Advisor to newer version, 2) Don't use Survey for annotated binaries (which makes some sense, because annotations are need only for Suitability and Correctness analysis), 3) one workaround: try manually cleaning up Advisor project folder (where Advisor data for "pn" locates) content and re-run Survey. – zam Sep 15 '14 at 17:28
  • Thanks Zam for reply... – kAmol Sep 16 '14 at 04:50

1 Answers1

1

The problem was with compilation, I played around various options and tried using -I option with GCC and ICC to include library path, which I mentioned for header file, i.e. /opt/intel/advisor_xe_2013/include/ and also linked libraries using -ldl option which solved problem.

kAmol
  • 1,297
  • 1
  • 18
  • 29
  • 1
    yes, correct, -ldl is always needed as stated in documentation. LD_LIBRARY_PATH shouldn't be always manually updated, especially when you work with C++ and especially when you use intel Advisor standard install on Linux. – zam Sep 16 '14 at 08:05