ARGOBOTS  1.1
Data Structures | Functions | Variables
abtd_affinity.c File Reference
#include "abti.h"
#include <unistd.h>
Include dependency graph for abtd_affinity.c:

Go to the source code of this file.

Data Structures

struct  global_affinity
 

Functions

static int int_rem (int a, unsigned int b)
 
static ABTU_ret_err int get_num_cores (pthread_t native_thread, int *p_num_cores)
 
static ABTU_ret_err int create_cpuset (pthread_t native_thread, ABTD_affinity_cpuset *p_cpuset)
 
static ABTU_ret_err int read_cpuset (pthread_t native_thread, int max_cpuids, int *cpuids, int *p_num_cpuids)
 
static ABTU_ret_err int apply_cpuset (pthread_t native_thread, const ABTD_affinity_cpuset *p_cpuset)
 
void ABTD_affinity_init (ABTI_global *p_global, const char *affinity_str)
 
void ABTD_affinity_finalize (ABTI_global *p_global)
 
ABTU_ret_err int ABTD_affinity_cpuset_read (ABTD_xstream_context *p_ctx, int max_cpuids, int *cpuids, int *p_num_cpuids)
 
ABTU_ret_err int ABTD_affinity_cpuset_apply (ABTD_xstream_context *p_ctx, const ABTD_affinity_cpuset *p_cpuset)
 
ABTU_ret_err int ABTD_affinity_cpuset_apply_default (ABTD_xstream_context *p_ctx, int rank)
 
void ABTD_affinity_cpuset_destroy (ABTD_affinity_cpuset *p_cpuset)
 

Variables

static global_affinity g_affinity
 

Function Documentation

◆ ABTD_affinity_cpuset_apply()

ABTU_ret_err int ABTD_affinity_cpuset_apply ( ABTD_xstream_context p_ctx,
const ABTD_affinity_cpuset p_cpuset 
)

Definition at line 436 of file abtd_affinity.c.

◆ ABTD_affinity_cpuset_apply_default()

ABTU_ret_err int ABTD_affinity_cpuset_apply_default ( ABTD_xstream_context p_ctx,
int  rank 
)

Definition at line 442 of file abtd_affinity.c.

Referenced by ABT_xstream_set_rank(), and xstream_create().

◆ ABTD_affinity_cpuset_destroy()

void ABTD_affinity_cpuset_destroy ( ABTD_affinity_cpuset p_cpuset)

Definition at line 450 of file abtd_affinity.c.

Referenced by ABTD_affinity_finalize(), and ABTD_affinity_init().

◆ ABTD_affinity_cpuset_read()

ABTU_ret_err int ABTD_affinity_cpuset_read ( ABTD_xstream_context p_ctx,
int  max_cpuids,
int *  cpuids,
int *  p_num_cpuids 
)

Definition at line 428 of file abtd_affinity.c.

◆ ABTD_affinity_finalize()

void ABTD_affinity_finalize ( ABTI_global p_global)

Definition at line 404 of file abtd_affinity.c.

Referenced by finailze_library(), and init_library().

◆ ABTD_affinity_init()

void ABTD_affinity_init ( ABTI_global p_global,
const char *  affinity_str 
)

Definition at line 296 of file abtd_affinity.c.

Referenced by ABTD_env_init().

◆ apply_cpuset()

static ABTU_ret_err int apply_cpuset ( pthread_t  native_thread,
const ABTD_affinity_cpuset p_cpuset 
)
static

◆ create_cpuset()

static ABTU_ret_err int create_cpuset ( pthread_t  native_thread,
ABTD_affinity_cpuset p_cpuset 
)
static

Definition at line 223 of file abtd_affinity.c.

Referenced by ABTD_affinity_init().

◆ get_num_cores()

static ABTU_ret_err int get_num_cores ( pthread_t  native_thread,
int *  p_num_cores 
)
static

Definition at line 202 of file abtd_affinity.c.

Referenced by ABTD_affinity_init().

◆ int_rem()

static int int_rem ( int  a,
unsigned int  b 
)
inlinestatic

Definition at line 192 of file abtd_affinity.c.

Referenced by ABTD_affinity_init(), and apply_cpuset().

◆ read_cpuset()

static ABTU_ret_err int read_cpuset ( pthread_t  native_thread,
int  max_cpuids,
int *  cpuids,
int *  p_num_cpuids 
)
static

Definition at line 249 of file abtd_affinity.c.

Referenced by ABTD_affinity_cpuset_read().

Variable Documentation

◆ g_affinity

global_affinity g_affinity
static