Cypress CSC-1200T Podręcznik Użytkownika Strona 48

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 124
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 47
48 Cray T3E User’s Guide
The symmetric directive is useful when using the SHMEM communica-
tions library.
!dir$ symmetric [var [, var]...]
This directive declares that a PE-private stack variable has the same local
address on all PEs. For more information on the SHMEM library routines,
issue the command man intro_shmem. See also Section 7.4 on page 70.
The directives
!dir$ free
!dir$ fixed
allow you to select the form of the source code within a file. This possi-
bility is an extension to the Fortran 90 standard.
5.8 Fortran 90 modules
One of the strongest features of the Fortran 90 programming language
are modules, which can be used to encapsulate data and procedures. In
this way, one can define abstract data types which hide implementation
details, and only the interface is public.
A module must be compiled before it can be used in a program unit. In
T3E the module definitions are placed in an object file with the suffix
.o. During the compilation of the main program the compiler looks for
module definitions in all the .o files and .a archives in the present or
specified directories.
As an example, suppose that a program consists of three modules called
myprec (file myprec.f90), matrix (file matrix.f90), and cg (file cg.f90)
together with the main program (iterate.f90). Assume that matrix
uses myprec, cg uses myprec and matrix, and the main program uses
all three modules. Then we can compile the program as follows:
t3e% f90 -c myprec.f90
t3e% f90 -c matrix.f90
t3e% f90 -c cg.f90
t3e% f90 -o iterate iterate.f90 myprec.o matrix.o cg.o
The resulting executable program is called iterate. Note that the call
hierarchy of the modules is reflected in the order in which they are
compiled.
Using the make system is a convenient way to handle the compilation and
linking. In the makefile one must specify the dependencies between
the modules and other program units (see Section 9.1). The following
makefile handles the above example.
OBJS= iterate.o myprec.o matrix.o cg.o
OPTS= -c
Przeglądanie stron 47
1 2 ... 43 44 45 46 47 48 49 50 51 52 53 ... 123 124

Komentarze do niniejszej Instrukcji

Brak uwag