Loading...
Searching...
No Matches
topology.h
Go to the documentation of this file.
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2009-2023 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
*
* StarPU is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* StarPU is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU Lesser General Public License in COPYING.LGPL for more details.
*/
#ifndef __TOPOLOGY_H__
#define __TOPOLOGY_H__
#include <starpu.h>
#include <common/config.h>
#include <common/list.h>
#include <common/fxt.h>
#include <common/uthash.h>
#pragma GCC visibility push(hidden)
struct _starpu_machine_config;
#ifndef STARPU_SIMGRID
#ifdef STARPU_HAVE_HWLOC
struct _starpu_hwloc_userdata
{
struct _starpu_worker_list *worker_list;
unsigned ngpus;
struct _starpu_worker *pu_worker;
};
#endif
#endif
struct _starpu_worker_set;
struct _starpu_machine_topology;
int _starpu_build_topology(struct _starpu_machine_config *config, int no_mp_config);
void _starpu_initialize_workers_deviceid(int *explicit_workers_gpuid,
int *current, int *workers_gpuid,
const char *varname, unsigned nhwgpus,
enum starpu_worker_archtype type);
int _starpu_get_next_devid(struct _starpu_machine_topology *topology, struct _starpu_machine_config *config, enum starpu_worker_archtype arch);
void _starpu_topology_check_ndevices(int *ndevices, unsigned nhwdevices, int overflow, unsigned max, int reserved, const char *nname, const char *dname, const char *configurename);
#define ALLOC_WORKER_SET ((struct _starpu_worker_set*) -1)
#define DEVID_PER_WORKER -2
void _starpu_topology_configure_workers(struct _starpu_machine_topology *topology,
struct _starpu_machine_config *config,
enum starpu_worker_archtype type,
int devnum, int devid,
int homogeneous, int worker_devid,
unsigned nworker_per_device,
unsigned ncores,
struct _starpu_worker_set *worker_set,
struct _starpu_worker_set *driver_worker_set);
extern unsigned _starpu_may_bind_automatically[STARPU_NARCH];
unsigned _starpu_get_next_bindid(struct _starpu_machine_config *config, unsigned flags,
unsigned *preferred_binding, unsigned npreferred);
void _starpu_destroy_machine_config(struct _starpu_machine_config *config, int no_mp_config);
void _starpu_destroy_topology(struct _starpu_machine_config *config);
#ifdef STARPU_HAVE_HWLOC
hwloc_obj_t _starpu_numa_get_obj(hwloc_obj_t obj);
#endif
unsigned _starpu_topology_get_nhwcpu(struct _starpu_machine_config *config);
unsigned _starpu_topology_get_nhwpu(struct _starpu_machine_config *config);
unsigned _starpu_topology_get_nhwpu(struct _starpu_machine_config *config);
unsigned _starpu_topology_get_nhwnumanodes(struct _starpu_machine_config *config);
unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config);
unsigned _starpu_topology_get_numa_core_binding(struct _starpu_machine_config *config, const unsigned *numa_binding, unsigned nnuma, unsigned *binding, unsigned nbinding);
int starpu_memory_nodes_numa_hwloclogid_to_id(int logid);
/* This returns the exact NUMA node next to a worker */
int _starpu_get_logical_numa_node_worker(unsigned workerid);
unsigned _starpu_get_nhyperthreads() STARPU_ATTRIBUTE_VISIBILITY_DEFAULT;
#ifdef STARPU_HAVE_HWLOC
void _starpu_topology_filter(hwloc_topology_t topology);
#endif
#define STARPU_NOWORKERID -1
#define STARPU_ACTIVETHREAD -2
#define STARPU_NONACTIVETHREAD -2
int _starpu_bind_thread_on_cpu(int cpuid, int workerid, const char *name);
struct _starpu_combined_worker;
void _starpu_bind_thread_on_cpus(struct _starpu_combined_worker *combined_worker);
struct _starpu_worker *_starpu_get_worker_from_driver(struct starpu_driver *d);
unsigned starpu_memory_nodes_get_numa_count(void) STARPU_ATTRIBUTE_VISIBILITY_DEFAULT;
int starpu_memory_nodes_numa_id_to_hwloclogid(unsigned id);
int _starpu_task_data_get_node_on_node(struct starpu_task *task, unsigned index, unsigned target_node);
int _starpu_task_data_get_node_on_worker(struct starpu_task *task, unsigned index, unsigned worker);
#pragma GCC visibility pop
#endif // __TOPOLOGY_H__
fxt.h
starpu_driver
Definition starpu_driver.h:49
starpu_worker_archtype
starpu_worker_archtype
Definition starpu_worker.h:66
starpu_memory_nodes_get_numa_count
unsigned starpu_memory_nodes_get_numa_count(void)
STARPU_NARCH
@ STARPU_NARCH
Definition starpu_worker.h:74
list.h
_starpu_combined_worker
Definition workers.h:311
_starpu_machine_config
Definition workers.h:441
_starpu_machine_topology
Definition workers.h:352
_starpu_machine_topology::nhwdevices
unsigned nhwdevices[STARPU_NARCH]
Definition workers.h:388
_starpu_machine_topology::devid
int devid[STARPU_NARCH][STARPU_NMAXDEVS]
Definition workers.h:404
_starpu_machine_topology::ndevices
unsigned ndevices[STARPU_NARCH]
Definition workers.h:396
_starpu_worker_set
Definition workers.h:339
_starpu_worker
Definition workers.h:155
_starpu_build_topology
int _starpu_build_topology(struct _starpu_machine_config *config, int no_mp_config)
_starpu_get_next_devid
int _starpu_get_next_devid(struct _starpu_machine_topology *topology, struct _starpu_machine_config *config, enum starpu_worker_archtype arch)
_starpu_destroy_topology
void _starpu_destroy_topology(struct _starpu_machine_config *config)
_starpu_task_data_get_node_on_worker
int _starpu_task_data_get_node_on_worker(struct starpu_task *task, unsigned index, unsigned worker)
_starpu_destroy_machine_config
void _starpu_destroy_machine_config(struct _starpu_machine_config *config, int no_mp_config)
_starpu_get_nhyperthreads
unsigned _starpu_get_nhyperthreads() STARPU_ATTRIBUTE_VISIBILITY_DEFAULT
_starpu_topology_get_nhwnumanodes
unsigned _starpu_topology_get_nhwnumanodes(struct _starpu_machine_config *config)
_starpu_topology_check_ndevices
void _starpu_topology_check_ndevices(int *ndevices, unsigned nhwdevices, int overflow, unsigned max, int reserved, const char *nname, const char *dname, const char *configurename)
_starpu_get_next_bindid
unsigned _starpu_get_next_bindid(struct _starpu_machine_config *config, unsigned flags, unsigned *preferred_binding, unsigned npreferred)
_starpu_task_data_get_node_on_node
int _starpu_task_data_get_node_on_node(struct starpu_task *task, unsigned index, unsigned target_node)
_starpu_topology_get_numa_core_binding
unsigned _starpu_topology_get_numa_core_binding(struct _starpu_machine_config *config, const unsigned *numa_binding, unsigned nnuma, unsigned *binding, unsigned nbinding)
_starpu_bind_thread_on_cpu
int _starpu_bind_thread_on_cpu(int cpuid, int workerid, const char *name)
_starpu_topology_get_nnumanodes
unsigned _starpu_topology_get_nnumanodes(struct _starpu_machine_config *config)
_starpu_topology_filter
void _starpu_topology_filter(hwloc_topology_t topology)
_starpu_topology_get_nhwpu
unsigned _starpu_topology_get_nhwpu(struct _starpu_machine_config *config)
_starpu_numa_get_obj
hwloc_obj_t _starpu_numa_get_obj(hwloc_obj_t obj)
_starpu_initialize_workers_deviceid
void _starpu_initialize_workers_deviceid(int *explicit_workers_gpuid, int *current, int *workers_gpuid, const char *varname, unsigned nhwgpus, enum starpu_worker_archtype type)
_starpu_bind_thread_on_cpus
void _starpu_bind_thread_on_cpus(struct _starpu_combined_worker *combined_worker)
_starpu_topology_get_nhwcpu
unsigned _starpu_topology_get_nhwcpu(struct _starpu_machine_config *config)
uthash.h