“
-lscotch -lscotcherr -lm
”.
If you want to handle errors by yourself, you
should not link with library file
libscotcherr.a
, but rather provide a
SCOTCH
errorPrint()
routine. Please refer to section 7.12 for more information.
7.1.4
Machine word size issues
Graph indices are represented in
Scotch
as integer values of type
SCOTCH Num
. By
default, this type equates to the
int
C type, that is, an integer type of size equal
to the one of the machine word. However, it can represent any other integer type.
Indeed, the size of the
SCOTCH Num
integer type can be coerced to 32 or 64 bits
by using the “
-DINTSIZE32
” or “
-DINTSIZE64
” compilation flags, respectively, or
else by using the “
-DINT=
” definition (see Section 8.3 for more information on the
setting of these compilation flags).
Consequently, the C interface of
Scotch
uses two types of integers. Graph-
related quantities are passed as
SCOTCH Num
s, while system-related values such as
file handles, as well as return values of
libScotch
routines, are always passed as
int
s.
Because of the variability of library integer type sizes, one must be careful
when using the Fortran interface of
Scotch
, as it does not provide any proto-
typing information, and consequently cannot produce any warning at link time.
In the manual pages of the
libScotch
routines, Fortran prototypes are written
using three types of
INTEGER
s. As for the C interface, the regular
INTEGER
type
is used for system-based values, such as file handles and MPI communicators, as
well as for return values of the
libScotch
routines, while the
INTEGER*
num
type
should be used for all graph-related values, in accordance to the size of the
SCOTCH
Num
type, as set by the “
-DINTSIZE
x
” compilation flags. Also, the
INTEGER*
idx
type represents an integer type of a size equivalent to the one of a
SCOTCH Idx
, as
set by the “
-DIDXSIZE
x
” compilation flags. Values of this type are used in the For-
tran interface to represent arbitrary array indices which can span across the whole
address space, and consequently deserve special treatment.
In practice, when
Scotch
is compiled on a 32-bit architecture so as
to use 64-bit
SCOTCH Num
s, graph indices should be declared as
INTEGER*8
,
while error return values should still be declared as plain
INTEGER
(that is,
INTEGER*4
) values. On a 32 64-bit architecture, irrespective of whether
SCOTCH
Num
s are defined as
INTEGER*4
or
INTEGER*8
quantities, the
SCOTCH Idx
type
should always be defined as a 64-bit quantity, that is, an
INTEGER*8
, because
it stores differences between memory addresses, which are represented by 64-bit
values. The above is no longer a problem if
Scotch
is compiled such that
int
s
equate 64-bit integers. In this case, there is no need to use any type coercing
definition.
Also, the
MeTiS
compatibility library provided by
Scotch
will not work when
SCOTCH Num
s are not
int
s, since the interface of
MeTiS
uses regular
int
s to represent
graph indices. In addition to compile-time warnings, an error message will be issued
when one of these routines is called.
7.2
Data formats
All of the data used in the
libScotch
interface are of integer type
SCOTCH Num
.
To hide the internals of
Scotch
to callers, all of the data structures are opaque,
that is, declared within
scotch.h
as dummy arrays of double precision values, for
the sake of data alignment. Accessor routines, the names of which end in “
Size
”
49