1

我为递归编写了一个串行程序代码。我已经用 ICC 和 GCC 用不同的输出文件名编译了它。当使用 Intel Advisor XE 2013 来检测热点时,GCC 编译的代码通过了所有测试,但正确的是,它提出了警告Warning: Advisor does not support the GNU OpenMP Runtime module and may report false positives.,因此为了避免数据共享问题,我用 ICC 编译了带注释的代码(然后在终端上测试了文件)并导入了它到带有源目录和输出文件的新项目。但它的生产问题(根据堆栈)Collection has stopped. Application exit code: 127导致 NO DATA 错误。
代码是:

#include<stdio.h>
#include "/opt/intel/include/omp.h"  //just for the sake of testing include directory
#include "/opt/intel/advisor_xe_2013/include/advisor-annotate.h" 

long Fibonacci(long);

int main(int argc, char *argv[])

{
    double toc,tic=omp_get_wtime();
    int n, i = 0, c;
    n=45;
    printf("Fibonacci series\n");
    ANNOTATE_SITE_BEGIN(SITE1);
    for ( c = 1 ; c <= n ; c++ )
    {
        ANNOTATE_ITERATION_TASK( MyTask1 );  // This annotation identifies an entire body as a task. 
        printf("%ld\n", Fibonacci(i));
        i++;
    }ANNOTATE_SITE_END();  // End the parallel code region, after task execution completes
return 0;
}

long Fibonacci(long n)
{

    long x,y;

    if ( n == 0 )
        return 0;
    else if ( n == 1 )
        return 1;
    else
        {    
            x=Fibonacci(n-1);
            y=Fibonacci(n-2);
            return ( x+y ); 
        }
} 

Run : icc serFib.c -o F123ICC2 -openmp -O2 -ldl -g -I $(ADV_DIR)
ADV_DIRis/opt/intel/advisor_xe_2013/include/
-OpenMP是包含 Intel 的库

注 1我已经为注 2/opt/intel/composerxe/bin设置了路径和库路径我已经在 yama 中设置了 ptrace 变量为 0注 3 ICC 编译代码(F123ICC2,此处)正在执行并在终端上显示正确的结果。注 4我知道 127 代码(在 linux 中)用于path/command not found/opt/intel/lib/intel64


4

0 回答 0