Go to the first, previous, next, last section, table of contents.


Initialization and Termination Functions

Before initializing Global Arrays proper, the underlying messaging layer must be initialized. In the case of HPVM Global Arrays, this refers to TCGMSG, which is initialized with the following functions:

Fortran subroutine: SUBROUTINE PBEGINF

C function: void PBEGIN_ (void)
Initialize TCGMSG (which, in turn, initializes SHMEM and FM). This function must be called before any of the Global Arrays functions. It is an individual operation.

Programs that use the MA memory allocator need to initialize it with one of the following function:

Fortran function: LOGICAL FUNCTION MA_init (datatype, nominal_stack, nominal_heap)
INTEGER datatype, nominal_stack, nominal_heap

C function: Boolean MA_init (Integer datatype, Integer nominal_stack, Integer nominal_heap)
Initialize the memory allocator, instructing it to reserve enough space to allocate nominal_heap elements of type datatype in the heap and nominal_stack elements of type datatype on the stack.

datatype should be one of the following:

Fortran:
MT_F_BYTE, MT_F_INT, MT_F_LOG, MT_F_REAL, MT_F_DBL, MT_F_SCPL, or MT_F_DCPL
C:
MT_C_CHAR, MT_C_INT, MT_C_LONGINT, MT_C_FLOAT, MT_C_DBL, MT_C_LDBL, MT_C_SCPL, MT_C_DCPL, or MT_C_LDCPL

MA_init() is an individual operation.

Global Arrays itself is initialized with one of the following functions:

Fortran subroutine: SUBROUTINE GA_initialize

C function: void GA_initialize (void)
Allocate and initialize Global Arrays' internal data structures. This is a collective operation.

At the end of the program, TCGMSG and Global Arrays should be brought down cleanly with the following functions:

Fortran subroutine: SUBROUTINE PENDF

C function: void PEND_ (void)
Stop TCGMSG, shut down SHMEM and FM, and free all of the communication data structures. This is a collective operation.

Fortran subroutine: SUBROUTINE GA_terminate

C function: void GA_terminate (void)
Delete all distributed arrays and free all of the internal Global Arrays data structures. This is a collective operation.


Go to the first, previous, next, last section, table of contents.