You can use some compilers on SX-ACE, for example, the SX cross compiler, the MPI/SX compiler, and the HPF/SX cross compiler.

 

Compile command

Please be aware that the command name differs according to the language used (on a per-language basis) . The compile command for FORTRAN is "sx90", and the compile command for both C and C++ is "sxc++".In the case of using HPF/SX, the compile command is "hpfsx".

FORTRAN C C++
SX cross compiler sxf90 sxc++
MPI/SX cross compiler sxmpif90 sxmpic++
HPF/SX cross compiler sxhpf Not support C,C++

* note

The following is how to use the compiler.
If you use these options below, please specify at [option].

 

 

Compilation for serial execution(un-parallelization)

This compilation is very simple and does not parallelize for serial execution.

$ sxf90 [options] source_file
$ sxc++ [options] source_file

 

Automatic Parallelization

This is the process whereby the compiler automatically parallelizes the source program, and this is the parallelization for in node(shared-memory parallelization).

$ sxf90 -P auto [options] source_file
$ sxc++ -P auto [options] source_file

 

OpenMP

This is the process whereby the compiler parallelizes by the directive entered into the program, and this is the parallelization for in node. (shared-memory parallelization).

$ sxf90 -P openmp [options] source_file
$ sxc++ -P openmp [options] source_file

 

MPI

This is the inter node parallelization by MPI (distributed-memory parallelization).

$ sxmpif90 [options] source_file
$ sxmpic++ [options] source_file

 

MPI and Automatic Parallelization

This is hybrid parallelization. Parallelize inter node by MPI and in addition parallelize in node by automatic parallelization (distributed-memory parallelization and shared-memory parallelization).

$ sxmpif90 -P auto [options] source_file
$ sxmpic++ -P auto [options] source_file

 

MPI and OpenMP

This is hybrid parallelization. Parallelize inter node by MPI and in addition parallelize in node by OpenMP (distributed-memory parallelization and shared-memory parallelization).

$ sxmpif90 -P openmp [options] source_file
$ sxmpic++ -P openmp [options] source_file

 

 

List of Options

For parallelization

You can specify the following options for parallelization:

Option
Description
note
Parallelization
Local variable
-P auto

Automatic Parallelization

Allocate stack Must specify environment variable "F_RSVTASK"
-P openmp

OpenMP

Allocate stack Must specify environment variable "OMP_NUM_THREADS"
-P multi

Parallelization

Allocate stack
-P stack

Not use

Allocate stack Default setting for C/C++
-P static

Not use

Allocate static Default setting for FORTRAN, none for C/C++

When designating the "auto" option, the compiler automatically judges and parallelizes. When designating the "openmp" or "multi" option, the compiler parallelizes the part entered in the directive or some. When designating the "stack" option, the compiler does not parallelize, but compiles a single task program. When designating "static", the compiler allocates the locale variable to static.
Please see the following about the usage of "auto" and "openmp" options:
How to tune with openMP/auto parallelism(SX)

 

For Optimization and Vectorization

You can specify the following options for optimization and vectorization.

Option Description Level Note
Level of optimization Level of vectorization
-C hopt Optimize the maximum level Vectorize the maximum level High This option includes the side effects of optimization and vectorization.
-C vopt Optimize the maximum level Vectorize the normal level Medium high

Default setting.

This option includes the side effects of optimization and vectorization.

-C sopt Optimize the maximum level Do not vectorize Medium

This option includes the side effects of optimization.

-C vsafe Optimize the part without side effect. Vectorize the part without side effect. Medium low
-C ssafe Optimize the part without side effect. Do not vectorize Low
-C debug Do not optimize Do not vectorize - This mode is for debug.

When compiling the program you did not execute on SX-ACE before, we recommend that you specify from a lower level of optimization and specify from a higher level after checking if the program executed without error. In particular, if specifying higher level options includes side effects, the program may not execute correctly. If you get an error when designating a higher level option or if you cannot execute correctly, please re-specify at the lower level option and check the execution.

 

The listing option

If you get a list of the program changed by optimization and vectorization, you must specify an "-Rn" option. Please see the following table about the listing options you can specify.
 
*note

    This table is based on the FORTRAN compiler. Please see the following about the C/C++ compiler because th specifications are different:
    C++/SX Programmer's Guide
Option Description Notes
-R0 Specifies that no listing is output. Default setting
-R1 Specifies that the "transformation listing" is output.
-R2 Specifies that the "transformation listing" and the "formatted listing" are output.
-R3 Specifies that "the source program listing" is output. -R3 and -R4 are same output information.
-R4
-R5 Specifies that "the formatted listing" is output.

If you specify these options besides -R0, you will get the listing file and the suffix of the source file name will have ".L". (In the case of "test.f", you will get "test.L") .You can open this file with editor, etc., because this is a text file.
Also, please see "Chapter 11, Compile-Time Output Lists" in the following manual, about how to see the listing file:

FORTRAN90/SX Programmer's Guide (Authentication required)

 

Detail of usage

If you want to understand usage or options beside those above, please see the compiler manual. Please note that this manual requires authentication.

FORTRAN90/SX Programmer's Guide   FORTRAN90/SX Programmer's Guide