Commit 5748ad54 authored by Andreas Marek's avatar Andreas Marek

Rename various prepare matrix functions

It is planned to add another matrix type for the tests.
The names of the prepare routines have become a bit inconsistent and
confusing. Thus the rename
parent 06b170c4
......@@ -181,7 +181,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(complex double));
ev = malloc(na*sizeof(double));
prepare_matrix_complex_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_complex_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
if (myid == 0) {
printf("\n");
......
......@@ -177,7 +177,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(double));
ev = malloc(na*sizeof(double));
prepare_matrix_real_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_real_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
if (myid == 0) {
printf("\n");
......
......@@ -181,7 +181,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(complex float));
ev = malloc(na*sizeof(float));
prepare_matrix_complex_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_complex_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
if (myid == 0) {
printf("\n");
......
......@@ -178,7 +178,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(float));
ev = malloc(na*sizeof(float));
prepare_matrix_real_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_real_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
if (myid == 0) {
printf("\n");
......
......@@ -202,9 +202,9 @@ int main(int argc, char** argv) {
#endif
#ifdef DOUBLE_PRECISION_COMPLEX
prepare_matrix_complex_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_complex_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#else
prepare_matrix_complex_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_complex_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#endif
if (myid == 0) {
......
......@@ -195,9 +195,9 @@ int main(int argc, char** argv) {
#endif
#ifdef DOUBLE_PRECISION_REAL
prepare_matrix_real_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_real_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#else
prepare_matrix_real_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_real_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#endif
if (myid == 0) {
printf("\n");
......
......@@ -197,9 +197,9 @@ int main(int argc, char** argv) {
ev = malloc(na*sizeof(float));
#endif
#ifdef DOUBLE_PRECISION_COMPLEX
prepare_matrix_complex_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_complex_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#else
prepare_matrix_complex_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_complex_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#endif
if (myid == 0) {
......
......@@ -192,9 +192,9 @@ int main(int argc, char** argv) {
ev = malloc(na*sizeof(float));
#endif
#ifdef DOUBLE_PRECISION_REAL
prepare_matrix_real_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_real_double_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#else
prepare_matrix_real_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
prepare_matrix_random_real_single_f(na, myid, na_rows, na_cols, sc_desc, a, z, as);
#endif
if (myid == 0) {
printf("\n");
......
......@@ -201,7 +201,7 @@ program test_complex2
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -197,7 +197,7 @@ program test_real2
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -201,7 +201,7 @@ program test_complex2
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -196,7 +196,7 @@ program test_real2
allocate(as(na_rows,na_cols))
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -210,7 +210,7 @@ program test_complex_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
elpa_print_times = .true.
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -172,7 +172,7 @@ program test_cholesky
allocate(as(na_rows,na_cols))
allocate(ev(na))
! call prepare_matrix(na, myid, sc_desc, a, z, as)
! call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! b(:,:) = 2.0 * a(:,:)
! c(:,:) = 0.0
......
......@@ -209,7 +209,7 @@ program test_complex_gpu_version_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -173,7 +173,7 @@ program test_invert_trm
allocate(as(na_rows,na_cols))
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, b, z, bs)
call prepare_matrix_random(na, myid, sc_desc, b, z, bs)
bs(:,:) = b(:,:)
a(:,:) = CONE - CONE
......
......@@ -166,7 +166,7 @@ program test_transpose_multiply
allocate(as(na_rows,na_cols))
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
b(:,:) = 2.0_ck8 * a(:,:)
c(:,:) = 0.0_ck8
......
......@@ -202,7 +202,7 @@ program test_real_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
elpa_print_times = .true.
!-------------------------------------------------------------------------------
......
......@@ -202,7 +202,7 @@ program test_real_gpu_version_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -174,7 +174,7 @@ program test_invert_trm
allocate(d (na))
allocate(e (na))
call prepare_matrix(na, myid, sc_desc, b, z, bs)
call prepare_matrix_random(na, myid, sc_desc, b, z, bs)
bs(:,:) = b(:,:)
a(:,:) = 0.0_rk8
......
......@@ -166,7 +166,7 @@ program test_transpose_multiply
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
b(:,:) = 2.0_rk8 * a(:,:)
c(:,:) = 0.0_rk8
......
......@@ -210,7 +210,7 @@ program test_complex_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -172,7 +172,7 @@ program test_cholesky
allocate(as(na_rows,na_cols))
allocate(ev(na))
! call prepare_matrix(na, myid, sc_desc, a, z, as)
! call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! b(:,:) = 2.0 * a(:,:)
! c(:,:) = 0.0
......
......@@ -209,7 +209,7 @@ program test_complex_gpu_version_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -172,7 +172,7 @@ program test_invert_trm
allocate(as(na_rows,na_cols))
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, b, z, bs)
call prepare_matrix_random(na, myid, sc_desc, b, z, bs)
bs(:,:) = b(:,:)
......
......@@ -166,7 +166,7 @@ program test_transpose_multiply
allocate(as(na_rows,na_cols))
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
b(:,:) = 2.0_ck4 * a(:,:)
c(:,:) = 0.0_ck4
......
......@@ -202,7 +202,7 @@ program test_real_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -202,7 +202,7 @@ program test_real_gpu_version_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
!-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors
......
......@@ -174,7 +174,7 @@ program test_invert_trm
allocate(d (na))
allocate(e (na))
call prepare_matrix(na, myid, sc_desc, b, z, bs)
call prepare_matrix_random(na, myid, sc_desc, b, z, bs)
bs(:,:) = b(:,:)
a(:,:) = 0.0_rk4
......
......@@ -167,7 +167,7 @@ program test_transpose_multiply
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
b(:,:) = 2.0_rk4 * a(:,:)
c(:,:) = 0.0_rk4
......
......@@ -196,7 +196,7 @@ program test_complex2_double_banded
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set values outside of the bandwidth to zero
bandwidth = nblk
......
......@@ -116,7 +116,7 @@ program test_interface
z1(:,:) = 0.0
ev1(:) = 0.0
call prepare_matrix(na, myid, sc_desc, a1, z1, as1)
call prepare_matrix_random(na, myid, sc_desc, a1, z1, as1)
allocate(a2 (na_rows,na_cols), as2(na_rows,na_cols))
allocate(z2 (na_rows,na_cols))
allocate(ev2(na))
......@@ -125,7 +125,7 @@ program test_interface
z2(:,:) = 0.0
ev2(:) = 0.0
call prepare_matrix(na, myid, sc_desc, a2, z2, as2)
call prepare_matrix_random(na, myid, sc_desc, a2, z2, as2)
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported"
......
......@@ -213,7 +213,7 @@ program test_complex2_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
......
......@@ -283,7 +283,7 @@ program test_complex2_choose_kernel_with_api_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -229,7 +229,7 @@ program test_complex2_default_kernel_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -226,7 +226,7 @@ program test_complex2_gpu_version_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
......
......@@ -205,7 +205,7 @@ program test_real2_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -289,7 +289,7 @@ program test_real2_choose_kernel_with_api_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -221,7 +221,7 @@ program test_real2_default_kernel_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -223,7 +223,7 @@ program test_real2_gpu_version_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -263,7 +263,7 @@ program test_real2_default_kernel_qr_decomposition_double_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -213,7 +213,7 @@ program test_complex2_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -282,7 +282,7 @@ program test_complex2_choose_kernel_with_api_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -228,7 +228,7 @@ program test_complex2_default_kernel_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -225,7 +225,7 @@ program test_complex2_gpu_version_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -205,7 +205,7 @@ program test_real2_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -287,7 +287,7 @@ program test_real2_choose_kernel_with_api_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -221,7 +221,7 @@ program test_real2_default_kernel_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -223,7 +223,7 @@ program test_real2_gpu_version_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -267,7 +267,7 @@ program test_real2_default_kernel_qr_decomposition_single_precision
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set print flag in elpa1
elpa_print_times = .true.
......
......@@ -191,7 +191,7 @@ program test_real2_double_banded
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set values outside of the bandwidth to zero
bandwidth = nblk
......
......@@ -196,7 +196,7 @@ program test_complex2_single_banded
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set values outside of the bandwidth to zero
bandwidth = nblk
......
......@@ -190,7 +190,7 @@ program test_real2_single_banded
allocate(ev(na))
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
! set values outside of the bandwidth to zero
bandwidth = nblk
......
......@@ -259,7 +259,7 @@ program test_all_real
endif
if (input_options%datatype .eq. 1) then
call prepare_matrix(na, myid, sc_desc, a_real, z_real, as_real)
call prepare_matrix_random(na, myid, sc_desc, a_real, z_real, as_real)
if (input_options%doInvertTrm) then
b_real(:,:) = a_real(:,:)
......@@ -267,7 +267,7 @@ program test_all_real
endif
endif
if (input_options%datatype .eq. 2) then
call prepare_matrix(na, myid, sc_desc, a_complex, z_complex, as_complex)
call prepare_matrix_random(na, myid, sc_desc, a_complex, z_complex, as_complex)
if (input_options%doInvertTrm) then
b_complex(:,:) = a_complex(:,:)
bs_complex(:,:) = a_complex(:,:)
......@@ -901,10 +901,10 @@ program test_all_real
endif ! input_options%doTransposeMultiply
! if (input_options%datatype .eq. 0) then
! call prepare_matrix(na, myid, sc_desc, a_real, z_real, as_real)
! call prepare_matrix_random(na, myid, sc_desc, a_real, z_real, as_real)
! endif
! if (input_options%datatype .eq. 1) then
! call prepare_matrix(na, myid, sc_desc, a_complex, z_complex, as_complex)
! call prepare_matrix_random(na, myid, sc_desc, a_complex, z_complex, as_complex)
! endif
if (input_options%do1stage) then
......
......@@ -285,7 +285,7 @@ program test
as(:,:) = a
#else
if (nev .ge. 1) then
call prepare_matrix(na, myid, sc_desc, a, z, as)
call prepare_matrix_random(na, myid, sc_desc, a, z, as)
else
! zero eigenvectors and not analytic test => toeplitz matrix
#ifdef TEST_SINGLE
......@@ -295,7 +295,7 @@ program test
diagonalElement = 0.45_c_double
subdiagonalElement = 0.78_c_double
#endif
call prepare_toeplitz_matrix(na, diagonalElement, subdiagonalElement, &
call prepare_matrix_toeplitz(na, diagonalElement, subdiagonalElement, &
d, sd, ds, sds, a, as, nblk, np_rows, &
np_cols, my_prow, my_pcol)
endif
......@@ -339,7 +339,7 @@ program test
diagonalElement = 0.45_c_double
subdiagonalElement = 0.78_c_double
#endif
call prepare_toeplitz_matrix(na, diagonalElement, subdiagonalElement, &
call prepare_matrix_toeplitz(na, diagonalElement, subdiagonalElement, &
d, sd, ds, sds, a, as, nblk, np_rows, &
np_cols, my_prow, my_pcol)
#endif /* EIGENVALUES OR TRIDIAGONAL */
......@@ -353,7 +353,7 @@ program test
diagonalElement = (2.546_c_double, 0.0_c_double)
subdiagonalElement = (0.0_c_double, 0.0_c_double)
#endif
call prepare_toeplitz_matrix(na, diagonalElement, subdiagonalElement, &
call prepare_matrix_toeplitz(na, diagonalElement, subdiagonalElement, &
d, sd, ds, sds, a, as, nblk, np_rows, &
np_cols, my_prow, my_pcol)
......
......@@ -44,28 +44,28 @@
module test_prepare_matrix
interface prepare_matrix
module procedure prepare_matrix_complex_double
module procedure prepare_matrix_real_double
interface prepare_matrix_random
module procedure prepare_matrix_random_complex_double
module procedure prepare_matrix_random_real_double
#ifdef WANT_SINGLE_PRECISION_REAL
module procedure prepare_matrix_real_single
module procedure prepare_matrix_random_real_single
#endif
#ifdef WANT_SINGLE_PRECISION_COMPLEX
module procedure prepare_matrix_complex_single
module procedure prepare_matrix_random_complex_single
#endif
end interface
interface prepare_toeplitz_matrix
module procedure prepare_toeplitz_matrix_complex_double
module procedure prepare_toeplitz_matrix_real_double
module procedure prepare_toeplitz_matrix_mixed_complex_complex_double
interface prepare_matrix_toeplitz
module procedure prepare_matrix_toeplitz_complex_double
module procedure prepare_matrix_toeplitz_real_double
module procedure prepare_matrix_toeplitz_mixed_complex_complex_double
#ifdef WANT_SINGLE_PRECISION_REAL
module procedure prepare_toeplitz_matrix_real_single
module procedure prepare_matrix_toeplitz_real_single
#endif
#ifdef WANT_SINGLE_PRECISION_COMPLEX
module procedure prepare_toeplitz_matrix_complex_single
module procedure prepare_toeplitz_matrix_mixed_complex_complex_single
module procedure prepare_matrix_toeplitz_complex_single
module procedure prepare_matrix_toeplitz_mixed_complex_complex_single
#endif
end interface
......
......@@ -41,7 +41,7 @@
!
! Author: A. Marek, MPCDF
subroutine prepare_matrix_&