FMS  2024.03
Flexible Modeling System
fms_affinity_mod

Fortran API interfaces to set the thread affinity. API interfaces to allow setting and getting thread affinity. The routines get_cpuset , set_cpu_affinity , and fms_affinity_get are defined via C routines in affinity.c. More...

Data Types

interface  get_cpuset
 Private interface to retrieve this groups CPU set and it's size. More...
 
interface  set_cpu_affinity
 Private interface to set CPU afinity to a given core. More...
 

Functions/Subroutines

subroutine, public fms_affinity_init ()
 Initialization routine for affinity handling.
 
subroutine, public fms_affinity_set (component, use_hyper_thread, nthreads)
 Routine to set affinity for a component. More...
 
integer(kind=c_int) function get_cpuset (fsz, output, pe, debug)
 
integer(kind=c_int) function set_cpu_affinity (cpu)
 

Variables

logical affinity = .true.
 
logical debug_affinity = .false.
 
logical(c_bool) debug_cpuset = .false.
 
logical module_is_initialized = .FALSE.
 
logical strict = .true.
 

Detailed Description

Fortran API interfaces to set the thread affinity. API interfaces to allow setting and getting thread affinity. The routines get_cpuset , set_cpu_affinity , and fms_affinity_get are defined via C routines in affinity.c.

Author
Rusty Benson

Data Type Documentation

◆ fms_affinity_mod::get_cpuset

interface fms_affinity_mod::get_cpuset

Private interface to retrieve this groups CPU set and it's size.

Defined in affinity.c.

Definition at line 56 of file fms_affinity.F90.

Private Member Functions

integer(kind=c_int) function get_cpuset (fsz, output, pe, debug)
 

◆ fms_affinity_mod::set_cpu_affinity

interface fms_affinity_mod::set_cpu_affinity

Private interface to set CPU afinity to a given core.

Defined in affinity.c.

Definition at line 66 of file fms_affinity.F90.

Private Member Functions

integer(kind=c_int) function set_cpu_affinity (cpu)
 

Function/Subroutine Documentation

◆ fms_affinity_set()

subroutine, public fms_affinity_mod::fms_affinity_set ( character(len=*), intent(in)  component,
logical, intent(in)  use_hyper_thread,
integer, intent(in)  nthreads 
)

Routine to set affinity for a component.

Parameters
[in]componentComponent name
[in]use_hyper_thread.TRUE. if using hyperthreads
[in]nthreadsNumber of threads

Definition at line 117 of file fms_affinity.F90.