1
.TH MA_SIZEOF_OVERHEAD 3 "20 February 1997" "MA Release 1.8" "MA LIBRARY ROUTINES"
4
compute size of block overhead
9
Integer MA_sizeof_overhead(datatype)
10
Integer datatype; /* read-only */
12
.SH "FORTRAN SYNOPSIS"
14
#include "mafdecls.fh"
16
integer function MA_sizeof_overhead(datatype)
20
MA_sizeof_overhead() returns the number of elements of type
22
required to contain the worst case number of bytes of overhead for any block.
24
The following FORTRAN code illustrates the use of MA_sizeof_overhead()
25
by computing the space required for
26
100 integers in 5 allocations in the heap,
27
200 logicals in 4 allocations in the heap,
28
300 reals in 3 allocations in the stack,
29
and 400 doubles in 2 allocations in the stack.
32
#include "mafdecls.fh"
35
integer heap_bytes_data
36
integer heap_bytes_overhead
37
integer heap_bytes_total
38
integer stack_bytes_data
39
integer stack_bytes_overhead
40
integer stack_bytes_total
42
heap_bytes_data = MA_sizeof(MT_INT, 100, MT_BYTE)
43
+ MA_sizeof(MT_LOG, 200, MT_BYTE)
44
heap_bytes_overhead = (5 + 4) * MA_sizeof_overhead(MT_BYTE)
45
heap_bytes_total = heap_bytes_data + heap_bytes_overhead
46
stack_bytes_data = MA_sizeof(MT_REAL, 300, MT_BYTE)
47
+ MA_sizeof(MT_DBL, 400, MT_BYTE)
48
stack_bytes_overhead = (3 + 2) * MA_sizeof_overhead(MT_BYTE)
49
stack_bytes_total = stack_bytes_data + stack_bytes_overhead
50
ok = MA_init(MT_BYTE, stack_bytes_total, heap_bytes_total)
53
unable to set sizes of FORTRAN datatypes
55
This indicates either that the internal state of MA is corrupted
56
or that there is a problem in the C-FORTRAN linkage.
61
must be one of those listed in macdecls.h or mafdecls.fh.
64
C: The number of elements, as described above.
66
FORTRAN: The number of elements, as described above.
70
Include files: /msrc/proj/hpctools/ma/release/current/include
71
Library: /msrc/proj/hpctools/ma/release/current/lib/\fIplatform\fR/libma.a
72
Man pages: /msrc/proj/hpctools/ma/release/current/man/man3
73
Source code: /msrc/proj/hpctools/ma/release/current/tar/ma\fIrelease\fR.tar
81
Gregory S. Thomas, Pacific Northwest National Laboratory