PaStiX Handbook  6.2.1
models.c File Reference
#include "common.h"
#include "models.h"

Go to the source code of this file.

Functions

int modelsGetKernelId (const char *kernelstr, int *nbcoef)
 Convert a kernel string name found in a model file to its kernel Id. More...
 
void modelsPropagate (pastix_model_t *model, int arithm, pastix_ktype_t kernelid)
 Propagate a given model to all other similare cases to be sure everything is initialized. More...
 
int modelsRead (pastix_model_t *model, const char *modelfilename)
 Initialize the given model with the file given in parameters. More...
 
int modelsInitDefaultCPU (pastix_model_t *model)
 Initialize the CPU model with default values. More...
 
int modelsInitDefaultGPU (pastix_model_t *model)
 Initialize the GPU model with default values. More...
 
pastix_model_t * pastixModelsNew ()
 Create a new model data structure and initialize the values to their default. More...
 
void pastixModelsFree (pastix_model_t *model)
 Free a model data structure. More...
 
void pastixModelsLoad (pastix_data_t *pastix_data)
 Load the performance models that will be used by the solver. More...
 

Detailed Description

PaStiX performance models routines

Version
6.2.0
Author
Mathieu Faverge
Date
2020-03-02

Definition in file models.c.

Function Documentation

◆ modelsGetKernelId()

int modelsGetKernelId ( const char *  kernelstr,
int *  nbcoef 
)

Convert a kernel string name found in a model file to its kernel Id.

Parameters
[in]kernelstrThe kernel string name
[out]nbcoefThe number of coefficient that this kernel will use. Set to 0 on failure.
Return values
Thekernel Id on success
-1on failure

Definition at line 41 of file models.c.

Referenced by modelsRead().

◆ modelsPropagate()

void modelsPropagate ( pastix_model_t *  model,
int  arithm,
pastix_ktype_t  kernelid 
)

Propagate a given model to all other similare cases to be sure everything is initialized.

The given model coefficients defined by the couple (arithm, kernelid) is first extended to all the kernels of the same family in the same arithmetic, and it is then propagated to the other arithmetic by applying a computation ratio on the coefficients.

  • Single real costs 1
  • Double real costs 2
  • Single complex costs 3
  • Double complex costs 4
Parameters
[in,out]modelThe pointer to the allocated model to complete.
[in]arithmThe arithmetic of the initial coefficients to replicate.
[in]kernelidThe kernel Id of the initial coefficients to replicate.

Definition at line 100 of file models.c.

Referenced by modelsInitDefaultCPU(), modelsInitDefaultGPU(), and modelsRead().

◆ modelsRead()

int modelsRead ( pastix_model_t *  model,
const char *  modelfilename 
)

Initialize the given model with the file given in parameters.

Parameters
[in,out]modelThe pointer to the allocated model to initialize.
[in]modelfilenameThe name of the file in which the coefficient values are stored.
Returns
0 on success.
-1 on failure.

Definition at line 219 of file models.c.

References modelsGetKernelId(), modelsPropagate(), and pastix_fopen().

Referenced by pastixModelsLoad().

◆ modelsInitDefaultCPU()

int modelsInitDefaultCPU ( pastix_model_t *  model)

Initialize the CPU model with default values.

Parameters
[in,out]modelThe pointer to the allocated model to initialize.
Returns
0 on success.

Definition at line 337 of file models.c.

References modelsPropagate().

Referenced by pastixModelsLoad().

◆ modelsInitDefaultGPU()

int modelsInitDefaultGPU ( pastix_model_t *  model)

Initialize the GPU model with default values.

Parameters
[in,out]modelThe pointer to the allocated model to initialize.
Returns
0 on success.

Definition at line 423 of file models.c.

References modelsPropagate().

Referenced by pastixModelsLoad().