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) { ...@@ -181,7 +181,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(complex double)); as = malloc(na_rows*na_cols*sizeof(complex double));
ev = malloc(na*sizeof(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) { if (myid == 0) {
printf("\n"); printf("\n");
......
...@@ -177,7 +177,7 @@ int main(int argc, char** argv) { ...@@ -177,7 +177,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(double)); as = malloc(na_rows*na_cols*sizeof(double));
ev = malloc(na*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) { if (myid == 0) {
printf("\n"); printf("\n");
......
...@@ -181,7 +181,7 @@ int main(int argc, char** argv) { ...@@ -181,7 +181,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(complex float)); as = malloc(na_rows*na_cols*sizeof(complex float));
ev = malloc(na*sizeof(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) { if (myid == 0) {
printf("\n"); printf("\n");
......
...@@ -178,7 +178,7 @@ int main(int argc, char** argv) { ...@@ -178,7 +178,7 @@ int main(int argc, char** argv) {
as = malloc(na_rows*na_cols*sizeof(float)); as = malloc(na_rows*na_cols*sizeof(float));
ev = malloc(na*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) { if (myid == 0) {
printf("\n"); printf("\n");
......
...@@ -202,9 +202,9 @@ int main(int argc, char** argv) { ...@@ -202,9 +202,9 @@ int main(int argc, char** argv) {
#endif #endif
#ifdef DOUBLE_PRECISION_COMPLEX #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 #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 #endif
if (myid == 0) { if (myid == 0) {
......
...@@ -195,9 +195,9 @@ int main(int argc, char** argv) { ...@@ -195,9 +195,9 @@ int main(int argc, char** argv) {
#endif #endif
#ifdef DOUBLE_PRECISION_REAL #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 #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 #endif
if (myid == 0) { if (myid == 0) {
printf("\n"); printf("\n");
......
...@@ -197,9 +197,9 @@ int main(int argc, char** argv) { ...@@ -197,9 +197,9 @@ int main(int argc, char** argv) {
ev = malloc(na*sizeof(float)); ev = malloc(na*sizeof(float));
#endif #endif
#ifdef DOUBLE_PRECISION_COMPLEX #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 #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 #endif
if (myid == 0) { if (myid == 0) {
......
...@@ -192,9 +192,9 @@ int main(int argc, char** argv) { ...@@ -192,9 +192,9 @@ int main(int argc, char** argv) {
ev = malloc(na*sizeof(float)); ev = malloc(na*sizeof(float));
#endif #endif
#ifdef DOUBLE_PRECISION_REAL #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 #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 #endif
if (myid == 0) { if (myid == 0) {
printf("\n"); printf("\n");
......
...@@ -201,7 +201,7 @@ program test_complex2 ...@@ -201,7 +201,7 @@ program test_complex2
allocate(ev(na)) 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 ! set print flag in elpa1
elpa_print_times = .true. elpa_print_times = .true.
......
...@@ -197,7 +197,7 @@ program test_real2 ...@@ -197,7 +197,7 @@ program test_real2
allocate(ev(na)) 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 ! set print flag in elpa1
elpa_print_times = .true. elpa_print_times = .true.
......
...@@ -201,7 +201,7 @@ program test_complex2 ...@@ -201,7 +201,7 @@ program test_complex2
allocate(ev(na)) 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 ! set print flag in elpa1
elpa_print_times = .true. elpa_print_times = .true.
......
...@@ -196,7 +196,7 @@ program test_real2 ...@@ -196,7 +196,7 @@ program test_real2
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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 ! set print flag in elpa1
elpa_print_times = .true. elpa_print_times = .true.
......
...@@ -210,7 +210,7 @@ program test_complex_double_precision ...@@ -210,7 +210,7 @@ program test_complex_double_precision
allocate(ev(na)) 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. elpa_print_times = .true.
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Calculate eigenvalues/eigenvectors ! Calculate eigenvalues/eigenvectors
......
...@@ -172,7 +172,7 @@ program test_cholesky ...@@ -172,7 +172,7 @@ program test_cholesky
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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(:,:) ! b(:,:) = 2.0 * a(:,:)
! c(:,:) = 0.0 ! c(:,:) = 0.0
......
...@@ -209,7 +209,7 @@ program test_complex_gpu_version_double_precision ...@@ -209,7 +209,7 @@ program test_complex_gpu_version_double_precision
allocate(ev(na)) 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 ! Calculate eigenvalues/eigenvectors
......
...@@ -173,7 +173,7 @@ program test_invert_trm ...@@ -173,7 +173,7 @@ program test_invert_trm
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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(:,:) bs(:,:) = b(:,:)
a(:,:) = CONE - CONE a(:,:) = CONE - CONE
......
...@@ -166,7 +166,7 @@ program test_transpose_multiply ...@@ -166,7 +166,7 @@ program test_transpose_multiply
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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(:,:) b(:,:) = 2.0_ck8 * a(:,:)
c(:,:) = 0.0_ck8 c(:,:) = 0.0_ck8
......
...@@ -202,7 +202,7 @@ program test_real_double_precision ...@@ -202,7 +202,7 @@ program test_real_double_precision
allocate(ev(na)) 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. elpa_print_times = .true.
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
......
...@@ -202,7 +202,7 @@ program test_real_gpu_version_double_precision ...@@ -202,7 +202,7 @@ program test_real_gpu_version_double_precision
allocate(ev(na)) 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 ! Calculate eigenvalues/eigenvectors
......
...@@ -174,7 +174,7 @@ program test_invert_trm ...@@ -174,7 +174,7 @@ program test_invert_trm
allocate(d (na)) allocate(d (na))
allocate(e (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(:,:) bs(:,:) = b(:,:)
a(:,:) = 0.0_rk8 a(:,:) = 0.0_rk8
......
...@@ -166,7 +166,7 @@ program test_transpose_multiply ...@@ -166,7 +166,7 @@ program test_transpose_multiply
allocate(ev(na)) 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(:,:) b(:,:) = 2.0_rk8 * a(:,:)
c(:,:) = 0.0_rk8 c(:,:) = 0.0_rk8
......
...@@ -210,7 +210,7 @@ program test_complex_single_precision ...@@ -210,7 +210,7 @@ program test_complex_single_precision
allocate(ev(na)) 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 ! Calculate eigenvalues/eigenvectors
......
...@@ -172,7 +172,7 @@ program test_cholesky ...@@ -172,7 +172,7 @@ program test_cholesky
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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(:,:) ! b(:,:) = 2.0 * a(:,:)
! c(:,:) = 0.0 ! c(:,:) = 0.0
......
...@@ -209,7 +209,7 @@ program test_complex_gpu_version_single_precision ...@@ -209,7 +209,7 @@ program test_complex_gpu_version_single_precision
allocate(ev(na)) 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 ! Calculate eigenvalues/eigenvectors
......
...@@ -172,7 +172,7 @@ program test_invert_trm ...@@ -172,7 +172,7 @@ program test_invert_trm
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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(:,:) bs(:,:) = b(:,:)
......
...@@ -166,7 +166,7 @@ program test_transpose_multiply ...@@ -166,7 +166,7 @@ program test_transpose_multiply
allocate(as(na_rows,na_cols)) allocate(as(na_rows,na_cols))
allocate(ev(na)) 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(:,:) b(:,:) = 2.0_ck4 * a(:,:)
c(:,:) = 0.0_ck4 c(:,:) = 0.0_ck4
......
...@@ -202,7 +202,7 @@ program test_real_single_precision ...@@ -202,7 +202,7 @@ program test_real_single_precision
allocate(ev(na)) 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 ! Calculate eigenvalues/eigenvectors
......
...@@ -202,7 +202,7 @@ program test_real_gpu_version_single_precision ...@@ -202,7 +202,7 @@ program test_real_gpu_version_single_precision
allocate(ev(na)) 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 ! Calculate eigenvalues/eigenvectors
......
...@@ -174,7 +174,7 @@ program test_invert_trm ...@@ -174,7 +174,7 @@ program test_invert_trm
allocate(d (na)) allocate(d (na))
allocate(e (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(:,:) bs(:,:) = b(:,:)
a(:,:) = 0.0_rk4 a(:,:) = 0.0_rk4
......
...@@ -167,7 +167,7 @@ program test_transpose_multiply ...@@ -167,7 +167,7 @@ program test_transpose_multiply
allocate(ev(na)) 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(:,:) b(:,:) = 2.0_rk4 * a(:,:)
c(:,:) = 0.0_rk4 c(:,:) = 0.0_rk4
......
...@@ -196,7 +196,7 @@ program test_complex2_double_banded ...@@ -196,7 +196,7 @@ program test_complex2_double_banded
allocate(ev(na)) 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 ! set values outside of the bandwidth to zero
bandwidth = nblk bandwidth = nblk
......
...@@ -116,7 +116,7 @@ program test_interface ...@@ -116,7 +116,7 @@ program test_interface
z1(:,:) = 0.0 z1(:,:) = 0.0
ev1(:) = 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(a2 (na_rows,na_cols), as2(na_rows,na_cols))
allocate(z2 (na_rows,na_cols)) allocate(z2 (na_rows,na_cols))
allocate(ev2(na)) allocate(ev2(na))
...@@ -125,7 +125,7 @@ program test_interface ...@@ -125,7 +125,7 @@ program test_interface
z2(:,:) = 0.0 z2(:,:) = 0.0
ev2(:) = 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 if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported" print *, "ELPA API version not supported"
......
...@@ -213,7 +213,7 @@ program test_complex2_double_precision ...@@ -213,7 +213,7 @@ program test_complex2_double_precision
allocate(ev(na)) 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 ! set print flag in elpa1
......
...@@ -283,7 +283,7 @@ program test_complex2_choose_kernel_with_api_double_precision ...@@ -283,7 +283,7 @@ program test_complex2_choose_kernel_with_api_double_precision
allocate(ev(na)) 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 ! set print flag in elpa1
elpa_print_times = .true. elpa_print_times = .true.
......
...@@ -229,7 +229,7 @@ program test_complex2_default_kernel_double_precision ...@@ -229,7 +229,7 @@ program test_complex2_default_kernel_double_precision
allocate(ev(na)) 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 ! set print flag in elpa1
elpa_print_times = .true. elpa_print_times = .true.
......
...@@ -226,7 +226,7 @@ program test_complex2_gpu_version_double_precision ...@@ -226,7 +226,7 @@ program test_complex2_gpu_version_double_precision