PaStiX Handbook  6.3.2
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.3.2
Author
Mathieu Faverge
Date
2023-07-21

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.

References PastixKernelGEMMBlok2d2d, PastixKernelGEMMBlokLRLR, PastixKernelGEMMCblk1d1d, PastixKernelGEMMCblk1d2d, PastixKernelGEMMCblk2d2d, PastixKernelGEMMCblkFRLR, PastixKernelGEMMCblkLRLR, PastixKernelGETRF, PastixKernelHETRF, PastixKernelPOTRF, PastixKernelPXTRF, PastixKernelSYTRF, PastixKernelTRSMBlok2d, PastixKernelTRSMBlokLR, PastixKernelTRSMCblk1d, PastixKernelTRSMCblk2d, and PastixKernelTRSMCblkLR.

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.

References PastixKernelGEMMBlok2d2d, PastixKernelGEMMCblk1d1d, PastixKernelGETRF, PastixKernelSCALOCblk, PastixKernelSYTRF, PastixKernelTRSMBlok2d, and PastixKernelTRSMCblk1d.

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(), PastixKernelGEMMBlok2d2d, PastixKernelGEMMCblk2d2d, PastixKernelPOTRF, and PastixKernelTRSMCblk2d.

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(), PastixKernelGEMMBlok2d2d, PastixKernelGEMMCblk2d2d, and PastixKernelTRSMBlok2d.

Referenced by pastixModelsLoad().