[DOCS] Major changes in main test README.md in order to report all the computational kernels that should be analyzed

test_dev
Stack-1 11 months ago
parent acb71a1c4d
commit 0f786e5b18

@ -9,13 +9,26 @@ The compiler used is:
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.
- PSBLAS 3.9
- CUDA 12.5
## Routines
- psb_geaxby
- psb_spmm
In this test suite were considered only computational routines implemented by PSBLAS, according to the version 3.9 of the documentation. In the following table are reported all the kernels, their implementation and wheter or not they were tested yet.
|**Kernel**| **PSBLAS Subroutine**|**Description**|**Test**|
| ------------------------------- | :--------------------------: | ---------------------------------------------------------------------- | :---------------: |
|**General Dense Matrix Sum**| `psb_geaxpby`| This subroutine is an interface to the computational kernel for dense matrix sum: $$Y \leftarrow \alpha X + \beta Y $$|Work in progress :hammer_and_wrench:|
| **Dot product**|`psb_gedot`|This function computes dot product between two vectors x and y. $$ dot \leftarrow x^T y $$ If x and y are real vectors it computes dot-product as: $$ dot \leftarrow x^H y $$|No ❌|
| **Generalized Dot Product** |`psb_gedots`|This subroutine computes a series of dot products among the columns of two dense matrices x and y: $$ res(i) \leftarrow x(:,i)^T y(:,i) $$ If the matrices are complex, then the usual convention applies, i.e. the conjugate transpose of x is used. If x and y are of rank one, then res is a scalar, else it is a rank one array.|No ❌|
|**Infinity-Norm of Vector**|`psb_normi`/`psb_geamax`|This function computes the infinity-norm of a vector x. If x is a real vector it computes infinity norm as: $$ amax \leftarrow max \mid x_i \mid $$ else if x is a complex vector then it computes the infinity-norm as: $$ amax \leftarrow max(\mid re(x_i) \mid + \mid im(x_i) \mid)$$|No ❌|
|**Generalized Infinity Norm**|`psb_geamaxs`|This subroutine computes a series of infinity norms on the columns of a dense matrix x: $$ res(i) \leftarrow max_k \mid x(k,i) \mid $$| No ❌ |
| **1-Norm of Vector**| `psb_norm1` / `psb_geasums`|This function computes the 1-norm of a vector x. If x is a real vector it computes 1-norm as: $$ asum \leftarrow \mid \mid x_i \mid \mid $$ else if x is a complex vector then it computes 1-norm as: $$ asum \leftarrow \mid \mid re(x) \mid \mid_1 + \mid \mid im(x) \mid \mid_1 $$ |No ❌|
|**Generalized 1-Norm of Vector**|`psb_geasums`|This subroutine computes a series of 1-norms on the columns of a dense matrix x: $$ res(i) \leftarrow max_k \mid x(k,i) \mid $$ This function computes the 1-norm of a vector x. If x is a real vector it computes 1-norm as: $$ res(i) \leftarrow \mid \mid x_i \mid \mid $$ else if x is a complex vector then it computes 1-norm as: $$ res(i) \leftarrow \mid \mid re(x) \mid \mid_\ + \mid \mid im(x) \mid \mid_1 $$ |No ❌|
| **2-Norm of Vector**|`psb_norm2` / `psb_genrm2`| This function computes the 2-norm of a vector x. If x is a real vector it computes 2-norm as: $$ nrm2 \leftarrow \sqrt{x^T x}$$ else if x is a complex vector then it computes 2-norm as: $$ nrm2 \leftarrow \sqrt{x^H x}$$|No ❌|
|**Generalized 2-Norm of Vector**|`psb_genrm2s` / `psb_spnrm1` |This subroutine computes a series of 2-norms on the columns of a dense matrix x: $$ res(i) \leftarrow \mid \mid x(:,i) \mid \mid_2 $$|No ❌|
|**1-Norm of Sparse Matrix**|`psb_norm1`|This function computes the 1-norm of a matrix A: $$ nrm1 \leftarrow \mid \mid A \mid \mid_1 $$ where A represents the global matrix A|No ❌|
|**Infinity Norm of Sparse Matrix**|`psb_normi` / `psb_spnrmi`|This function computes the infinity-norm of a matrix A: $$ nrmi \leftarrow \mid \mid A \mid \mid_{\infty}$$ where: A represents the global matrix A|No ❌|
|**Sparse Matrix by Dense Matrix Product**| `psb_spmm`|This subroutine computes the Sparse Matrix by Dense Matrix Product: $$ y \leftarrow \alpha A x + \beta y$$ $$ y \leftarrow \alpha A^T x + \beta y$$ $$ y \leftarrow \alpha A^H x + \beta y$$ where: <br> x is the global dense matrix x_{:,:} <br> y is the global dense matrix y_{:,:} <br> A is the global sparse matrix A|Work in progress ✅|
|**Triangular System Solve**|`psb_spsm`|This subroutine computes the Triangular System Solve: $$ y \leftarrow \alpha T^{-1} x + \beta y $$ $$ y \leftarrow \alpha D^{-1} x + \beta y $$ $$ y \leftarrow \alpha T^{-1} D x + \beta y $$ $$ y \leftarrow \alpha T^{-T} x + \beta y $$ $$ y \leftarrow \alpha D T^{-T} x + \beta y $$ $$ y \leftarrow \alpha T^{-T} D x + \beta y $$ $$ y \leftarrow \alpha T^{-H} x + \beta y $$ $$ y \leftarrow \alpha D T^{-H} x + \beta y $$ $$ y \leftarrow \alpha T^{-H} D x + \beta y $$ where: <br> x is the global dense matrix x_{:,:} <br> y is the global dense matrix y_{:,:} <br> T is the global sparse block triangular submatrix T <br> D is the scaling diagonal matrix|No ❌|
|**Entrywise Product**|`psb_gemlt`|This function computes the entrywise product between two vectors x and y $$ dot \leftarrow x(i)y(i)$$|No ❌|
|**Entrywise Division**|`psb_gediv`|This function computes the entrywise division between two vectors x and y $$ div \leftarrow \frac{x(i)}{y(i)}$$|No ❌|
|**Entrywise Inversion**|`psb_geinv`|This function computes the entrywise inverse of a vector x and puts it into y $$ inv \leftarrow \frac{1}{x(i)}$$|No ❌|

@ -1,2 +1,9 @@
# 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_geaxpby``` routine.
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_geaxpby``` routine.
## Getting started
Steps to reproduce the tests:
- Compile the code using ``` make ```
- Launch the script autotest.sh (Still not done)
- Check the output log file psblas_geaxpby_test.log to collect results

@ -12,10 +12,24 @@ program main
! parameters array
character(len=64) :: x(4),y(4)
real(psb_ipk_) :: alpha(3), beta(3)
real(psb_spk_) :: alpha(3), beta(3)
integer(psb_ipk_) :: arr_size
integer(psb_ipk_) :: tests_number, count
! cycle indexes variables
integer(psb_ipk_) :: i,j,k,h,l
integer(psb_ipk_) :: info, ret, unit
! Setup logger output
unit = 43
open(unit, file='psblas_geaxpby_test.log', status='replace', action='write', iostat=info)
if (info /= 0) then
print *, 'Error opening output file.'
stop
end if
! Set psb_out_unit to redirect PSBLAS output
psb_out_unit = unit
! Initialize parameters
@ -37,34 +51,49 @@ program main
beta(2) = -sone
beta(3) = szero
arr_size = 10000
tests_number = size(x) * size(y) * size(alpha) * size(beta)
count = 0
call psb_init(ctxt)
call psb_info(ctxt,my_rank,np)
if(my_rank == psb_root_) then
write(psb_out_unit,*) 'Welcome to PSBLAS version: ',psb_version_string_
write(psb_out_unit,*) 'This is the psb_geaxpby_test sample program'
write(psb_out_unit,'(A,A)') 'Welcome to PSBLAS version: ',psb_version_string_
write(psb_out_unit,'(A)') 'This is the psb_geaxpby_test sample program'
write(psb_out_unit,'(A)') ''
call generate_vectors(10000,10000)
call generate_vectors(arr_size)
end if
call psb_barrier(ctxt)
if(my_rank == psb_root_) then
write(psb_out_unit,*) size(x)
end if
do i=1,size(x)
do j=1,size(y)
do k=1,size(alpha)
do h=1,size(beta)
call psb_geaxpby_kernel(x_file=x(i), y_file=y(j), alpha = alpha(k), beta = beta(h), ctxt = ctxt)
call psb_geaxpby_kernel(x_file=x(i), y_file=y(j), alpha = alpha(k), beta = beta(h), &
& arr_size = arr_size, ctxt = ctxt, ret = ret)
if(my_rank == psb_root_) then
count = count + 1
if(ret /= -1) then
write(psb_out_unit, '(A,I0,A,I0,A,A)') &
& "Generation geaxpby single precision result file ", count , "/", tests_number, CHAR(9), "[OK]"
else
write(psb_out_unit, '(A,I0,A,I0,A,A)') &
& "Generation geaxpby single precision result file ", count , "/", tests_number, CHAR(9), "[FAIL]"
end if
end if
call psb_barrier(ctxt)
end do
end do
end do
end do
! Here double precision comparison should be done
call psb_exit(ctxt)

@ -50,7 +50,7 @@ module psb_geaxpby_test
contains
subroutine psb_geaxpby_kernel(x_file, y_file, alpha, beta, ctxt)
subroutine psb_geaxpby_kernel(x_file, y_file, alpha, beta, arr_size, ctxt, ret)
use psb_base_mod
use psb_util_mod
@ -59,8 +59,11 @@ module psb_geaxpby_test
! input parameters
character(len = *), intent(in) :: x_file, y_file
real(psb_spk_), intent(in) :: alpha, beta
integer(psb_ipk_), intent(in) :: arr_size
type(psb_ctxt_type), intent(in) :: ctxt
character(len=:), allocatable :: output_file_name
! output parameters
integer(psb_ipk_), intent(out) :: ret
! vectors
type(psb_s_vect_type) :: x, y
@ -69,13 +72,18 @@ module psb_geaxpby_test
type(psb_desc_type) :: desc_a
! communication context
type(psb_ctxt_type), intent(in) :: ctxt
integer(psb_ipk_) :: my_rank, np, info, err_act
! variables outside PSLBALS data structures
real(psb_spk_), allocatable :: x_global(:), y_global(:)
integer(psb_ipk_) :: i
! others
logical :: exists
character(len=:), allocatable :: output_file_name
info = psb_success_
call psb_info(ctxt,my_rank,np)
@ -87,13 +95,25 @@ module psb_geaxpby_test
! Generate random array for b using always the same seed
if(my_rank == psb_root_) then
write(*,*) "Here"
allocate(x_global(10000))
allocate(y_global(10000))
allocate(x_global(arr_size))
allocate(y_global(arr_size))
call mm_array_read(x_global,info,filename=x_file)
call mm_array_read(y_global,info,filename=y_file)
end if
! Allocate descriptor as if it was a block rows distribution
call psb_cdall(ctxt, desc_a, info,nl=10000/np)
if(info /= psb_success_) then
write(psb_out_unit,*) "Error allocating desc_a data structure"
goto 9999
end if
call psb_cdasb(desc_a, info)
if(info /= psb_success_) then
write(psb_out_unit,*) "Error assembling desc_a data structure"
goto 9999
end if
call psb_geall(x,desc_a,info)
if(info /= psb_success_) then
@ -101,6 +121,7 @@ module psb_geaxpby_test
goto 9999
end if
! Populate x class using data from x_global vector
call psb_scatter(x_global,x,desc_a,info,root=psb_root_)
if(info /= psb_success_) then
@ -126,14 +147,24 @@ module psb_geaxpby_test
! y = alpha * x + beta * y
call psb_geaxpby(alpha,x,beta,y,desc_a,info)
if(info /= psb_success_) then
write(psb_out_unit,*) "Error in psb_spmm routine"
write(psb_out_unit,*) "Error in psb_geaxpby routine"
goto 9999
end if
! Make the root process be the one that saves everything on file
if(np == 1) then
! Check if output directory exists
inquire(file='serial/', exist=exists)
if (.not.exists) then
call system('mkdir serial/')
end if
output_file_name = "serial/"
else
! Check if output directory exists
inquire(file='parallel/', exist=exists)
if (.not.exists) then
call system('mkdir parallel/')
end if
output_file_name = "parallel/"
end if
@ -187,9 +218,7 @@ module psb_geaxpby_test
! Error handling
9999 call psb_error(ctxt)
call psb_error_handler(ctxt,err_act)
9999 ret = -1
stop
end subroutine
@ -197,22 +226,30 @@ module psb_geaxpby_test
!> @brief Function to randomly generate x and y vectors
!> @brief Function to randomly generate x and y vectors
!! and save them on multiple files based on their
!! coefficients values.
!!
subroutine generate_vectors(rows, cols)
subroutine generate_vectors(arr_size)
use psb_base_mod
use psb_util_mod
implicit none
integer(psb_ipk_), intent(in) :: rows, cols
integer(psb_ipk_), intent(in) :: arr_size
real(psb_spk_), allocatable :: x(:), y(:)
integer(psb_ipk_) :: i, info
logical :: exists
! Check if output directory exists
inquire(file='vectors/', exist=exists)
if (.not.exists) then
call system('mkdir vectors/')
end if
allocate(x(rows))
allocate(y(cols))
allocate(x(arr_size))
allocate(y(arr_size))
call random_init(repeatable=.true.,image_distinct=.true.)
call random_number(x)
@ -223,11 +260,11 @@ module psb_geaxpby_test
call mm_array_write(y,"Positive vector",info,filename="vectors/y1.mtx")
! Write only negative in x_2
do i=1,rows
do i=1,arr_size
x(i) = -x(i)
end do
do i=1,cols
do i=1,arr_size
y(i) = -y(i)
end do
@ -236,12 +273,12 @@ module psb_geaxpby_test
! Since numbers are less than one and always positive, we have to generate negative ones subtractiong 50
do i=1,rows
do i=1,arr_size
x(i) = -x(i) ! Make the values positive again
x(i) = x(i) - 0.5
end do
do i=1,cols
do i=1,arr_size
y(i) = -y(i) ! Make the values positive again
y(i) = y(i) - 0.5
end do
@ -251,11 +288,11 @@ module psb_geaxpby_test
call mm_array_write(y,"Random vector",info,filename="vectors/y3.mtx")
! Write zero in x_4
do i=1,rows
do i=1,arr_size
x(i) = 0
end do
do i=1,cols
do i=1,arr_size
y(i) = 0
end do

@ -0,0 +1,147 @@
Welcome to PSBLAS version: 3.9.0
This is the psb_geaxpby_test sample program
Generation of file 1/144 [OK]
Generation of file 2/144 [OK]
Generation of file 3/144 [OK]
Generation of file 4/144 [OK]
Generation of file 5/144 [OK]
Generation of file 6/144 [OK]
Generation of file 7/144 [OK]
Generation of file 8/144 [OK]
Generation of file 9/144 [OK]
Generation of file 10/144 [OK]
Generation of file 11/144 [OK]
Generation of file 12/144 [OK]
Generation of file 13/144 [OK]
Generation of file 14/144 [OK]
Generation of file 15/144 [OK]
Generation of file 16/144 [OK]
Generation of file 17/144 [OK]
Generation of file 18/144 [OK]
Generation of file 19/144 [OK]
Generation of file 20/144 [OK]
Generation of file 21/144 [OK]
Generation of file 22/144 [OK]
Generation of file 23/144 [OK]
Generation of file 24/144 [OK]
Generation of file 25/144 [OK]
Generation of file 26/144 [OK]
Generation of file 27/144 [OK]
Generation of file 28/144 [OK]
Generation of file 29/144 [OK]
Generation of file 30/144 [OK]
Generation of file 31/144 [OK]
Generation of file 32/144 [OK]
Generation of file 33/144 [OK]
Generation of file 34/144 [OK]
Generation of file 35/144 [OK]
Generation of file 36/144 [OK]
Generation of file 37/144 [OK]
Generation of file 38/144 [OK]
Generation of file 39/144 [OK]
Generation of file 40/144 [OK]
Generation of file 41/144 [OK]
Generation of file 42/144 [OK]
Generation of file 43/144 [OK]
Generation of file 44/144 [OK]
Generation of file 45/144 [OK]
Generation of file 46/144 [OK]
Generation of file 47/144 [OK]
Generation of file 48/144 [OK]
Generation of file 49/144 [OK]
Generation of file 50/144 [OK]
Generation of file 51/144 [OK]
Generation of file 52/144 [OK]
Generation of file 53/144 [OK]
Generation of file 54/144 [OK]
Generation of file 55/144 [OK]
Generation of file 56/144 [OK]
Generation of file 57/144 [OK]
Generation of file 58/144 [OK]
Generation of file 59/144 [OK]
Generation of file 60/144 [OK]
Generation of file 61/144 [OK]
Generation of file 62/144 [OK]
Generation of file 63/144 [OK]
Generation of file 64/144 [OK]
Generation of file 65/144 [OK]
Generation of file 66/144 [OK]
Generation of file 67/144 [OK]
Generation of file 68/144 [OK]
Generation of file 69/144 [OK]
Generation of file 70/144 [OK]
Generation of file 71/144 [OK]
Generation of file 72/144 [OK]
Generation of file 73/144 [OK]
Generation of file 74/144 [OK]
Generation of file 75/144 [OK]
Generation of file 76/144 [OK]
Generation of file 77/144 [OK]
Generation of file 78/144 [OK]
Generation of file 79/144 [OK]
Generation of file 80/144 [OK]
Generation of file 81/144 [OK]
Generation of file 82/144 [OK]
Generation of file 83/144 [OK]
Generation of file 84/144 [OK]
Generation of file 85/144 [OK]
Generation of file 86/144 [OK]
Generation of file 87/144 [OK]
Generation of file 88/144 [OK]
Generation of file 89/144 [OK]
Generation of file 90/144 [OK]
Generation of file 91/144 [OK]
Generation of file 92/144 [OK]
Generation of file 93/144 [OK]
Generation of file 94/144 [OK]
Generation of file 95/144 [OK]
Generation of file 96/144 [OK]
Generation of file 97/144 [OK]
Generation of file 98/144 [OK]
Generation of file 99/144 [OK]
Generation of file 100/144 [OK]
Generation of file 101/144 [OK]
Generation of file 102/144 [OK]
Generation of file 103/144 [OK]
Generation of file 104/144 [OK]
Generation of file 105/144 [OK]
Generation of file 106/144 [OK]
Generation of file 107/144 [OK]
Generation of file 108/144 [OK]
Generation of file 109/144 [OK]
Generation of file 110/144 [OK]
Generation of file 111/144 [OK]
Generation of file 112/144 [OK]
Generation of file 113/144 [OK]
Generation of file 114/144 [OK]
Generation of file 115/144 [OK]
Generation of file 116/144 [OK]
Generation of file 117/144 [OK]
Generation of file 118/144 [OK]
Generation of file 119/144 [OK]
Generation of file 120/144 [OK]
Generation of file 121/144 [OK]
Generation of file 122/144 [OK]
Generation of file 123/144 [OK]
Generation of file 124/144 [OK]
Generation of file 125/144 [OK]
Generation of file 126/144 [OK]
Generation of file 127/144 [OK]
Generation of file 128/144 [OK]
Generation of file 129/144 [OK]
Generation of file 130/144 [OK]
Generation of file 131/144 [OK]
Generation of file 132/144 [OK]
Generation of file 133/144 [OK]
Generation of file 134/144 [OK]
Generation of file 135/144 [OK]
Generation of file 136/144 [OK]
Generation of file 137/144 [OK]
Generation of file 138/144 [OK]
Generation of file 139/144 [OK]
Generation of file 140/144 [OK]
Generation of file 141/144 [OK]
Generation of file 142/144 [OK]
Generation of file 143/144 [OK]
Generation of file 144/144 [OK]

@ -18,7 +18,7 @@ In order to have the exact same environment used for testing compile PSBALS libr
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
- Launch the script autotest.sh (Still not implemented)
- Check the output log file test_log.txt to collect results
## Test goal

Loading…
Cancel
Save