02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

TASK COMMON (extension)<br />

Declares a common block to be local to a thread during parallel execution.<br />

<strong>HP</strong> <strong>Fortran</strong> statements<br />

TASK COMMON (extension)<br />

NOTE A program that uses the TASK COMMON statement should be compiled with the<br />

+Oparallel or +parallel option; otherwise, the compiler treats the TASK<br />

COMMON statement as a COMMON statement.<br />

Syntax<br />

TASK COMMON /cbn/nlist[,/cbn/nlist...]<br />

cbn is a symbolic name for a common block that is declared in a TASK<br />

COMMON statement. Unnamed common blocks are not allowed in a TASK<br />

COMMON statement.<br />

nlist is a list of variable names, array names, and array declarators. These<br />

variables cannot appear in a DATA statement, but otherwise can be used<br />

like other variables in common storage.<br />

Description<br />

The TASK COMMON statement is an extension to the <strong>Fortran</strong> 90 standard and is provided<br />

for compatibility with programs that use the Cray TASK COMMON feature. TASK<br />

COMMON blocks can only be declared in functions and subroutines.<br />

A program should already be running multiple threads before calling a subroutine that<br />

contains a TASK COMMON block.<br />

When used in a program executing multiple threads, the TASK COMMON statement declares<br />

all variables in a common block as local to a thread (also called a task). If multiple threads<br />

execute code that uses the same TASK COMMON block, each thread has a private copy of the<br />

block.<br />

All occurrences of the TASK COMMON block must be declared with the TASK COMMON<br />

statement; a common block cannot be declared in both a COMMON statement and a TASK<br />

COMMON statement.<br />

Related statements<br />

COMMON<br />

Chapter 10 445

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!