Commit f3144dd9 authored by Pavel Kus's avatar Pavel Kus

changed logic of setting mpi communicators

mpi_comm_parent is allways requred (it was not required before, but
actually the code internals expected it to be supplied, at least for
ELPA 2 calculation OR whenever GPU was used)
parent 56c5e772
...@@ -123,14 +123,16 @@ for lang, m, g, q, t, p, d, s, lay, spl in product(sorted(language_flag.keys()), ...@@ -123,14 +123,16 @@ for lang, m, g, q, t, p, d, s, lay, spl in product(sorted(language_flag.keys()),
if (q == 1 and (s != "2stage" or d != "real" or t != "eigenvectors" or g == 1 or m != "random")): if (q == 1 and (s != "2stage" or d != "real" or t != "eigenvectors" or g == 1 or m != "random")):
continue continue
# one test with split communicator myself should be enough if(spl == "myself" and (d != "real" or p != "double" or q != 0 or m != "random" or (t != "eigenvectors" and t != "cholesky") or lang != "Fortran" or lay != "square")):
if(spl == "myself" and (s!="1stage" or d != "real" or p != "double" or g == 1 or m != "random" or t != "eigenvectors" or lang != "Fortran" or lay != "square")):
continue continue
for kernel in ["all_kernels", "default_kernel"] if s == "2stage" else ["nokernel"]: for kernel in ["all_kernels", "default_kernel"] if s == "2stage" else ["nokernel"]:
endifs = 0 endifs = 0
extra_flags = [] extra_flags = []
if(spl == "myself" and kernel == "all_kernels"):
continue
if(spl == "myself"): if(spl == "myself"):
print("if WITH_MPI") print("if WITH_MPI")
endifs += 1 endifs += 1
......
...@@ -116,6 +116,12 @@ ...@@ -116,6 +116,12 @@
stop stop
endif endif
call e%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop 1
endif
!! the elpa object needs nev to be set (in case the EVP-solver is !! the elpa object needs nev to be set (in case the EVP-solver is
!! called later. Thus it is set by user, do nothing, otherwise, !! called later. Thus it is set by user, do nothing, otherwise,
!! set it to na as default !! set it to na as default
......
...@@ -138,6 +138,12 @@ ...@@ -138,6 +138,12 @@
print *,"Problem setting option. Aborting..." print *,"Problem setting option. Aborting..."
stop stop
endif endif
call e%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop
endif
if (e%setup() .ne. ELPA_OK) then if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
......
...@@ -154,6 +154,12 @@ ...@@ -154,6 +154,12 @@
stop stop
endif endif
call e%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop 1
endif
if (e%setup() .ne. ELPA_OK) then if (e%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
success = .false. success = .false.
......
...@@ -131,6 +131,11 @@ ...@@ -131,6 +131,11 @@
print *,"Problem setting option. Aborting..." print *,"Problem setting option. Aborting..."
stop stop
endif endif
call obj%set("legacy_api", 1, error)
if (error .ne. ELPA_OK) then
print *,"Problem setting option. Aborting..."
stop
endif
if (obj%setup() .ne. ELPA_OK) then if (obj%setup() .ne. ELPA_OK) then
print *, "Cannot setup ELPA instance" print *, "Cannot setup ELPA instance"
......
This diff is collapsed.
...@@ -190,6 +190,7 @@ static const elpa_index_int_entry_t int_entries[] = { ...@@ -190,6 +190,7 @@ static const elpa_index_int_entry_t int_entries[] = {
INT_ANY_ENTRY("mpi_comm_cols", "Communicator for inter-column communication", PRINT_NO), INT_ANY_ENTRY("mpi_comm_cols", "Communicator for inter-column communication", PRINT_NO),
INT_ANY_ENTRY("mpi_comm_parent", "Parent communicator", PRINT_NO), INT_ANY_ENTRY("mpi_comm_parent", "Parent communicator", PRINT_NO),
INT_ANY_ENTRY("blacs_context", "BLACS context", PRINT_NO), INT_ANY_ENTRY("blacs_context", "BLACS context", PRINT_NO),
INT_ANY_ENTRY("legacy_api", "This object has been created through the legacy api. Parameter for internal use only", PRINT_NO),
INT_ENTRY("solver", "Solver to use", ELPA_SOLVER_1STAGE, ELPA_AUTOTUNE_FAST, ELPA_AUTOTUNE_DOMAIN_ANY, \ INT_ENTRY("solver", "Solver to use", ELPA_SOLVER_1STAGE, ELPA_AUTOTUNE_FAST, ELPA_AUTOTUNE_DOMAIN_ANY, \
number_of_solvers, solver_enumerate, solver_is_valid, elpa_solver_name, PRINT_YES), number_of_solvers, solver_enumerate, solver_is_valid, elpa_solver_name, PRINT_YES),
INT_ENTRY("gpu", "Use GPU acceleration", 0, ELPA_AUTOTUNE_MEDIUM, ELPA_AUTOTUNE_DOMAIN_ANY, INT_ENTRY("gpu", "Use GPU acceleration", 0, ELPA_AUTOTUNE_MEDIUM, ELPA_AUTOTUNE_DOMAIN_ANY,
......
...@@ -561,6 +561,8 @@ program test ...@@ -561,6 +561,8 @@ program test
stop 1 stop 1
endif endif
call e%set("mpi_comm_parent", MPI_COMM_WORLD, error)
assert_elpa_ok(error)
call e%set("mpi_comm_rows", mpi_comm_rows, error) call e%set("mpi_comm_rows", mpi_comm_rows, error)
assert_elpa_ok(error) assert_elpa_ok(error)
call e%set("mpi_comm_cols", mpi_comm_cols, error) call e%set("mpi_comm_cols", mpi_comm_cols, error)
......
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