Hi guys,
I think there is an error with PGI C compiler because I am not able to use a const sized array without the compiler showing some message concerning the symbol table being referenced.
The error however is misleading because it can jump at any line, although the executable program is behaving correctly.
My code looks like follows:
MPI_Datatype create_custom_type () {
const int blocks = 2; // a block of floats, followed by a block of ints
MPI_Datatype types[blocks]={MPI_FLOAT, MPI_INT};
int lengths[blocks]={2,4};
MPI_Aint offsets[blocks];
MPI_Datatype newtype;
MPI_Aint sizeoffloat;
MPI_Type_extent(MPI_FLOAT, &sizeoffloat);
offsets[0] = (MPI_Aint) 0;
offsets[1] = 2*sizeoffloat;
MPI_Type_struct(blocks, lengths, offsets, types, &newtype);
return newtype;
}//create_custom_type()
The error message I get from the compiler is:
PGC-S-0000-Internal compiler error. sym_is_refd: bad sc for 2011
which as you can see is very cryptic. The work around is hardcoding the size of the array when is declared. Still I believe declaring the array size as const should do it.
Anyone else have found this problem when declaring arrays with const sized variables?
Omar V.M.