coarray, Qcoarray

Enables the coarray feature.

Syntax

Linux OS:

-coarray[=keyword]

OS X:

None

Windows OS:

/Qcoarray[:keyword]

Arguments

keyword

Specifies the memory system where the coarrays will be implemented. Possible values are:

shared

Indicates a shared memory system. This is the default.

distributed

Indicates a distributed memory system.

coprocessor

Indicates a configuration where image 1 is running on the host processor, and other images are run on host processors or Intel® MIC Architecture coprocessors. The configuration file is used to determine where the images will be run; that is, how many on the host processors and how many on the coprocessors. This results in an executable containing code that will replicate itself NUM_IMAGES() more times, ultimately resulting in NUM_IMAGES()+1 running images. This setting is only available on Linux* OS on Intel® 64 architecture.

This setting requires that option -coarray-config-file also be specified.

single

Indicates a configuration where the image does not contain self-replication code. This results in an executable with a single running image. This configuration can be useful for debugging purposes, even though there are no inter-image interactions.

Default

OFF

Coarrays are not enabled without specifying this option.

Description

This option enables the coarray feature of the Fortran 2008 Standard. It enables any coarray syntax in your program. If this option is not specified, coarray syntax is rejected.

It also tells the driver to link against appropriate libraries, and to create the appropriate executables.

Only one keyword can be in effect. If you specify more than one keyword, the last one specified takes precedence. However, if keyword single is specified anywhere on the command line, it takes precedence.

On Intel® MIC Architecture, this option is only available on Linux* OS.

You can specify option [Q]coarray-num-images to specify the default number of images that can be used to run a coarray executable. If you do not specify that option, you get the number of execution units on the current system.

You can specify the [Q]coarray-config-file option to specify the name of a Message Passing Interface (MPI) configuration file.

Options [Q]coarray-num-images and [Q]coarray-config-file are valid for all keyword values.

IDE Equivalent

Windows: Language > Enable Coarrays

Linux: None

OS X: None

Alternate Options

None

Example

The following command runs a coarray program on shared memory using n images:

/Qcoarray /Qcoarray-num-images:n          ! Windows OS
-coarray -coarray-num-images=n            ! Linux OS

The following command runs a coarray program on distributed memory using n images:

/Qcoarray:distributed /Qcoarray-num-images:n          ! Windows OS
-coarray=distributed -coarray-num-images=n            ! Linux OS

The following command runs a coarray program on shared memory using the MPI configuration file specified by filename:

/Qcoarray:shared /Qcoarray-config-file:filename        ! Windows OS
-coarray=shared -coarray-config-file=filename          ! Linux OS

The following commands illustrate precedence:

Linux* OS:

-coarray=coprocessor -coarray=shared          ! shared takes precedence (last one specified)
-coarray=single –coarray=shared               ! single takes precedence (single always takes precedence)

Windows* OS:

/Qcoarray:distributed /Qcoarray:shared        ! shared takes precedence (last one specified)
/Qcoarray:single /Qcoarray:shared             ! single takes precedence (single always takes precedence)
For more complete information about compiler optimizations, see our Optimization Notice.