我正在使用 Intel Advisor XE,它是 Parallel Studio XE 2013 和 Ubuntu 2014 的一部分。素数程序如下:
#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;
}
我用这两个程序运行这个程序,icc
并gcc
在 Intel Parallel Studio XE Advisor XE 2013 上对其进行了测试。它与生成的热点和生成的树(如. 现在当我添加注释代码时
#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;
}
它给了我类似“无法加载行收集器数据”的错误。我正在为结果上传图片。这似乎没有错误,但最后它显示为
注 1 /proc/sys/kernel/yama/ptrace_scope
已更新为 0。
注 2我已设置 LibPathLD_LIBRARY_PATH:/opt/intel/advisor_xe_2013/include
PS我尝试了6位数的斐波那契,并得到了相同的结果说NO DATA