ParallelUtils error

Discussion about building and installing Elmer
Post Reply
denis.cohen
Posts: 56
Joined: 15 Dec 2010, 13:50

ParallelUtils error

Post by denis.cohen »

Hi,

I am trying to compile Elmer with the Intel compiler.

I am getting this error with ParallelUtils.f90
ParallelUtils.f90(427): error #8378: Pointer array is not contiguous unless it is declared CONTIGUOUS. [TMPXVEC]
Mx => GlobalData % SplittedMatrix % TmpXVec
---------------------------------------------------^
ParallelUtils.f90(427): error #8371: If pointer is declared CONTIGUOUS, target must be contiguous as well. [TMPXVEC]
Mx => GlobalData % SplittedMatrix % TmpXVec
---------------------------------------------------^
ParallelUtils.f90(428): error #8378: Pointer array is not contiguous unless it is declared CONTIGUOUS. [TMPRVEC]
Mr => GlobalData % SplittedMatrix % TmpRVec
---------------------------------------------------^
ParallelUtils.f90(428): error #8371: If pointer is declared CONTIGUOUS, target must be contiguous as well. [TMPRVEC]
Mr => GlobalData % SplittedMatrix % TmpRVec
---------------------------------------------------^
ParallelUtils.f90(432): error #8378: Pointer array is not contiguous unless it is declared CONTIGUOUS. [TMPXVEC]
Mx => GlobalData % SplittedMatrix % TmpXVec
---------------------------------------------------^
ParallelUtils.f90(432): error #8371: If pointer is declared CONTIGUOUS, target must be contiguous as well. [TMPXVEC]
Mx => GlobalData % SplittedMatrix % TmpXVec
---------------------------------------------------^
ParallelUtils.f90(433): error #8378: Pointer array is not contiguous unless it is declared CONTIGUOUS. [TMPRVEC]
Mr => GlobalData % SplittedMatrix % TmpRVec
---------------------------------------------------^
ParallelUtils.f90(433): error #8371: If pointer is declared CONTIGUOUS, target must be contiguous as well. [TMPRVEC]
Mr => GlobalData % SplittedMatrix % TmpRVec
---------------------------------------------------^
compilation aborted for ParallelUtils.f90 (code 1)
make[2]: *** [ParallelUtils.o] Error 1
This is strange because it seems all these pointers have the CONTIG keyword.

Any help appreciated.

Denis
mubunk
Posts: 3
Joined: 30 Jun 2013, 11:58
Antispam: Yes

Re: ParallelUtils error

Post by mubunk »

I have the same problem. I don't know what to do with it. I have used Intel compilers under linux - icc, icpc and ifort with mkl. And this appears. Is this problem doe to ifort?
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: ParallelUtils error

Post by raback »

Hi

I remember hearing the some compiler was stricter than necessary in requiring also the target to be contiguous. Juha took these into use but unfortunately he is an holiday now. Perhaps you could look at this old script below. I guess one could totally remove the contiguous flags, it is just there fore some performance bonus.

viewtopic.php?f=2&t=1634&p=4954&hilit=CONTIGUOUS#p4954

-Peter
rgladstone
Posts: 64
Joined: 15 Apr 2013, 16:23
Antispam: Yes

Re: ParallelUtils error

Post by rgladstone »

Juha asked about the validity of this code. There is a reply here:
http://gcc.gnu.org/ml/fortran/2012-05/msg00051.html

The bottom line seems to be that the intel compilers seem to be over-cautious, but perhaps in a sensible way. The intel compilers throw an error if a pointer is assigned to a target that is within a structure and not declared contiguous. According to the standard, the user should ensure that the target is contiguous if the pointee is declared contiguous. In our case the target is not declared contiguous, but that doesn't mean that it isn't contiguous - that is not known until run time. But it seems to me that the code would be safer if the targets in these cases are declared contiguous. Is there a reason that we cannot declare them as contiguous in the code? I've no idea what happens if a pointer with the contiguous property gets pointed at a target that is not contiguous at run time. Could it end up pointing at garbage without throwing an error?

I'd be very interested to hear what Juha, Peter or Thomas think about this. I'm no expert on such compiler subtleties.

For now I'll try the script linked by Peter and Thomas, which appears to remove the CONTIGUOUS statements with sed.

Rupert
Post Reply