common.c

Part of a parallel direct block solver.

These lines are common routines used by all modules.

Authors

Mathieu Favergefav.nosp@m.erge@labr.nosp@m.i.fr
David GOUDIN.
Pascal HENONhe.nosp@m.non@labr.nosp@m.i.fr
Xavier LACOSTElac.nosp@m.oste@labr.nosp@m.i.fr
Francois PELLEGRINI.
Pierre RAMETra.nosp@m.met@labr.nosp@m.i.fr

Dates

Version 0.0from : 08 may 1998 to 14 sep 1998
Version 2.0from : 27 sep 2004 to 27 sep 2004
Summary
common.cPart of a parallel direct block solver.
clockGetTiming routine.
usagePrintUsage printing routine.
api_iparmreaderReads integer parameters file from disk.
api_dparmreaderReads double parameters file from disk.
api_dumparmDump PaStiX parameters arrays to disk.
set_iparm
set_dparm
Variables
Sort functions
qsortIntFloatAscSort 2 arrays simultaneously, the first array is an array of INT and used as key for sorting.
qsort2IntFloatAscSort 3 arrays simultaneously, the first array is an array of INT and used as primary key for sorting.
qsort2IntAscSort 2 arrays simultaneously, the first array is an array of INT and used as primary key for sorting.
qsort2SmallIntAscSort 2 arrays simultaneously, the first array is an array of integers (int) and used as primary key for sorting.

clockGet

double clockGet (void)

Timing routine.

Uses different timing routines depending on the machine architecture.

Returns

Returns the time ellapsed since <clockStart>.

usagePrint

void usagePrint (FILE * const stream,
const char ** const data)

Usage printing routine.

Prints usage into stream using strings inside data array.

data array must be NULL terminated.

Parameters

streamFile opened in write mode
datatabular containing strings and NULL terminated.

api_iparmreader

int api_iparmreader (char *filename,
INT *iparmtab)

Reads integer parameters file from disk.

The file must contain IPARM_SIZE lines starting with the integer value corresponding.

TODO: return values instead of exit(-1)...

Parameters

filenamename of the file to read from.
iparmtabArray where to store parameters.

Returns

1if file couldn’t be read.

api_dparmreader

int api_dparmreader(char *filename,
double *dparmtab)

Reads double parameters file from disk.

The file must contain IPARM_SIZE lines starting with the double value corresponding.

See atof manual for the format required.

TODO: return values instead of exit(-1)...

Parameters

filenamename of the file to read from.
dparmtabArray where to store parameters.

Returns

1if file couldn’t be read.

api_dumparm

void api_dumparm(FILE *stream,
INT *iparm,
double *dparm)

Dump PaStiX parameters arrays to disk.

Parameters

streamFile opened in write mode
iparminteger parameters array
dparmfloating parameters array

set_iparm

void set_iparm(INT *iparm,
enum IPARM_ACCESS offset,
INT value)

set_dparm

void set_dparm(double *dparm,
enum DPARM_ACCESS offset,
double value)

Variables

Sort functions

INT t

qsortIntFloatAsc

Sort 2 arrays simultaneously, the first array is an array of INT and used as key for sorting.  The second array is an array of FLOAT.

Parameters

pbaseArray of pointers to the first element of each array to sort.
total_elemsNumber of element in each array.

Returns

Nothing

qsort2IntFloatAsc

Sort 3 arrays simultaneously, the first array is an array of INT and used as primary key for sorting.  The second array is an other array of INT used as secondary key.  The third array is an array of FLOAT.

Parameters

pbaseArray of pointers to the first element of each array to sort.
total_elemsNumber of element in each array.

Returns

Nothing

qsort2IntAsc

Sort 2 arrays simultaneously, the first array is an array of INT and used as primary key for sorting.  The second array is an other array of INT used as secondary key.

Parameters

pbaseArray of pointers to the first element of each array to sort.
total_elemsNumber of element in each array.

Returns

Nothing

qsort2SmallIntAsc

Sort 2 arrays simultaneously, the first array is an array of integers (int) and used as primary key for sorting.  The second array is an other array of int used as secondary key.

Parameters

pbaseArray of pointers to the first element of each array to sort.
total_elemsNumber of element in each array.

Returns

Nothing

double clockGet (void)
Timing routine.
void usagePrint (FILE * const stream,
const char ** const data)
Usage printing routine.
int api_iparmreader (char *filename,
INT *iparmtab)
Reads integer parameters file from disk.
int api_dparmreader(char *filename,
double *dparmtab)
Reads double parameters file from disk.
void api_dumparm(FILE *stream,
INT *iparm,
double *dparm)
Dump PaStiX parameters arrays to disk.
void set_iparm(INT *iparm,
enum IPARM_ACCESS offset,
INT value)
void set_dparm(double *dparm,
enum DPARM_ACCESS offset,
double value)
INT t
Close