Rose编译器-AutoPar无法将C程序正确转换为openmp?

时间:2018-09-05 05:04:47

标签: gcc rose-compiler-framework

我在Linux centos7.5上安装了rose编译器(版本0.9.10.54),并尝试了Rose编译器已经给出的对autoPar的实验。

我在下面给出了一个普通的c程序,并且正在此程序上运行autoPar。

Select * From [CitrixXenAppMonitoring].[MonitorData].[user] as DUser
    Inner join [CitrixXenAppMonitoring].[MonitorData].[session] as DSession on DSession.UserId = DUser.ID
    left join [CitrixXenAppMonitoring].[MonitorData].[Machine] as DMachine on DSession.MachineID = DMachine.Id
    left join [CitrixXenAppMonitoring].[MonitorData].[Catalog] as DCatalogue on DCatalogue.Id = DMachine.CatalogId
    full outer join [CitrixXenAppMonitoring].[MonitorData].[Connection] as DConnection on DConnection.Id = DSession.CurrentConnectionId
    Where DUser.Username = 'JanineD'
    Order by DSession.StartDate

运行#include <stdio.h> int main(int argc, char *argv[]) { int N = 20; int total ; int i,j; for (j=0;j<N;j++) { for (i=0;i<N;i++) { total += i+j ; } } printf("%d\n", total) ; return 0; } 时,它会显示以下openmp代码:

autoPar test1.c

当我现在使用gcc(版本4.8.5)编译上述openmp程序时,遇到以下错误:

#include <stdio.h>
#include <omp.h>

int main(int argc,char *argv[])
{
  int N = 20;
  int total;
  int i;
  int j;

#pragma omp parallel for private (total,i,j) reduction (+:total)
for (j = 0; j <= N - 1; j += 1) {

#pragma omp parallel for private (total,i) reduction (+:total)
for (i = 0; i <= N - 1; i += 1) {
  total += i + j;
 }
}
printf("%d\n",total);
return 0;
}

我不知道为什么会发生这种类型的翻译问题。即使我有较旧版本的rose编译器,也可以正确翻译它。是安装问题还是gcc / openmp问题?

0 个答案:

没有答案