Hello,
When I use PGI17.4 Community Edition to compile a demo program of Jacobi relaxation Calculation, the Command window shows an error as below:
PGC-F-0206-Can’t find include file corecrt.h (C:\PROGRA~1\PGICE/win64/17.4/include/MS_math14.h: 11)
PGC/x86-64 Windows 17.4-0: compilation aborted
Running in Win10,Nvidia Cuda 8.0,VS2015 Community with Windows SDK.
Actually, the math.h has been included in the program. May I have your advises on this error?Please ignore the OMP lines which are for gcc compilation.
Thanks & Regards,
Sean Sun
The demo program is below.
//#include <omp.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include “timer.h”
#define NN 4096
#define NM 4096
double A[NN][NM];
double Anew[NN][NM];
int main(int argc, char** argv)
{
const int n = NN;
const int m = NM;
const int iter_max = 1000;
const double tol = 1.0e-6;
double error = 1.0;
// omp_set_num_threads(12);
memset(A, 0, n * m * sizeof(double));
memset(Anew, 0, n * m * sizeof(double));
StartTimer();
printf(“Jacobi relaxation Calculation: %d x %d mesh\n”, n, m);
//#pragma omp parallel for
for (int j = 0; j < n; j++)
{
A[j][0] = 1.0;
Anew[j][0] = 1.0;
}
int iter = 0;
#pragma acc data copy(A), create(Anew)
while (error > tol && iter < iter_max)
{
error = 0.0;
#pragma omp parallel for shared(m, n, Anew, A)
#pragma acc kernels
//#pragma acc parallel loop
for (int j = 1; j < n - 1; j++)
{
for (int i = 1; i < m - 1; i++)
{
Anew[j] = 0.25 * (A[j][i + 1] + A[j]+ A[j - 1] + A[j + 1]);
error = fmax(error, fabs(Anew[j] - A[j]));
}
}
#pragma omp parallel for shared(m, n, Anew, A)
#pragma acc kernels
//#pragma acc parallel loop
//#pragma omp parallel for
for (int j = 1; j < n - 1; j++)
{
for (int i = 1; i < m - 1; i++)
{
A[j] = Anew[j];
}
}
if (iter % 100 == 0) printf(“%5d, %0.6f\n”, iter, error);
iter++;
}
double runtime = GetTimer();
printf(" total: %f s\n", runtime / 1000);
}