Parallel Programming Guide for HP-UX Systems

Memory classes
Memory class assignments
Chapter 7 127
Memory class assignments
In Fortran, compiler directives are used to assign memory classes to data
items. In C and C++, memory classes are assigned through the use of
syntax extensions, which are defined in the header file
/usr/include/spp_prog_model.h. This file must be included in any C
or C++ program that uses memory classes. In C++, you can also use
operator new to assign memory classes.
The Fortran memory class declarations must appear with other
specification statements; they cannot appear within executable
statements.
In C and C++, parallel storage class extensions are used, so memory
classes are assigned in variable declarations.
On a single-node system, HP compilers provide mechanisms for
statically assigning memory classes. This chapter discusses these
memory class assignments.
The form of the directives and pragmas associated with is shown in
Table 7-1.
where (for Fortran)
memory_class_name
can be THREAD_PRIVATE, or NODE_PRIVATE
namelist
is a comma-separated list of variables, arrays, and/or
COMMON block names to be assigned the class
memory_class_name
. COMMON block names must be
Table 7-1 Form of memory class directives and variable declarations
Language Form
Fortran C$DIR memory_class_name(namelist)
C/C++ #include <spp_prog_model.h>
.
.
.
[storage_class_specifier] memory_class_name type_specifier namelist