FORTRAN Library Interface

The next enumerations and functions are declared in primme_f77.h.

ptr

Fortran datatype with the same size as a pointer. Use integer*4 when compiling in 32 bits and integer*8 in 64 bits.

primme_initialize_f77

primme_initialize_f77(primme)

Set PRIMME parameters structure to the default values.

Parameters:
  • primme (ptr) – (output) parameters structure.

primme_set_method_f77

primme_set_method_f77(method, primme, ierr)

Set PRIMME parameters to one of the preset configurations.

Parameters:
  • method (integer) –

    (input) preset configuration. One of:

    PRIMME_DYNAMIC
    PRIMME_DEFAULT_MIN_TIME
    PRIMME_DEFAULT_MIN_MATVECS
    PRIMME_Arnoldi
    PRIMME_GD
    PRIMME_GD_plusK
    PRIMME_GD_Olsen_plusK
    PRIMME_JD_Olsen_plusK
    PRIMME_RQI
    PRIMME_JDQR
    PRIMME_JDQMR
    PRIMME_JDQMR_ETol
    PRIMME_STEEPEST_DESCENT
    PRIMME_LOBPCG_OrthoBasis
    PRIMME_LOBPCG_OrthoBasis_Window

    See primme_preset_method.

  • primme (ptr) – (input) parameters structure.
  • ierr (integer) – (output) if 0, successful; if negative, something went wrong.

primme_free_f77

primme_free_f77(primme)

Free memory allocated by PRIMME and delete all values set.

Parameters:
  • primme (ptr) – (input/output) parameters structure.

sprimme_f77

sprimme_f77(evals, evecs, resNorms, primme, ierr)

Solve a real symmetric standard eigenproblem using single precision.

Parameters:
  • evals(*) (real) – (output) array at least of size numEvals to store the computed eigenvalues; all parallel calls return the same value in this array.
  • resNorms(*) (real) – (output) array at least of size numEvals to store the residual norms of the computed eigenpairs; all parallel calls return the same value in this array.
  • evecs(*) (real) – (input/output) array at least of size nLocal times numEvals to store columnwise the (local part of the) computed eigenvectors.
  • primme (ptr) – parameters structure.
  • ierr (integer) – (output) error indicator; see Error Codes.

cprimme_f77

cprimme_f77(evals, evecs, resNorms, primme, ierr)

Solve a Hermitian standard eigenproblem. The arguments have the same meaning as in function sprimme_f77().

Parameters:
  • evals(*) (real) – (output)
  • resNorms(*) (real) – (output)
  • evecs(*) (complex real) – (input/output)
  • primme (ptr) – (input) parameters structure.
  • ierr (integer) – (output) error indicator; see Error Codes.

dprimme_f77

dprimme_f77(evals, evecs, resNorms, primme, ierr)

Solve a real symmetric standard eigenproblem using double precision.

Parameters:
  • evals(*) (double precision) – (output) array at least of size numEvals to store the computed eigenvalues; all parallel calls return the same value in this array.
  • resNorms(*) (double precision) – (output) array at least of size numEvals to store the residual norms of the computed eigenpairs; all parallel calls return the same value in this array.
  • evecs(*) (double precision) – (input/output) array at least of size nLocal times numEvals to store columnwise the (local part of the) computed eigenvectors.
  • primme (ptr) – parameters structure.
  • ierr (integer) – (output) error indicator; see Error Codes.

zprimme_f77

zprimme_f77(evals, evecs, resNorms, primme, ierr)

Solve a Hermitian standard eigenproblem. The arguments have the same meaning as in function dprimme_f77().

Parameters:
  • evals(*) (double precision) – (output)
  • resNorms(*) (double precision) – (output)
  • evecs(*) (complex double precision) – (input/output)
  • primme (ptr) – (input) parameters structure.
  • ierr (integer) – (output) error indicator; see Error Codes.

primme_set_member_f77

primme_set_member_f77(primme, label, value)

Set a value in some field of the parameter structure.

Parameters:

Note

Don’t use this function inside PRIMME’s callback functions, e.g., matrixMatvec or applyPreconditioner, or in functions called by these functions.

primmetop_get_member_f77

primmetop_get_member_f77(primme, label, value)

Get the value in some field of the parameter structure.

Parameters:
  • primme (ptr) – (input) parameters structure.
  • label (integer) – (input) field where to get value. One of the detailed in function primmetop_set_member_f77().
  • value

    (output) value of the field.

    If the type of the option is integer (int, PRIMME_INT, size_t), the type of value should be as long as PRIMME_INT, which is integer*8 by default.

Note

Don’t use this function inside PRIMME’s callback functions, e.g., matrixMatvec or applyPreconditioner, or in functions called by these functions. In those cases use primme_get_member_f77().

Note

When label is one of PRIMME_matrixMatvec, PRIMME_applyPreconditioner, PRIMME_commInfo, PRIMME_intWork, PRIMME_realWork, PRIMME_matrix and PRIMME_preconditioner, the returned value is a C pointer (void*). Use Fortran pointer or other extensions to deal with it. For instance:

use iso_c_binding
MPI_Comm comm

comm = MPI_COMM_WORLD
call primme_set_member_f77(primme, PRIMME_commInfo, comm)
...
subroutine par_GlobalSumDouble(x,y,k,primme)
use iso_c_binding
implicit none
...
MPI_Comm, pointer :: comm
type(c_ptr) :: pcomm

call primme_get_member_f77(primme, PRIMME_commInfo, pcomm)
call c_f_pointer(pcomm, comm)
call MPI_Allreduce(x,y,k,MPI_DOUBLE,MPI_SUM,comm,ierr)

Most users would not need to retrieve these pointers in their programs.

primmetop_get_prec_shift_f77

primmetop_get_prec_shift_f77(primme, index, value)

Get the value in some position of the array ShiftsForPreconditioner.

Parameters:
  • primme (ptr) – (input) parameters structure.
  • index (integer) – (input) position of the array; the first position is 1.
  • value – (output) value of the array at that position.

primme_get_member_f77

primme_get_member_f77(primme, label, value)

Get the value in some field of the parameter structure.

Parameters:
  • primme (ptr) – (input) parameters structure.
  • label (integer) – (input) field where to get value. One of the detailed in function primmetop_set_member_f77().
  • value

    (output) value of the field.

    If the type of the option is integer (int, PRIMME_INT, size_t), the type of value should be as long as PRIMME_INT, which is integer*8 by default.

Note

Use this function exclusively inside PRIMME’s callback functions, e.g., matrixMatvec or applyPreconditioner, or in functions called by these functions. Otherwise, e.g., from the main program, use the function primmetop_get_member_f77().

Note

When label is one of PRIMME_matrixMatvec, PRIMME_applyPreconditioner, PRIMME_commInfo, PRIMME_intWork, PRIMME_realWork, PRIMME_matrix and PRIMME_preconditioner, the returned value is a C pointer (void*). Use Fortran pointer or other extensions to deal with it. For instance:

use iso_c_binding
MPI_Comm comm

comm = MPI_COMM_WORLD
call primme_set_member_f77(primme, PRIMME_commInfo, comm)
...
subroutine par_GlobalSumDouble(x,y,k,primme)
use iso_c_binding
implicit none
...
MPI_Comm, pointer :: comm
type(c_ptr) :: pcomm

call primme_get_member_f77(primme, PRIMME_commInfo, pcomm)
call c_f_pointer(pcomm, comm)
call MPI_Allreduce(x,y,k,MPI_DOUBLE,MPI_SUM,comm,ierr)

Most users would not need to retrieve these pointers in their programs.

primme_get_prec_shift_f77

primme_get_prec_shift_f77(primme, index, value)

Get the value in some position of the array ShiftsForPreconditioner.

Parameters:
  • primme (ptr) – (input) parameters structure.
  • index (integer) – (input) position of the array; the first position is 1.
  • value – (output) value of the array at that position.

Note

Use this function exclusively inside the function matrixMatvec, massMatrixMatvec, or applyPreconditioner. Otherwise use the function primmetop_get_prec_shift_f77().