Print

Print


On 12/3/2013 5:09 PM, Dan Nagle wrote:
> Hi,
>
> You might try linking with mpiifort, it appears the missing links
> are to symbols in the Intel library.
> Something else to try is to use —switch no_launch to see
> whether the missing links change or go away.
>
> On Dec 3, 2013, at 14:55 , John Harper <[log in to unmask]> wrote:
>
>> After fixing the program so ifort didn't complain about labelled empty statements I got the following results. But I have never used coarrays
>> or looked them up in the standard so I don't know whether the trouble is in ifort, or in the way it was installed on our machine, or in the program.
>>
>> miro[~/Jfh]$ cat coarray.f90
>> 1 integer, allocatable :: a(:,:)[:], b(:,:)[:], c(:,:)[:]
>> ! 2
>>   3 allocate (a(10,10)[*], source=0)
>> ! 4
>>   5 a = 0
>>   6 if (this_image() .eq. 1) a=1
>> ! 7
>>   8 sync all
>> ! 9
>> 10 allocate (b(0:11,3)[*], source=0)
>> ! 11 !allocate (c(0:11,3)[*], source=b)
>> 12 allocate (c[*], source=b)
>> ! 13
>> 14 b(1:10,1:3) = a(1:10,1:3) [1]
>> 15 c(1:10,1:3) = a(1:10,4:6) [1]
>> ! 16
>> 17 sync all
>> ! 18
>> 19 if ( this_image() .gt. 1) b(0,:) = c(10,:) [this_image()-1]
>> ! 20
>> 21 end
>> [1]+  Done                    emacs -font 6x13 coarray.f90
>> miro[~/Jfh]$ ifort -V -coarray coarray.f90
>> Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.0.080 Build 20130728
>> Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.
>>
>> Intel(R) Fortran 14.0-1565
>> GNU ld version 2.20.51.0.2-5.36.el6 20100205
>> ld: warning: libmpi_mt.so.4, needed by /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so, not found (try using -rpath or -rpath-link)
>> ld: warning: libintlc.so.5, needed by /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so, not found (try using -rpath or -rpath-link)
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Barrier'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Comm_dup'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Put'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Get'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Isend'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Init'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Free_mem'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Win_unlock'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Alloc_mem'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Comm_size'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Abort'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Wait'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Recv'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Finalized'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Comm_rank'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Win_lock'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Finalize'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Win_free'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Win_set_errhandler'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Win_fence'
>> /opt/intel/composer_xe_2013_sp1.0.080/compiler/lib/intel64/libicaf.so: undefined reference to `MPI_Win_create'
>> miro[~/Jfh]$
>>
>> On Tue, 3 Dec 2013, Anton Shterenlikht wrote:
>>
>>> Date: Tue, 3 Dec 2013 04:01:54 -0800
>>> From: Anton Shterenlikht <[log in to unmask]>
>>> Reply-To: Fortran 90 List <[log in to unmask]>
>>> To: [log in to unmask]
>>> Subject: coarray sourced allocation
>>> I've asked in comp.lang.fortran usenet group,
>>> but got no answer, so am trying here.
>>> Is sourced allocation allowed for coarrays
>>> but the standard?
>>>
>>> This program:
>>>
>>> 1 integer, allocatable :: a(:,:)[:], b(:,:)[:], c(:,:)[:]
>>> 2
>>> 3 allocate (a(10,10)[*], source=0)
>>> 4
>>> 5 a = 0
>>> 6 if (this_image() .eq. 1) a=1
>>> 7
>>> 8 sync all
>>> 9
>>> 10 allocate (b(0:11,3)[*], source=0)
>>> 11 !allocate (c(0:11,3)[*], source=b)
>>> 12 allocate (c[*], source=b)
>>> 13
>>> 14 b(1:10,1:3) = a(1:10,1:3) [1]
>>> 15 c(1:10,1:3) = a(1:10,4:6) [1]
>>> 16
>>> 17 sync all
>>> 18
>>> 19 if ( this_image() .gt. 1) b(0,:) = c(10,:) [this_image()-1]
>>> 20
>>> 21 end
>>>
>>> compiled with ifort 14, and run with shared
>>> memory gives segfault:
>>>
>>> $ ./a.out
>>> forrtl: severe (174): SIGSEGV, segmentation fault occurred
>>> In coarray image 2
>>> Image              PC                Routine            Line        Source
>>> a.out              000000000046B199  Unknown               Unknown  Unknown
>>> a.out              0000000000469B10  Unknown               Unknown  Unknown
>>> a.out              00000000004392E2  Unknown               Unknown  Unknown
>>> a.out              000000000041F813  Unknown               Unknown  Unknown
>>> a.out              000000000040730B  Unknown               Unknown  Unknown
>>> libpthread.so.0    00002AAAAB1B7500  Unknown               Unknown  Unknown
>>> libicaf.so         00002AAAAACD026D  Unknown               Unknown  Unknown
>>> a.out              0000000000406866  Unknown               Unknown  Unknown
>>> a.out              00000000004038C6  Unknown               Unknown  Unknown
>>> libc.so.6          00002AAAAB3E4CDD  Unknown               Unknown  Unknown
>>> a.out              00000000004037B9  Unknown               Unknown  Unknown
>>>
>>> application called MPI_Abort(comm=0x84000000, 3) - process 1
>>> rank 1 in job 1  newblue4_35267   caused collective abort of all ranks
>>> exit status of rank 1: return code 3
>>> $
>>>
>>> However, when line 12 is commente out
>>> and line 11 is used instead, the program
>>> runs fine.
>>>
>>> AS far as I understand the standard, the
>>> meaning of the two statements:
>>>
>>> allocate (c(0:11,3)[*], source=b)
>>> allocate (c[*], source=b)
>>>
>>> is identical. Is that not so?
>>>
>>> Is the segfault expected?
>>>
>>> Thanks
>>>
>>> Anton
>>>
>>
>> -- John Harper, School of Mathematics Statistics and Operations Research
>> Victoria University, PO Box 600, Wellington 6140, New Zealand
>> e-mail [log in to unmask] phone (+64)(4)463 5276 fax (+64)(4)463 5045
> --
>
> Cheers!
> Dan Nagle
ifort supplies its own limited copy of MPI library (libicaf) for support 
of co-arrays.  mpiifort isn't needed unless MPI is used explicitly (or 
by libraries such as MKL),.  If the compiler environment is set up 
properly, as by sourceing the compilervars.[c]sh,  LD_LIBRARY_PATH would 
include a path to the mpirt directory.  If that is missing, it's a 
broken installation (library directory not where the installer wanted to 
put it,....)

Sorry,
Tim

-- 
Tim Prince