Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
elpa
elpa
Commits
e12db07e
Commit
e12db07e
authored
Apr 04, 2017
by
Lorenz Huedepohl
Browse files
First step of clean-up of the test programs
They are in a sad state, it's all copy&paste and chaos. This commit only touches the surface so far.
parent
f91c0b4b
Changes
60
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/C/elpa1_test_complex_c_version.c
View file @
e12db07e
...
...
@@ -82,21 +82,17 @@ int main(int argc, char** argv) {
double
startVal
;
#ifdef DOUBLE_PRECISION_COMPLEX
complex
double
*
a
,
*
z
,
*
as
,
*
tmp1
,
*
tmp2
;
double
*
ev
,
*
xr
;
complex
double
*
a
,
*
z
,
*
as
;
double
*
ev
;
#else
complex
*
a
,
*
z
,
*
as
,
*
tmp1
,
*
tmp2
;
float
*
ev
,
*
xr
;
complex
*
a
,
*
z
,
*
as
;
float
*
ev
;
#endif
int
*
iseed
;
int
useGPU
;
int
success
;
#ifdef WITH_MPI
MPI_Init
(
&
argc
,
&
argv
);
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
nprocs
);
...
...
@@ -155,7 +151,7 @@ int main(int argc, char** argv) {
#else
my_mpi_comm_world
=
1
;
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -178,7 +174,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -197,37 +193,20 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
xr
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
ev
=
malloc
(
na
*
sizeof
(
double
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
#else
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
xr
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
ev
=
malloc
(
na
*
sizeof
(
float
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
#endif
iseed
=
malloc
(
4096
*
sizeof
(
int
));
#ifdef DOUBLE_PRECISION_COMPLEX
prepare_matrix_complex_
from_fortran_double_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
xr
,
a
,
z
,
as
);
prepare_matrix_complex_
double_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#else
prepare_matrix_complex_
from_fortran_single_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
xr
,
a
,
z
,
as
);
prepare_matrix_complex_
single_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#endif
free
(
xr
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
printf
(
"Entering ELPA 1stage complex solver
\n
"
);
...
...
@@ -260,9 +239,9 @@ int main(int argc, char** argv) {
/* check the results */
#ifdef DOUBLE_PRECISION_COMPLEX
status
=
check_correctness_complex_
from_fortran_double_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_complex_
double_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#else
status
=
check_correctness_complex_
from_fortran_single_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_complex_
single_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#endif
if
(
status
!=
0
){
...
...
@@ -276,11 +255,8 @@ int main(int argc, char** argv) {
free
(
a
);
free
(
z
);
free
(
as
);
free
(
tmp1
);
free
(
tmp2
);
free
(
iseed
);
free
(
ev
);
#ifdef WITH_MPI
MPI_Finalize
();
#endif
...
...
test/C/elpa1_test_real_c_version.c
View file @
e12db07e
...
...
@@ -80,11 +80,10 @@ int main(int argc, char** argv) {
int
na_rows
,
na_cols
;
double
startVal
;
#ifdef DOUBLE_PRECISION_REAL
double
*
a
,
*
z
,
*
as
,
*
ev
,
*
tmp1
,
*
tmp2
;
double
*
a
,
*
z
,
*
as
,
*
ev
;
#else
float
*
a
,
*
z
,
*
as
,
*
ev
,
*
tmp1
,
*
tmp2
;
float
*
a
,
*
z
,
*
as
,
*
ev
;
#endif
int
*
iseed
;
int
success
;
...
...
@@ -144,7 +143,7 @@ int main(int argc, char** argv) {
#ifdef WITH_MPI
my_mpi_comm_world
=
MPI_Comm_c2f
(
MPI_COMM_WORLD
);
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -169,7 +168,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -187,29 +186,18 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
ev
=
malloc
(
na
*
sizeof
(
double
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
#else
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
ev
=
malloc
(
na
*
sizeof
(
float
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
#endif
iseed
=
malloc
(
4096
*
sizeof
(
int
));
#ifdef DOUBLE_PRECISION_REAL
prepare_matrix_real_
from_fortran_double_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
a
,
z
,
as
);
prepare_matrix_real_
double_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#else
prepare_matrix_real_
from_fortran_single_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
a
,
z
,
as
);
prepare_matrix_real_
single_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#endif
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -243,9 +231,9 @@ int main(int argc, char** argv) {
#ifdef DOUBLE_PRECISION_REAL
/* check the results */
status
=
check_correctness_real_
from_fortran_double_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_real_
double_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#else
status
=
check_correctness_real_
from_fortran_single_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_real_
single_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#endif
if
(
status
!=
0
){
printf
(
"The computed EVs are not correct !
\n
"
);
...
...
@@ -258,11 +246,8 @@ int main(int argc, char** argv) {
free
(
a
);
free
(
z
);
free
(
as
);
free
(
tmp1
);
free
(
tmp2
);
free
(
iseed
);
free
(
ev
);
#ifdef WITH_MPI
MPI_Finalize
();
#endif
...
...
test/C/elpa2_test_complex_c_version.c
View file @
e12db07e
...
...
@@ -80,15 +80,12 @@ int main(int argc, char** argv) {
int
na_rows
,
na_cols
;
double
startVal
;
#ifdef DOUBLE_PRECISION_COMPLEX
complex
double
*
a
,
*
z
,
*
as
,
*
tmp1
,
*
tmp2
;
double
*
ev
,
*
xr
;
complex
double
*
a
,
*
z
,
*
as
;
double
*
ev
;
#else
complex
*
a
,
*
z
,
*
as
,
*
tmp1
,
*
tmp2
;
float
*
ev
,
*
xr
;
complex
*
a
,
*
z
,
*
as
;
float
*
ev
;
#endif
int
*
iseed
;
int
success
;
...
...
@@ -151,7 +148,7 @@ int main(int argc, char** argv) {
#else
my_mpi_comm_world
=
1
;
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -174,7 +171,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -192,36 +189,19 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
xr
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
ev
=
malloc
(
na
*
sizeof
(
double
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
#else
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
xr
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
ev
=
malloc
(
na
*
sizeof
(
float
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
#endif
iseed
=
malloc
(
4096
*
sizeof
(
int
));
#ifdef DOUBLE_PRECISION_COMPLEX
prepare_matrix_complex_
from_fortran_double_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
xr
,
a
,
z
,
as
);
prepare_matrix_complex_
double_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#else
prepare_matrix_complex_
from_fortran_single_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
xr
,
a
,
z
,
as
);
prepare_matrix_complex_
single_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#endif
free
(
xr
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
printf
(
"Entering ELPA 2stage complex solver
\n
"
);
...
...
@@ -255,9 +235,9 @@ int main(int argc, char** argv) {
/* check the results */
#ifdef DOUBLE_PRECISION_COMPLEX
status
=
check_correctness_complex_
from_fortran_double_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_complex_
double_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#else
status
=
check_correctness_complex_
from_fortran_single_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_complex_
single_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#endif
if
(
status
!=
0
){
printf
(
"The computed EVs are not correct !
\n
"
);
...
...
@@ -272,11 +252,8 @@ int main(int argc, char** argv) {
free
(
a
);
free
(
z
);
free
(
as
);
free
(
tmp1
);
free
(
tmp2
);
free
(
iseed
);
free
(
ev
);
#ifdef WITH_MPI
MPI_Finalize
();
#endif
...
...
test/C/elpa2_test_real_c_version.c
View file @
e12db07e
...
...
@@ -79,11 +79,10 @@ int main(int argc, char** argv) {
int
na_rows
,
na_cols
;
double
startVal
;
#ifdef DOUBLE_PRECISION_REAL
double
*
a
,
*
z
,
*
as
,
*
ev
,
*
tmp1
,
*
tmp2
;
double
*
a
,
*
z
,
*
as
,
*
ev
;
#else
float
*
a
,
*
z
,
*
as
,
*
ev
,
*
tmp1
,
*
tmp2
;
float
*
a
,
*
z
,
*
as
,
*
ev
;
#endif
int
*
iseed
;
int
success
;
...
...
@@ -144,7 +143,7 @@ int main(int argc, char** argv) {
#else
my_mpi_comm_world
=
1
;
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -167,7 +166,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -185,28 +184,17 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
ev
=
malloc
(
na
*
sizeof
(
double
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
#else
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
ev
=
malloc
(
na
*
sizeof
(
float
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
#endif
iseed
=
malloc
(
4096
*
sizeof
(
int
));
#ifdef DOUBLE_PRECISION_REAL
prepare_matrix_real_
from_fortran_double_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
a
,
z
,
as
);
prepare_matrix_real_
double_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#else
prepare_matrix_real_
from_fortran_single_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
a
,
z
,
as
);
prepare_matrix_real_
single_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
#endif
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -241,9 +229,9 @@ int main(int argc, char** argv) {
/* check the results */
#ifdef DOUBLE_PRECISION_REAL
status
=
check_correctness_real_
from_fortran_double_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_real_
double_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#else
status
=
check_correctness_real_
from_fortran_single_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_real_
single_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
#endif
if
(
status
!=
0
){
...
...
@@ -259,11 +247,8 @@ int main(int argc, char** argv) {
free
(
a
);
free
(
z
);
free
(
as
);
free
(
tmp1
);
free
(
tmp2
);
free
(
iseed
);
free
(
ev
);
#ifdef WITH_MPI
MPI_Finalize
();
#endif
...
...
test/C/elpa_driver_complex_c_version.c
View file @
e12db07e
...
...
@@ -78,14 +78,11 @@ int main(int argc, char** argv) {
int
na_rows
,
na_cols
;
double
startVal
;
complex
double
*
a
,
*
z
,
*
as
,
*
tmp1
,
*
tmp2
;
complex
double
*
a
,
*
z
,
*
as
;
double
*
ev
,
*
xr
;
int
*
iseed
;
double
*
ev
;
int
success
;
int
i
;
int
useGPU
,
THIS_COMPLEX_ELPA_KERNEL_API
;
...
...
@@ -141,7 +138,7 @@ int main(int argc, char** argv) {
#else
my_mpi_comm_world
=
1
;
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -164,7 +161,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -182,20 +179,9 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
xr
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
ev
=
malloc
(
na
*
sizeof
(
double
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
double
));
iseed
=
malloc
(
4096
*
sizeof
(
int
));
prepare_matrix_complex_from_fortran_double_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
xr
,
a
,
z
,
as
);
free
(
xr
);
prepare_matrix_complex_double_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -282,7 +268,7 @@ int main(int argc, char** argv) {
}
/* check the results */
status
=
check_correctness_complex_
from_fortran_double_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_complex_
double_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
if
(
status
!=
0
){
printf
(
"The computed EVs are not correct !
\n
"
);
...
...
@@ -297,11 +283,8 @@ int main(int argc, char** argv) {
free
(
a
);
free
(
z
);
free
(
as
);
free
(
tmp1
);
free
(
tmp2
);
free
(
iseed
);
free
(
ev
);
#ifdef WITH_MPI
MPI_Finalize
();
#endif
...
...
test/C/elpa_driver_complex_c_version_single.c
View file @
e12db07e
...
...
@@ -78,11 +78,10 @@ int main(int argc, char** argv) {
int
na_rows
,
na_cols
;
float
startVal
;
complex
*
a
,
*
z
,
*
as
,
*
tmp1
,
*
tmp2
;
complex
*
a
,
*
z
,
*
as
;
float
*
ev
,
*
xr
;
float
*
ev
;
int
*
iseed
;
int
useGPU
;
int
success
;
...
...
@@ -141,7 +140,7 @@ int main(int argc, char** argv) {
#else
my_mpi_comm_world
=
1
;
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -164,7 +163,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -182,20 +181,9 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
xr
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
float
));
ev
=
malloc
(
na
*
sizeof
(
float
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
complex
));
iseed
=
malloc
(
4096
*
sizeof
(
int
));
prepare_matrix_complex_from_fortran_single_precision
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
iseed
,
xr
,
a
,
z
,
as
);
free
(
xr
);
prepare_matrix_complex_single_f
(
na
,
myid
,
na_rows
,
na_cols
,
sc_desc
,
a
,
z
,
as
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -206,7 +194,7 @@ int main(int argc, char** argv) {
mpierr
=
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
useGPU
=
0
;
THIS_COMPLEX_ELPA_KERNEL_API
=
ELPA
2
_COMPLEX_
KERNEL_
GENERIC
;
THIS_COMPLEX_ELPA_KERNEL_API
=
ELPA
_2STAGE
_COMPLEX_GENERIC
;
success
=
elpa_solve_evp_complex_single
(
na
,
nev
,
a
,
na_rows
,
ev
,
z
,
na_rows
,
nblk
,
na_cols
,
mpi_comm_rows
,
mpi_comm_cols
,
my_mpi_comm_world
,
THIS_COMPLEX_ELPA_KERNEL_API
,
useGPU
,
"1stage"
);
if
(
success
!=
1
)
{
...
...
@@ -236,7 +224,7 @@ int main(int argc, char** argv) {
mpierr
=
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
useGPU
=
0
;
THIS_COMPLEX_ELPA_KERNEL_API
=
ELPA
2
_COMPLEX_
KERNEL_
GENERIC
;
THIS_COMPLEX_ELPA_KERNEL_API
=
ELPA
_2STAGE
_COMPLEX_GENERIC
;
success
=
elpa_solve_evp_complex_single
(
na
,
nev
,
a
,
na_rows
,
ev
,
z
,
na_rows
,
nblk
,
na_cols
,
mpi_comm_rows
,
mpi_comm_cols
,
my_mpi_comm_world
,
THIS_COMPLEX_ELPA_KERNEL_API
,
useGPU
,
"2stage"
);
if
(
success
!=
1
)
{
...
...
@@ -265,7 +253,7 @@ int main(int argc, char** argv) {
mpierr
=
MPI_Barrier
(
MPI_COMM_WORLD
);
#endif
useGPU
=
0
;
THIS_COMPLEX_ELPA_KERNEL_API
=
ELPA
2
_COMPLEX_
KERNEL_
GENERIC
;
THIS_COMPLEX_ELPA_KERNEL_API
=
ELPA
_2STAGE
_COMPLEX_GENERIC
;
success
=
elpa_solve_evp_complex_single
(
na
,
nev
,
a
,
na_rows
,
ev
,
z
,
na_rows
,
nblk
,
na_cols
,
mpi_comm_rows
,
mpi_comm_cols
,
my_mpi_comm_world
,
THIS_COMPLEX_ELPA_KERNEL_API
,
useGPU
,
"auto"
);
if
(
success
!=
1
)
{
...
...
@@ -282,7 +270,7 @@ int main(int argc, char** argv) {
}
/* check the results */
status
=
check_correctness_complex_
from_fortran_single_precision
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
,
tmp1
,
tmp2
);
status
=
check_correctness_complex_
single_f
(
na
,
nev
,
na_rows
,
na_cols
,
as
,
z
,
ev
,
sc_desc
,
myid
);
if
(
status
!=
0
){
printf
(
"The computed EVs are not correct !
\n
"
);
...
...
@@ -298,8 +286,6 @@ int main(int argc, char** argv) {
free
(
z
);
free
(
as
);
free
(
tmp1
);
free
(
tmp2
);
#ifdef WITH_MPI
MPI_Finalize
();
#endif
...
...
test/C/elpa_driver_real_c_version.c
View file @
e12db07e
...
...
@@ -77,9 +77,8 @@ int main(int argc, char** argv) {
int
na_rows
,
na_cols
;
double
startVal
;
double
*
a
,
*
z
,
*
as
,
*
ev
,
*
tmp1
,
*
tmp2
;
double
*
a
,
*
z
,
*
as
,
*
ev
;
int
*
iseed
;
int
i
;
int
success
;
...
...
@@ -135,7 +134,7 @@ int main(int argc, char** argv) {
#else
my_mpi_comm_world
=
1
;
#endif
set_up_blacsgrid_f
rom_fortran
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
set_up_blacsgrid_f
(
my_mpi_comm_world
,
&
my_blacs_ctxt
,
&
np_rows
,
&
np_cols
,
&
nprow
,
&
npcol
,
&
my_prow
,
&
my_pcol
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -158,7 +157,7 @@ int main(int argc, char** argv) {
sc_desc
=
malloc
(
9
*
sizeof
(
int
));
set_up_blacs_descriptor_f
rom_fortran
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
set_up_blacs_descriptor_f
(
na
,
nblk
,
my_prow
,
my_pcol
,
np_rows
,
np_cols
,
&
na_rows
,
&
na_cols
,
sc_desc
,
my_blacs_ctxt
,
&
info
);
if
(
myid
==
0
)
{
printf
(
"
\n
"
);
...
...
@@ -176,16 +175,9 @@ int main(int argc, char** argv) {
a
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
z
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
as
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
ev
=
malloc
(
na
*
sizeof
(
double
));
tmp1
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));
tmp2
=
malloc
(
na_rows
*
na_cols
*
sizeof
(
double
));