Octopus
calc_mode_par_oct_m Module Reference

This module handles the calculation mode. More...

Detailed Description

This module handles the calculation mode.

This module uses a module-scope global object to allow calculation modes to set the available parallelization strategies and whether the layout must be compatible with ScaLAPACK, and to allow this information to be accessed elsewhere. It does not, and should not, contain the definitions of the calculation modes themselves, to avoid writing code explicitly dependent on the calculation mode elsewhere.

Data Types

type  calc_mode_par_t
 Octopus Parallelization modes, stored concurrently in a bit representation. More...
 

Functions/Subroutines

subroutine calc_mode_par_set_parallelization (this, par, default)
 Add a parallelization strategy to the list of possible ones. More...
 
subroutine calc_mode_par_unset_parallelization (this, par)
 Remove a parallelization strategy from the list of possible ones. It will also be removed from the default. More...
 
subroutine calc_mode_par_set_scalapack_compat (this)
 Set that the current run mode requires division of states and domains to be compatible with scalapack. More...
 
logical pure function calc_mode_par_scalapack_compat (this)
 Get whether the current run mode requires division of states and domains to be compatible with scalapack. More...
 
integer pure function calc_mode_par_parallel_mask (this)
 Get parallel mask. More...
 
integer pure function calc_mode_par_default_parallel_mask (this)
 Get the default parallel mask used for a calculation. More...
 

Variables

integer, parameter, public p_strategy_serial = 0
 single domain, all states, k-points on a single processor More...
 
integer, parameter, public p_strategy_domains = 1
 parallelization in domains More...
 
integer, parameter, public p_strategy_states = 2
 parallelization in states More...
 
integer, parameter, public p_strategy_kpoints = 3
 parallelization in k-points More...
 
integer, parameter, public p_strategy_other = 4
 something else like e-h pairs More...
 
integer, parameter, public p_strategy_max = 4
 
integer, parameter default_parallelization_mask = ior(ibset(P_STRATEGY_SERIAL, P_STRATEGY_DOMAINS - 1), ibset(P_STRATEGY_SERIAL, P_STRATEGY_KPOINTS - 1))
 
type(calc_mode_par_t), public calc_mode_par
 Singleton instance of parallel calculation mode. More...
 

Function/Subroutine Documentation

◆ calc_mode_par_set_parallelization()

subroutine calc_mode_par_oct_m::calc_mode_par_set_parallelization ( class(calc_mode_par_t), intent(inout)  this,
integer, intent(in)  par,
logical, intent(in)  default 
)
private

Add a parallelization strategy to the list of possible ones.

Parameters
[in]defaultAdd Parallelization strategy to defaults

Definition at line 184 of file calc_mode_par.F90.

◆ calc_mode_par_unset_parallelization()

subroutine calc_mode_par_oct_m::calc_mode_par_unset_parallelization ( class(calc_mode_par_t), intent(inout)  this,
integer, intent(in)  par 
)
private

Remove a parallelization strategy from the list of possible ones. It will also be removed from the default.

Definition at line 200 of file calc_mode_par.F90.

◆ calc_mode_par_set_scalapack_compat()

subroutine calc_mode_par_oct_m::calc_mode_par_set_scalapack_compat ( class(calc_mode_par_t), intent(inout)  this)
private

Set that the current run mode requires division of states and domains to be compatible with scalapack.

Definition at line 215 of file calc_mode_par.F90.

◆ calc_mode_par_scalapack_compat()

logical pure function calc_mode_par_oct_m::calc_mode_par_scalapack_compat ( class(calc_mode_par_t), intent(in)  this)
private

Get whether the current run mode requires division of states and domains to be compatible with scalapack.

Definition at line 228 of file calc_mode_par.F90.

◆ calc_mode_par_parallel_mask()

integer pure function calc_mode_par_oct_m::calc_mode_par_parallel_mask ( class(calc_mode_par_t), intent(in)  this)
private

Get parallel mask.

Definition at line 236 of file calc_mode_par.F90.

◆ calc_mode_par_default_parallel_mask()

integer pure function calc_mode_par_oct_m::calc_mode_par_default_parallel_mask ( class(calc_mode_par_t), intent(in)  this)
private

Get the default parallel mask used for a calculation.

Note, this might be different from the modes available.

Definition at line 246 of file calc_mode_par.F90.

Variable Documentation

◆ p_strategy_serial

integer, parameter, public calc_mode_par_oct_m::p_strategy_serial = 0

single domain, all states, k-points on a single processor

Definition at line 134 of file calc_mode_par.F90.

◆ p_strategy_domains

integer, parameter, public calc_mode_par_oct_m::p_strategy_domains = 1

parallelization in domains

Definition at line 134 of file calc_mode_par.F90.

◆ p_strategy_states

integer, parameter, public calc_mode_par_oct_m::p_strategy_states = 2

parallelization in states

Definition at line 134 of file calc_mode_par.F90.

◆ p_strategy_kpoints

integer, parameter, public calc_mode_par_oct_m::p_strategy_kpoints = 3

parallelization in k-points

Definition at line 134 of file calc_mode_par.F90.

◆ p_strategy_other

integer, parameter, public calc_mode_par_oct_m::p_strategy_other = 4

something else like e-h pairs

Definition at line 134 of file calc_mode_par.F90.

◆ p_strategy_max

integer, parameter, public calc_mode_par_oct_m::p_strategy_max = 4

Definition at line 134 of file calc_mode_par.F90.

◆ default_parallelization_mask

integer, parameter calc_mode_par_oct_m::default_parallelization_mask = ior(ibset(P_STRATEGY_SERIAL, P_STRATEGY_DOMAINS - 1), ibset(P_STRATEGY_SERIAL, P_STRATEGY_KPOINTS - 1))
private

Definition at line 142 of file calc_mode_par.F90.

◆ calc_mode_par

type(calc_mode_par_t), public calc_mode_par_oct_m::calc_mode_par

Singleton instance of parallel calculation mode.

Definition at line 179 of file calc_mode_par.F90.