StarPU Internal Handbook
Loading...
Searching...
No Matches
memory_nodes.h File Reference
#include <starpu.h>
#include <common/config.h>
#include <datawizard/coherency.h>
#include <datawizard/memalloc.h>
#include <datawizard/node_ops.h>
#include <common/utils.h>
#include <core/workers.h>
#include <core/simgrid.h>

Go to the source code of this file.

Data Structures

struct  _starpu_cond_and_worker
 
struct  _starpu_memory_node_descr
 

Macros

#define _starpu_node_needs_map_update(node)
 
#define starpu_node_get_kind
 
#define starpu_memory_nodes_get_count
 
#define starpu_worker_get_memory_node
 
#define starpu_worker_get_local_memory_node
 

Functions

void _starpu_memory_nodes_init (void)
 
void _starpu_memory_nodes_deinit (void)
 
static void _starpu_memory_node_add_nworkers (unsigned node)
 
void _starpu_worker_drives_memory_node (struct _starpu_worker *worker, unsigned memnode)
 
static const struct _starpu_node_ops_starpu_memory_node_get_node_ops (unsigned node)
 
static unsigned _starpu_memory_node_get_nworkers (unsigned node)
 
static void _starpu_simgrid_memory_node_set_host (unsigned node, starpu_sg_host_t host)
 
static starpu_sg_host_t _starpu_simgrid_memory_node_get_host (unsigned node)
 
void _starpu_memory_node_set_mapped (unsigned node)
 
unsigned _starpu_memory_node_get_mapped (unsigned node)
 
unsigned _starpu_memory_node_register (enum starpu_node_kind kind, int devid)
 
void _starpu_memory_node_register_condition (struct _starpu_worker *worker, starpu_pthread_cond_t *cond, unsigned nodeid)
 
static struct _starpu_memory_node_descr_starpu_memory_node_get_description (void)
 
static enum starpu_node_kind _starpu_node_get_kind (unsigned node)
 
static unsigned _starpu_memory_nodes_get_count (void)
 
static unsigned _starpu_worker_get_memory_node (unsigned workerid)
 
static unsigned _starpu_worker_get_local_memory_node (void)
 

Variables

char _starpu_worker_drives_memory [STARPU_NMAXWORKERS][STARPU_MAXNODES]
 
struct _starpu_memory_node_descr _starpu_descr
 

Data Structure Documentation

◆ _starpu_cond_and_worker

struct _starpu_cond_and_worker
Data Fields
starpu_pthread_cond_t * cond
struct _starpu_worker * worker

◆ _starpu_memory_node_descr

struct _starpu_memory_node_descr
Data Fields
unsigned nnodes
enum starpu_node_kind nodes[STARPU_MAXNODES]
const struct _starpu_node_ops * node_ops[STARPU_MAXNODES]
int devid[STARPU_MAXNODES]

Get the device id associated to this node, or -1 if not applicable

unsigned nworkers[STARPU_MAXNODES]
starpu_sg_host_t host[STARPU_MAXNODES]
starpu_pthread_rwlock_t conditions_rwlock

Every worker is associated to a condition variable on which the worker waits when there is task available. It is possible that multiple worker share the same condition variable, so we maintain a list of all these condition variables so that we can wake up all worker attached to a memory node that are waiting on a task.

struct _starpu_cond_and_worker conditions_attached_to_node[STARPU_MAXNODES][STARPU_NMAXWORKERS]
struct _starpu_cond_and_worker conditions_all[STARPU_MAXNODES *STARPU_NMAXWORKERS]
unsigned total_condition_count

the number of queues attached to each node

unsigned condition_count[STARPU_MAXNODES]
unsigned mapped[STARPU_MAXNODES]

Function Documentation

◆ _starpu_memory_node_add_nworkers()

static void _starpu_memory_node_add_nworkers ( unsigned  node)
inlinestatic

Record that there is an additional worker that uses this memory node

◆ _starpu_worker_drives_memory_node()

void _starpu_worker_drives_memory_node ( struct _starpu_worker worker,
unsigned  memnode 
)

Record that this worker will driver data transfers for this memory node.

◆ _starpu_memory_node_get_nworkers()

static unsigned _starpu_memory_node_get_nworkers ( unsigned  node)
inlinestatic

Get the number of workers that use this memory node

◆ _starpu_memory_node_set_mapped()

void _starpu_memory_node_set_mapped ( unsigned  node)

Note that this memory node can map CPU data

◆ _starpu_memory_node_get_mapped()

unsigned _starpu_memory_node_get_mapped ( unsigned  node)

Returns whether this memory node can map CPU data

◆ _starpu_memory_node_register()

unsigned _starpu_memory_node_register ( enum starpu_node_kind  kind,
int  devid 
)

Registers a memory node. Returns the memory node number

◆ _starpu_memory_node_register_condition()

void _starpu_memory_node_register_condition ( struct _starpu_worker worker,
starpu_pthread_cond_t *  cond,
unsigned  nodeid 
)

Register a condition variable associated to worker which is associated to a memory node itself.

◆ _starpu_memory_node_get_description()

static struct _starpu_memory_node_descr * _starpu_memory_node_get_description ( void  )
inlinestatic

See starpu_memory_node_get_description()

◆ _starpu_node_get_kind()

static enum starpu_node_kind _starpu_node_get_kind ( unsigned  node)
inlinestatic

See starpu_node_get_kind()

◆ _starpu_memory_nodes_get_count()

static unsigned _starpu_memory_nodes_get_count ( void  )
inlinestatic

See starpu_memory_nodes_get_count()

◆ _starpu_worker_get_memory_node()

static unsigned _starpu_worker_get_memory_node ( unsigned  workerid)
inlinestatic

See starpu_worker_get_memory_node()

This workerid may either be a basic worker or a combined worker

We have a combined worker

◆ _starpu_worker_get_local_memory_node()

static unsigned _starpu_worker_get_local_memory_node ( void  )
inlinestatic

See starpu_worker_get_local_memory_node