Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

coarray

李__华
Beginner
451 Views

Hi,

I have tested the coarray,but in trouble. 

program hello_world
	write (*,*) 'hello from image ', this_image(), ' out of ', &
		num_images(), ' images.'
end program hello_world

 command line option :
 /Qcoarray:shared /Qcoarray-num-images:4

output:

 hello from image            1  out of            1  images.
 hello from image            1  out of            1  images.
 hello from image            1  out of            1  images.
 hello from image            1  out of            1  images.

 

How to deal with it?

0 Kudos
3 Replies
FortranFan
Honored Contributor III
451 Views

See image and steps below, perhaps they will help you.

C:\Temp>type coarray.f90
program hello_world
   write (*,*) 'hello from image ', this_image(), ' out of ', &
      num_images(), ' images.'
end program hello_world


C:\Temp>ifort /Qcoarray:shared /Qcoarray-num-images:4 coarray.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 19.0.4.245 Build 20190417
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.21.27702.2
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:coarray.exe
-subsystem:console
coarray.obj

C:\Temp>coarray.exe
 hello from image            2  out of            4  images.
 hello from image            4  out of            4  images.
 hello from image            3  out of            4  images.
 hello from image            1  out of            4  images.

C:\Temp>

coarray.png

0 Kudos
Steve_Lionel
Honored Contributor III
451 Views

I have seen this reported before, but it seems to work ok in the current update (19.0.4). Be sure to build as x64 (Intel 64).

0 Kudos
avinashs
New Contributor I
451 Views

I had originally reported this as thread https://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/topic/801082.

It now works in 19.0.4 from the command line. But it still does not work in MSVS 2017 for some reason. The command line is the same in case of MSVS2017:

/nologo /O2 /Qcoarray:shared /Qcoarray-num-images:4 /module:"x64\Release\\" /object:"x64\Release\\" /Fd"x64\Release\vc150.pdb" /libs:dll /threads /dbglibs /c.

Also, in MSVS2017, the default behavior chosen at run time when the number of coarray images is set to 0 is effectively 1.

0 Kudos
Reply