Eigenvalue SoLvers for Petaflop-Applications (ELPA)  2019.05.001
Functions/Subroutines
elpa Module Reference

call elpaset("nev", nev, success, success) ! check success code ... More...

Functions/Subroutines

class(elpa_t) function, pointer elpa_allocate (error)
 function to allocate an ELPA instance Parameters More...
 
subroutine elpa_deallocate (obj, error)
 function to deallocate an ELPA instance Parameters More...
 
subroutine elpa_autotune_deallocate (obj, error)
 function to deallocate an ELPA autotune instance Parameters More...
 

Detailed Description

call elpaset("nev", nev, success, success) ! check success code ...

call elpaset("local_nrows", na_rows, success) ! check success code ...

call elpaset("local_ncols", na_cols, success) call elpaset("nblk", nblk, success) call elpaset("mpi_comm_parent", MPI_COMM_WORLD, success) call elpaset("process_row", my_prow, success) call elpaset("process_col", my_pcol, success)

! set up the elpa object success = elpasetup() if (succes != ELPA_OK) then print *,"Could not setup ELPA object" endif

! if desired, set tunable run-time options ! here we want to use the 2-stage solver call elpaset("solver", ELPA_SOLVER_2STAGE, success)

! and set a specific kernel (must be supported on the machine) call elpaset("real_kernel", ELPA_2STAGE_REAL_AVX_BLOCK2) ... set and get all other options that are desired

! if wanted you can store the settings and load them in another program
call elpa%store_settings("save_to_disk.txt", success)
! use method solve to solve the eigenvalue problem to obtain eigenvalues
! and eigenvectors
! other possible methods are desribed in \ref elpa_api::elpa_t derived type
call elpa%eigenvectors(a, ev, z, success)
! cleanup
call elpa_deallocate(e, success)

C synopsis

#include <elpa/elpa.h>
elpa_t handle;
int error;
/* We urge the user to always check the error code of all ELPA functions */
if (elpa_init(20181113) != ELPA_OK) {
fprintf(stderr, "Error: ELPA API version not supported");
exit(1);
}
handle = elpa_allocate(&error);
if (error != ELPA_OK) {
/* do sth. */
}
/* Set parameters the matrix and it's MPI distribution */
elpa_set(handle, "na", na, &error);
elpa_set(handle, "nev", nev, &error);
elpa_set(handle, "local_nrows", na_rows, &error);
elpa_set(handle, "local_ncols", na_cols, &error);
elpa_set(handle, "nblk", nblk, &error);
elpa_set(handle, "mpi_comm_parent", MPI_Comm_c2f(MPI_COMM_WORLD), &error);
elpa_set(handle, "process_row", my_prow, &error);
elpa_set(handle, "process_col", my_pcol, &error);
/* Setup */
error = elpa_setup(handle);
/* if desired, set tunable run-time options */
/* here we want to use the 2-stage solver */
elpa_set(handle, "solver", ELPA_SOLVER_2STAGE, &error);
elpa_set(handle,"real_kernel", ELPA_2STAGE_REAL_AVX_BLOCK2, &error);

... set and get all other options that are desired

/* if you want you can store the settings and load them in another program */
elpa_store_settings(handle, "save_to_disk.txt");
/* use method solve to solve the eigenvalue problem */
/* other possible methods are desribed in \ref elpa_api::elpa_t derived type */
elpa_eigenvectors(handle, a, ev, z, &error);
/* cleanup */
elpa_deallocate(handle, &error);

the autotuning could be used like this:

Fortran synopsis

use elpa
class(elpa_t), pointer :: elpa
class(elpa_autotune_t), pointer :: tune_state
integer :: success
if (elpa_init(20181112) /= elpa_ok) then
print *, "ELPA API version not supported"
stop
endif
elpa => elpa_allocate(success)
! set parameters decribing the matrix and it's MPI distribution
call elpa%set("na", na, success)
call elpa%set("nev", nev, success)
call elpa%set("local_nrows", na_rows, success)
call elpa%set("local_ncols", na_cols, success)
call elpa%set("nblk", nblk, success)
call elpa%set("mpi_comm_parent", mpi_comm_world, success)
call elpa%set("process_row", my_prow, success)
call elpa%set("process_col", my_pcol, success)
! set up the elpa object
success = elpa%setup()
! create autotune object
tune_state => elpa%autotune_setup(elpa_autotune_fast, elpa_autotune_domain_real, success)
! you can set some options, these will be then FIXED for the autotuning step
! if desired, set tunable run-time options
! here we want to use the 2-stage solver
call e%set("solver", elpa_solver_2stage, success)
! and set a specific kernel (must be supported on the machine)
call e%set("real_kernel", elpa_2stage_real_avx_block2, success)

... set and get all other options that are desired

iter = 0
do while (elpa%autotune_step(tune_state, success))
iter = iter + 1
call e%eigenvectors(a, ev, z, success)
! if needed you can save the autotune state at any point
! and resume it
if (iter > max_iter) then
call elpa%autotune_save_state(tune_state,"autotune_checkpoint.txt", success)
exit
endif
enddo
!set and print the finished autotuning
call elpa%autotune_set_best(tune_state, success)
! store _TUNED_ ELPA object, if needed
call elpa%store("autotuned_object.txt", success)
!deallocate autotune object
call elpa_autotune_deallocate(tune_state, success)
! cleanup
call elpa_deallocate(e, success)

More examples can be found in the folder "test", where Fortran and C example programs are stored Fortran module to use the ELPA library. No other module shoule be used

Function/Subroutine Documentation

◆ elpa_allocate()

class(elpa_t) function, pointer elpa::elpa_allocate ( integer, intent(out), optional  error)

function to allocate an ELPA instance Parameters

\params error integer, optional : error code

Returns
obj class(elpa_t), pointer : pointer to allocated object

◆ elpa_autotune_deallocate()

subroutine elpa::elpa_autotune_deallocate ( class(elpa_autotune_t), pointer  obj,
integer, intent(out), optional  error 
)

function to deallocate an ELPA autotune instance Parameters

Parameters
objclass(elpa_autotune_t), pointer : pointer to the autotune object to be destroyed and deallocated
errorinteger, optional : error code

◆ elpa_deallocate()

subroutine elpa::elpa_deallocate ( class(elpa_t), pointer  obj,
integer, intent(out), optional  error 
)

function to deallocate an ELPA instance Parameters

Parameters
objclass(elpa_t), pointer : pointer to the ELPA object to be destroyed and deallocated
errorinteger, optional : error code