PURPOSE
To allocate local memory on all the processors.SYNOPSIS
CALL FMSILG (IMD, LOC, LEN)
CALL FMSRLG (RMD, LOC, LEN)
CALL FMSCLG (CMD, LOC, LEN)
INPUT PARAMETERS
- IMD(*) = Integer array(FMSILG)
RMD(*) = Real array (FMSRLG)
CMD(*) = Complex array (FMSCLG).
This is the array you use in your program to reference the allocated memory. This array must be defined by a POINTER or aligned on a natural address boundary as explained below and in the README.TXT file for your machine. - LEN = Integer.
The number of words of the appropriate data type to allocate on each processor.
OUTPUT PARAMETERS:
- LOC = Integer.
Starting address of allocated memory in IMD, RMD or CMD, relative to the address you provided. If you have dimensioned IMD, RMD and CMD starting at 0 in your program, LOC will be the subscript of these arrays. This is the address where the memory starts for the parent (CPU 0). The starting address for process ICPU isL = LOC + LEN*(ICPU-1).
- LEN = Number of words allocated per processor. The input value is rounded up to be of page length.
FMS PARAMETERS:
The following FMS Parameters are especially important to this routine:Parameter | Description |
---|---|
MAXMD | Amount of memory to use |
MAXCPU | The number of processors on which memory is allocated. |
NUMAFL | Use NUMA directive |
MDINIT | How memory is initialized |
MDWHEN | When memory is allocated. |
MDUSED | Amount of memory already used |
SHOW | Display reports |
DESCRIPTION:
These subroutines provide your program with access to the FMS memory manager.The first step is to declare an array in your program that you will use to reference the allocated memory. There are currently two mechanisms used to do this.
- Machines supporting FORTRAN pointers
If your machine supports the FORTRAN POINTER statement, the reference arrays are obtained by including the POINTER statements for the arrays and obtaining the pointer values by calling FMSIGT, as follows:POINTER (CMD_PTR, CMD) POINTER (RMD_PTR, RMD) POINTER (IMD_PTR, IMD) COMPLEX*16 CMD(0:1) REAL*8 RMD(0:1) INTEGER IMD(0:1) ... CALL FMSIGT ('MEMPTR',CMD_PTR) CALL FMSIGT ('MEMPTR',RMD_PTR) CALL FMSIGT ('MEMPTR',IMD_PTR
- Machines not supporting FORTRAN pointers
If your machine does not support the FORTRAN POINTER statement, the reference arrays are obtained as follows:COMMON CMD EQUIVALENCE (IMD, RMD, CMD) COMPLEX*16 CMD(0:1) REAL*8 RMD(0:1) INTEGER IMD(0:1)
On most machines, FMS automatically aligns BLANK COMMON on a 16-byte boundary. You should not be concerned if you use BLANK COMMON for other purposes. FMS does not store any data in CMD(0:1). It simply uses the arrays IMD, RMD and CMD as reference points for the allocated memory.
The value of LOC returned is relative to the array value you provide on the call. For example, if you make the call:
CALL FMSILG (IMD(10), LOC, LEN)the allocated memory will start at IMD(10+LOC).
You may make the value of LOC be an actual subscript of the array by dimensioning the array to start at 0,
INTEGER IMD (0:1)Then when you call the memory allocation subroutine
CALL FMSILG (IMD, LOC, LEN)the allocated memory will start at IMD(LOC).
Examples
As an example, to allocate a vector for each processor X(NUMEQ) call FMSRLG as follows:LEN = NUMEQ CALL FMSRLG (RMD, LCPU1, LEN)For processor N (where N=0 is the parent) the allocated memory is addressed as
L = LCPU1 + LEN*(N-1) X(I) = RMD(L-1+I)The memory will be local to processor N.
These routines are similar to FMSIMG, FMSRMG, and FMSCMG with the following differences:
- LEN is rounded up to be page length,
- LEN words are allocated on each processor,
- The allocated memory is placed locally next to the processor