I tried to run the below OPenACC program on cluster:
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
#pragma acc parallel loop
for (int i=0; i<1000; i++)
{
//cout << i << endl;
printf("%d ", i);
}
return 0;
}
The PBS Script for the above code:
#PBS -e errorlog1.err
#PBS -o logfilehello.log
#PBS -q rupesh_gpuq
#PBS -l select=1:ncpus=1:ngpus=1
tpdir=`echo $PBS_JOBID | cut -f 1 -d .`
tempdir=$HOME/scratch/job$tpdir
mkdir -p $tempdir
cd $tempdir
cp -R $PBS_O_WORKDIR/* .
module load nvhpc-compiler
#module load cuda10.1
#module load gcc10.3.0
#module load nvhpc-21.11
#module load nvhpc-pgicompiler
#module load gcc920
pgc++ sssp.cpp
./a.out > output.txt
rm *.out
mv * $PBS_O_WORKDIR/.
rmdir $tempdir
~
After submmitting the above job to que, I get the following error log:
"sssp.cpp", line 2: catastrophic error: cannot open source file "iostream" #include <iostream>
^
1 catastrophic error detected in the compilation of "sssp.cpp". Compilation terminated.
I tried running C programs on pgcc and they work fine. Running c++ programs on pgc++ is throwing error. What could be the reason?