Commit 50a000db authored by Andreas Marek's avatar Andreas Marek
Browse files

Debug output of test cases

For debugging purposes the test examples of the ELPA library can
now write the Eigenvectors in an ascii file, e.g
a call of "test_real 4000 1500 16 output" will envoke the test
case for real matrices of the ELPA1 library. A matrix of 4000x4000
values will be created an 1500 EV's will be computet with a 16 blocking.
And the results will be --- due to the output flag --- written to a
text file
parent 9e3319b3
...@@ -88,11 +88,15 @@ program test_complex ...@@ -88,11 +88,15 @@ program test_complex
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS integer :: STATUS
logical :: write_to_file
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Parse command line argumnents, if given ! Parse command line argumnents, if given
character*16 arg1 character*16 arg1
character*16 arg2 character*16 arg2
character*16 arg3 character*16 arg3
character*16 arg4
write_to_file = .false.
nblk = 16 nblk = 16
na = 4000 na = 4000
...@@ -106,6 +110,17 @@ program test_complex ...@@ -106,6 +110,17 @@ program test_complex
read(arg2, *) nev read(arg2, *) nev
read(arg3, *) nblk read(arg3, *) nblk
endif endif
if (iargc() == 4) then
call getarg(1, arg1)
call getarg(2, arg2)
call getarg(3, arg3)
call getarg(4, arg4)
read(arg1, *) na
read(arg2, *) nev
read(arg3, *) nblk
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! MPI Initialization ! MPI Initialization
...@@ -113,6 +128,12 @@ program test_complex ...@@ -113,6 +128,12 @@ program test_complex
call mpi_comm_rank(mpi_comm_world,myid,mpierr) call mpi_comm_rank(mpi_comm_world,myid,mpierr)
call mpi_comm_size(mpi_comm_world,nprocs,mpierr) call mpi_comm_size(mpi_comm_world,nprocs,mpierr)
STATUS = 0 STATUS = 0
if (arg4 .eq. "output") then
write_to_file = .true.
if (myid .eq. 0) print *,"Writing output files"
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Selection of number of processor rows/columns ! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible ! We try to set up the grid square-like, i.e. start the search for possible
...@@ -242,6 +263,15 @@ program test_complex ...@@ -242,6 +263,15 @@ program test_complex
if(myid == 0) print *,'Time solve_tridi :',time_evp_solve if(myid == 0) print *,'Time solve_tridi :',time_evp_solve
if(myid == 0) print *,'Time trans_ev_complex:',time_evp_back if(myid == 0) print *,'Time trans_ev_complex:',time_evp_back
if(write_to_file) then
if (myid == 0) then
open(17,file="EVs_complex_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Test correctness of result (using plain scalapack routines) ! Test correctness of result (using plain scalapack routines)
......
...@@ -89,11 +89,17 @@ program test_complex2 ...@@ -89,11 +89,17 @@ program test_complex2
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS integer :: STATUS
logical :: write_to_file
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Parse command line argumnents, if given ! Parse command line argumnents, if given
character*16 arg1 character*16 arg1
character*16 arg2 character*16 arg2
character*16 arg3 character*16 arg3
character*16 arg4
write_to_file = .false.
nblk = 16 nblk = 16
na = 4000 na = 4000
nev = 1500 nev = 1500
...@@ -107,6 +113,16 @@ program test_complex2 ...@@ -107,6 +113,16 @@ program test_complex2
read(arg3, *) nblk read(arg3, *) nblk
endif endif
if (iargc() == 4) then
call getarg(1, arg1)
call getarg(2, arg2)
call getarg(3, arg3)
call getarg(4, arg4)
read(arg1, *) na
read(arg2, *) nev
read(arg3, *) nblk
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! MPI Initialization ! MPI Initialization
...@@ -115,6 +131,12 @@ program test_complex2 ...@@ -115,6 +131,12 @@ program test_complex2
call mpi_comm_size(mpi_comm_world,nprocs,mpierr) call mpi_comm_size(mpi_comm_world,nprocs,mpierr)
STATUS = 0 STATUS = 0
if (arg4 .eq. "output") then
write_to_file = .true.
if (myid .eq. 0) print *,"Writing output files"
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Selection of number of processor rows/columns ! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible ! We try to set up the grid square-like, i.e. start the search for possible
...@@ -217,6 +239,15 @@ program test_complex2 ...@@ -217,6 +239,15 @@ program test_complex2
if(myid == 0) print *,'Time solve tridi :',time_evp_solve if(myid == 0) print *,'Time solve tridi :',time_evp_solve
if(myid == 0) print *,'Time transform back EVs :',time_evp_back if(myid == 0) print *,'Time transform back EVs :',time_evp_back
if(write_to_file) then
if (myid == 0) then
open(17,file="EVs_complex2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Test correctness of result (using plain scalapack routines) ! Test correctness of result (using plain scalapack routines)
......
...@@ -86,11 +86,16 @@ program test_real ...@@ -86,11 +86,16 @@ program test_real
integer :: STATUS integer :: STATUS
logical :: write_to_file
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Parse command line argumnents, if given ! Parse command line argumnents, if given
character*16 arg1 character*16 arg1
character*16 arg2 character*16 arg2
character*16 arg3 character*16 arg3
character*16 arg4
write_to_file = .false.
nblk = 16 nblk = 16
na = 4000 na = 4000
...@@ -105,6 +110,16 @@ program test_real ...@@ -105,6 +110,16 @@ program test_real
read(arg3, *) nblk read(arg3, *) nblk
endif endif
if (iargc() == 4) then
call getarg(1, arg1)
call getarg(2, arg2)
call getarg(3, arg3)
call getarg(4, arg4)
read(arg1, *) na
read(arg2, *) nev
read(arg3, *) nblk
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! MPI Initialization ! MPI Initialization
...@@ -112,6 +127,10 @@ program test_real ...@@ -112,6 +127,10 @@ program test_real
call mpi_comm_rank(mpi_comm_world,myid,mpierr) call mpi_comm_rank(mpi_comm_world,myid,mpierr)
call mpi_comm_size(mpi_comm_world,nprocs,mpierr) call mpi_comm_size(mpi_comm_world,nprocs,mpierr)
if (arg4 .eq. "output") then
write_to_file = .true.
if (myid .eq. 0) print *,"Writing output files"
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Selection of number of processor rows/columns ! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible ! We try to set up the grid square-like, i.e. start the search for possible
...@@ -239,6 +258,16 @@ program test_real ...@@ -239,6 +258,16 @@ program test_real
if(myid == 0) print *,'Time solve_tridi :',time_evp_solve if(myid == 0) print *,'Time solve_tridi :',time_evp_solve
if(myid == 0) print *,'Time trans_ev_real:',time_evp_back if(myid == 0) print *,'Time trans_ev_real:',time_evp_back
if(write_to_file) then
if (myid == 0) then
open(17,file="EVs_real_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Test correctness of result (using plain scalapack routines) ! Test correctness of result (using plain scalapack routines)
......
...@@ -86,11 +86,15 @@ program test_real2 ...@@ -86,11 +86,15 @@ program test_real2
integer :: iseed(4096) ! Random seed, size should be sufficient for every generator integer :: iseed(4096) ! Random seed, size should be sufficient for every generator
integer :: STATUS integer :: STATUS
logical :: write_to_file
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Parse command line argumnents, if given ! Parse command line argumnents, if given
character*16 arg1 character*16 arg1
character*16 arg2 character*16 arg2
character*16 arg3 character*16 arg3
character*16 arg4
write_to_file = .false.
nblk = 16 nblk = 16
na = 4000 na = 4000
...@@ -105,6 +109,15 @@ program test_real2 ...@@ -105,6 +109,15 @@ program test_real2
read(arg3, *) nblk read(arg3, *) nblk
endif endif
if (iargc() == 4) then
call getarg(1, arg1)
call getarg(2, arg2)
call getarg(3, arg3)
call getarg(4, arg4)
read(arg1, *) na
read(arg2, *) nev
read(arg3, *) nblk
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! MPI Initialization ! MPI Initialization
...@@ -113,6 +126,11 @@ program test_real2 ...@@ -113,6 +126,11 @@ program test_real2
call mpi_comm_size(mpi_comm_world,nprocs,mpierr) call mpi_comm_size(mpi_comm_world,nprocs,mpierr)
STATUS = 0 STATUS = 0
if (arg4 .eq. "output") then
write_to_file = .true.
if (myid .eq. 0) print *,"Writing output files"
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Selection of number of processor rows/columns ! Selection of number of processor rows/columns
! We try to set up the grid square-like, i.e. start the search for possible ! We try to set up the grid square-like, i.e. start the search for possible
...@@ -240,6 +258,15 @@ program test_real2 ...@@ -240,6 +258,15 @@ program test_real2
if(myid == 0) print *,'Time solve tridi :',time_evp_solve if(myid == 0) print *,'Time solve tridi :',time_evp_solve
if(myid == 0) print *,'Time transform back EVs :',time_evp_back if(myid == 0) print *,'Time transform back EVs :',time_evp_back
if(write_to_file) then
if (myid == 0) then
open(17,file="EVs_real2_out.txt",form='formatted',status='new')
do i=1,na
write(17,*) i,ev(i)
enddo
close(17)
endif
endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Test correctness of result (using plain scalapack routines) ! Test correctness of result (using plain scalapack routines)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment