You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
psblas3/test/spmm/README.md

4.4 KiB

Introduction

This is a directory developed by Luca Pepè Sciarria and Simone Staccone froma Tor Vergata University to start to create some unit tests for PSBLAS 3.9, in particular for psb_spmm routine.

Environment

These tests are developed using a linux environment, in particular Rocky Linux 9.5 (Blue Onyx).

The compiler used is:

  • gnu 12.2.1

The necessary dependnces are:

  • mpich 4.2.2
  • psblas 3.9

In order to have the exact same environment used for testing compile PSBALS library using cuda 12.5.

Getting started

Steps to reproduce the tests:

  • Compile the code using make
  • Insert the matrix files inside the matrix/ directory (or create one if it doesn't exists; psblas3/test/spmm/matrix/)
  • Launch the script autotest.sh
  • Check the output log file test_log.txt to collect results

Test goal

Check the correctness of the matrix-vector multiplication y = Ax using the psb_spmm routine, checking for all the test suite cases.

Test Suite

Overall Analysys

THe subroutine psb_spmm materialize in three different procedures: psb_sspmm, psb_sspmv, psb_sspmv_vect. The focus is on testing the psb_sspmv one, so as first step let's analyze the signature of the function to study a satisfyng input parameter space. The signature of the function is:

psb_sspmv(alpha, a, x, beta, y,&
         & desc_a, info, trans, work,doswap)

In order to have a black-box approach and to consider only the functionalities of the routine, the parameters work and doswap are not considered during this tests, since they are used in situation that presents internally to the library code. Moreover, info it's an output parameter used to signal some kind of error, therefore it is not part of the input space.

There are seven parameters left. In the following tables are highlighted the values assigned to each parameter. THe test are runned composing a Cartesian product of all the possible values assigned to each parameter.

Parameters Values

x vectors are located in the vectors/ directory. They are generated randomly using the same seed and then saved on different files based on their characteristics. The size of the vector is choosen accordingly to the size of the matrix column space considered for the single test instance.

Vector File Name Coefficients Coefficients Description
x_1 x1.txt x_i> 0, \forall i Positive coefficients
x_2 x2.txt x_i < 0, \forall i Negative coefficients
x_3 x3.txt x_i \ne 0, \forall i Random coefficients
x_4 x4.txt x_i = 0, \forall i Null coefficients

y vectors are located in the vectors/ directory. They are generated randomly using the same seed and then saved on different files based on their characteristics. The size of the vector is choosen accordingly to the size of the matrix rows space considered for the single test instance.

Vector File Name Coefficients Coefficients Description
y_1 y1.txt y_i> 0, \forall i Positive coefficients
y_2 y2.txt y_i < 0, \forall i Negative coefficients
y_3 y3.txt y_i \ne 0, \forall i Random coefficients
y_4 y4.txt y_i = 0, \forall i Null coefficients

\alpha

\alpha Value Coefficients Description
\alpha_1 1.0 Positive value
\alpha_2 -1.0 Negative value
\alpha_3 0.0 Null value

\beta

\alpha Value Coefficients Description
\beta_1 1.0 Positive value
\beta_2 -1.0 Negative value
\beta_3 0.0 Null value

trans

Output

The ouput files generated by the test are automatically compared by the autotest.sh script, but if it is needed to manually run the test here it is the naming convenction used.

The results of the computation will be saved on different files based on the instance of the test considered. In particular the naming conventiona format the output file as sol_m#_x#_y#_a#_b#.mtx, where each # is a number choosen w.r.t. the test instance. (Ex. sol_m1_x1_y1_a1_b1.mtx is the solution computed using the first matrix file, the first x vector file , the first y vector file, alpha = 1.0 and beta = 1.0). Moreover, the files will be saved in the serial/ directory if the program is launched using 1 process or in parrallel/ directory if the program is launched with more than one process.

Notes

For now only integer multiplication is tested and on a single matrix

TODO

  • Update docs
  • Parametrize also on trans parameter
  • Create the script autotest.sh
  • Write the I/O output on log file
  • ...