2 pghpf Compiler Options

This chapter describes the syntax and operation of each compiler option. The options are arranged in alphabetical order. On a command line, options need to be preceded by a hyphen (-).

This chapter uses the following notation:

[item]
Square brackets indicate that the enclosed item is optional.
{item | item}
Braces indicate that you must select one and only one of the enclosed items. A vertical bar (|) separates the choices.
...
Horizontal ellipses indicate that zero or more instances of the preceding item are valid.
Many of the compiler options and arguments have default settings. Some option defaults are affected by environment variables and can be set using the .pghpfrc driver configuration file. Refer to Appendix C, Driver Customization, for details on setting and altering defaults with the driver initialization file.

Most Fortran 77 node compiler options are also valid for pghpf. Refer to the documentation for the Fortran 77 node compiler supplied with your system for a list of valid Fortran 77 command-line options.

The pghpf compiler uses the options -O1 and -O2 for optimization. If you select these options, varying levels of optimiztion will be applied to your HPF program. For details on the operation of these options, refer to the pghpf Release Notes.

If the compiler does not recognize an option, it passes the option to the linker.

Table 2-1 lists and briefly describes the pghpf options. Full descriptions follow the table.

Table 2-1 pghpf Compiler Options

Option              Description                                         
-M[no]autopar       Auto-parallelize Fortran DO loops. The option       
                    -Mnoautopar disables automatic parallelization      
                    for INDEPENDENT DO loops.                           
-M[no]backslash     Determines how the backslash character is treated   
                    in quoted strings.                                  
-Mcmf               Provides limited support for CM Fortran             
                    compatibility.                                      
-Mextract           Perform a manual extract phase for procedures       
                    within INDEPENDENT DO loops that are to be          
                    inlined. See the -Minline option.                   
-M[no]dclchk        Determines whether all program variables must be    
                    declared.                                           
-M[no]depchk        Compiler checks for potential data dependences.     
-M[no]dlines        The compiler treats lines containing "D" in         
                    column 1 as executable statements. With nodlines    
                    the compiler does not treat lines containing "D"    
                    in column 1 as executable statements (does not      
                    ignore the "D".                                     
-Mextend            The compiler accepts 132-column source code;        
                    without this option lines are 72 columns.           
-Mfreeform          Process source using Fortran 90 freeform input      
                    specifications.                                     
-Mftn               Stop after compiling HPF and keep the               
                    intermediate Fortran 77 output.                     
-Mg                 Set the debug option, as well as the -Mkeepftn      
                    option, and also set the pghpf compiler flag that   
                    makes debugging the Fortran 77 output easy by       
                    suppressing HPF line numbers in the generated       
                    Fortran 77 intermediate file.                       
-Minfo              Instructs the compiler to produce size, time, and   
                    other compilation information.                      
-Minform            Specifies the minimum level of error severity       
                    that the compiler displays.                         
-Minline            Perform procedure inlining within INDEPENDENT DO    
                    loops.                                              
-Mkeepftn           Retain Fortran 77 intermediate files.               
-M[no]list          Specifies whether the compiler creates a listing    
                    file.                                               
-Mnohpfc            Skip the HPF compilation step and compile using     
                    the Fortran  77 compiler if a file with a .f or     
                    .F extension is supplied.                           
-Mparmacs           Generate code using runtime libraries and startup   
                    routines for the PARMACS environment.               
-Mpreprocess        Run the preprocessor on the input source file.      
-Mprof              Select profiling. Insert calls to profile           
                    routines and link profiler libraries.               
-Mpvm               Generate code using runtime libraries and startup   
                    routines for the PVM environment.                   
-Mr8                Determines whether the compiler promotes REAL       
                    variables and constants to DOUBLE PRECISION and     
                    COMPLEX to DOUBLE COMPLEX.                          
-Mreplicate         The array replicator eliminates calls to            
                    pghpf_get_scalar() by  replicating distributed      
                    arrays that satisfy  certain conditions.            
-Mrpm               Generate code using runtime libraries and startup   
                    routines for the PGI RPM environment.               
-Mrpm1              Generate code using runtime libraries and startup   
                    routines for the PGI RPM single-process             
                    environment for debugging.                          
-M[no]sequence      All variables are created as SEQUENCE variables,    
                    where sequential storage is assumed. With           
                    -Mnosequence, all variables are created as          
                    nonsequential variables unless an explicit          
                    SEQUENCE directive is supplied or the variable is   
                    an assumed size array.                              
-Mstats             Include the libraries for  printing runtime         
                    communications and message passing statistics.      
-Mstandard          Causes the compiler to flag source code that does   
                    not conform to the ANSI standard.                   
-Mupcase            Determines whether the compiler allows uppercase    
                    letters in identifiers.                             



Note

The default pghpf compiler options depend on values set in the .pghpfrc driver configuration file. Depending on the PGI product you purchased, your defaults may differ.


-M pghpf_flag

Selects options for the pghpf compiler and for code generation.

Syntax

-Mpghpf_flag

Where:

pghpf_flag
is one of the following:
[no]autopar
[=option [,option,...]]
The compiler generates FORALL statements and calls to reduction intrinsics when parallel DO-loops with distributed arrays are discovered. Loop interchange and distribution may be performed to increase the number of parallel loops. The option -Mnoautopar disables autoparallelization features perfermed by default for INDEPENDENT DO loops. Information about parallelization is displayed with the -Minfo command-line switch. The optional arguments for autopar are as follows:
noassoc | assoc

noassoc prevents recognition of reductions. Programs in which results are sensitive to the order in which operations are performed will require this switch. The argument assoc allows recognition of reductions and is the default.
levels:n

specifies the maximum nesting depth of loops that get auto-parallelized. By default, the maximum nesting depth is 3.
[no]backslash
With backslash, the compiler recognizes a backslash as an escape character in quoted strings (in accordance with standard C usage). With nobackslash the compiler treats a backlash in quoted strings as a normal character, and not as an escape character.
cmf
Provides limited support for CM Fortran compatibility. Where there is no chance for ambiguity, pghpf supports both the CM Fortran and the HPF spellings of common Fortran 90 features. This includes support for the intrinsics DOTPRODUCT, DLBOUND, DUBOUND, and DSHAPE which have calling sequences identical to their Fortran 90 counterparts. It also includes support for the CM Fortran method of using square brackets in the definition of array constructors and the use of the ARRAY keyword in place of the Fortran 90 standard DIMENSION keyword. There are three CM Fortran intrinsics which have names identical to their Fortran 90 counterparts but whose calling sequences differ. These are CSHIFT, EOSHIFT, and RESHAPE. Using -Mcmf these intrinsics will be interpreted using the CM Fortran convention rather than the standard Fortran 90 convention. There are six additional non-standard intrinsics in CM Fortran: PROJECT, LASTLOC, FIRSTLOC, RANK, DIAGONAL, and REPLICATE. These non-standard intrinsics are not currently supported by pghpf. Other features of CM Fortran that are not supported are the layout directives and the utility routines.
[no]dclchk
Determines whether all program variables must be declared.
[no]depchk
With nodepchk the compiler does not check for potential data dependencies between ambiguous array references. Note, with nodepchk, if data dependencies exist, this option can produce incorrect code.
[no]dlines
The compiler treats lines containing "D" in column 1 as executable statements (ignoring the "D"). With nodlines the compiler does not treat lines containing "D" in column 1 as executable statements (does not ignore the "D").
extend
The compiler accepts 132-column source code; without this option lines are 72 columns.
extract
[=name[,name...]] -o dir
This option extracts procedures from the file indicated on the command line and places the output in the directory (extract directory) specified with the -o dir on the command line. If you do not specify a function name the compiler extracts every function in the source text. Note that while the extract phase extracts all possible procedures, the inliner will only inline procedures in an INDEPENDENT DO loop.You must specify an extract output diretory dir with the -o option. The name option can be any of the following:
name
instructs the extractor to extract function name from the source file.
freeform
Instructs the compiler to read source using Fortran 90 free form.
ftn
Instructs the compiler stop after compiling HPF and keep resulting Fortran 77 output.
g
Set the debug option, as well as the -Mkeepftn option, and, in addition suppress HPF line numbers in the generated Fortran 77 intermediate file to make debuging of the Fortran 77 output easier
info
[=option [,option,...]]
Instructs the compiler to produce information on standard error, where option is one of the following:
all
instructs the compiler to produce all of the following info information.
autopar

instructs the compiler to produce information on autoparallelization.
inline
instructs the compiler to produce information on function inlining.
loop
instructs the compiler to display information about loops, such as optimizations.
stat | time

instructs the compiler to display compilation statistics.
inform,level
Instructs the compiler to display error messages at the specified and higher levels, where level is one of the following:
fatal
instructs the compiler to display fatal error messages.
severe
instructs the compiler to display severe and fatal error messages.
warn
instructs the compiler to display warning, severe and fatal error messages.
inform
instructs the compiler to display all error messages (inform, warn, severe and fatal).
inline
{=[lib:dir,][levels:number][name:fun,]}
Without options, this instructs the compiler to perform inlining within DO loops with an INDEPENDENT directive and to use a temporary directory for the extract phase. Note that while the extract phase extracts all possible procedures, the inliner will only inline procedures in an INDEPENDENT DO loop.
name:func

instructs the inliner to inline the function func.
lib:dir

instructs the inliner to inline the functions within the library directory dir. Functions from the specified library are inlined if they are found in the source program.
levels:number

instructs the inliner to perform number levels of inlining. The default number is 1.
keepftn
Instructs the compiler to keep the Fortran 77 file as compilation continues. Normally the Fortran 77 intermediate file is removed.
[no]list
Instructs the compiler to create a listing file. The listing file is filename.lst, where the name of the source file is filename.hpf.
nohpfc
Skip the HPF compilation step but compile using the Fortran 77 compiler if a file with a .f or .F extension is supplied.
nosequence
All variables are created as nonsequential variables unless an explicit SEQUENCE directive is supplied or the variable is an assumed size array.
preprocess
Run the preprocessor on the input source file.
prof
{=option }
Set profile options. Option can be any of the following:
func
perform PGI-style function level profiling.
line
insert calls to produce a pgprof.out file which contains both function and line level data.
pvm
instrucs the compiler to produce executable output to run under PVM heterogeneous communications system.
r8
determines whether the compiler promotes REAL variables and constants to DOUBLE PRECISION and COMPLEX to DOUBLE COMPLEX.
replicate
[=dims:n]
detects common cases where the pghpf compiler generates calls to pghpf_get_scalar(), a costly communications call. Calls to pghpf_get_scalar() are generated for a distributed array reference within a loop's statement in the following cases:
1) The statement is an assignment to an undistributed array or to a scalar.
2) The array reference is used as the index to another array.
3) The array reference occurs within a conditional expression.
The array replicator eliminates calls to pghpf_get_scalar() by replicating distributed arrays that satisfy any of the above three conditions. Array replication will reduce available parallelism and will incur the cost of copying distributed arrays to their replicated counterparts.
dims:n
the replicator will not attempt to create replicated arrays for arrays with n or more dimensions.
rpm
instructs the compiler to produce executable output to run under the PGI RPM homogeneous communications system.
rpm1
instructs the compiler to produce executable output to run under the PGI RPM1 communications system.
sequence
All variables are created as SEQUENCE variables, where sequential storage is assumed.
standard
Causes the compiler to flag source code that does not conform to the ANSI standard (note, currently there is no ANSI standard for HPF).
stats
Causes the compiler load the pghpf runtime libraries that keep track of communications and message statistics for use with the pghpf runtime -stat msg and -stat msgs options.
[no]upcase
The compiler allows uppercase letters in identifiers. With -Mupcase, the identifiers "X" and "x" are different, and keywords must be in lower case. This selection also affects the linking process: if you compile and link the same source code using -Mupcase on one occasion and -Mnoupcase on another, you may get two different executables (depending on whether the source contains uppercase letters). The standard libraries are compiled using the default -Mnoupcase.