Dynamic Load Balance 3.6.1+32-59d1
spd.h
Go to the documentation of this file.
1/*********************************************************************************/
2/* Copyright 2009-2021 Barcelona Supercomputing Center */
3/* */
4/* This file is part of the DLB library. */
5/* */
6/* DLB is free software: you can redistribute it and/or modify */
7/* it under the terms of the GNU Lesser General Public License as published by */
8/* the Free Software Foundation, either version 3 of the License, or */
9/* (at your option) any later version. */
10/* */
11/* DLB is distributed in the hope that it will be useful, */
12/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14/* GNU Lesser General Public License for more details. */
15/* */
16/* You should have received a copy of the GNU Lesser General Public License */
17/* along with DLB. If not, see <https://www.gnu.org/licenses/>. */
18/*********************************************************************************/
19
20#ifndef SPD_H
21#define SPD_H
22
23#include "LB_core/lb_funcs.h"
24
26#include "support/options.h"
27#include "support/types.h"
28
29#include <sys/types.h>
30
31/* Sub-process Descriptor */
32
33typedef struct SubProcessDescriptor {
34 pid_t id; // sub-proces id, used everywhere to identify spd
35 pid_t pid; // real pid for fork-safety purposes
40 cpu_set_t process_mask;
41 cpu_set_t active_mask;
46 unsigned int lewi_ncpus;
47 void *lewi_info;
48 void *talp_info;
51
52extern __thread subprocess_descriptor_t *thread_spd;
53
57void spd_set_pthread(const subprocess_descriptor_t *spd, pthread_t pthread);
58pthread_t spd_get_pthread(const subprocess_descriptor_t *spd);
60
61#endif /* SPD_H */
struct SubProcessDescriptor subprocess_descriptor_t
Definition: regions.h:26
void spd_set_pthread(const subprocess_descriptor_t *spd, pthread_t pthread)
Definition: spd.c:91
void spd_unregister(const subprocess_descriptor_t *spd)
Definition: spd.c:75
void spd_enter_dlb(subprocess_descriptor_t *spd)
Definition: spd.c:47
const subprocess_descriptor_t ** spd_get_spds(void)
Definition: spd.c:124
void spd_register(subprocess_descriptor_t *spd)
Definition: spd.c:58
pthread_t spd_get_pthread(const subprocess_descriptor_t *spd)
Definition: spd.c:100
__thread subprocess_descriptor_t * thread_spd
Definition: spd.c:30
Definition: lb_funcs.h:29
Definition: options.h:30
Definition: numThreads.h:28
Definition: spd.h:33
void * talp_info
Definition: spd.h:48
unsigned int lewi_ncpus
Definition: spd.h:46
bool dlb_preinitialized
Definition: spd.h:37
pm_interface_t pm
Definition: spd.h:43
options_t options
Definition: spd.h:42
void * lewi_info
Definition: spd.h:47
void * barrier_info
Definition: spd.h:49
pid_t id
Definition: spd.h:34
bool lewi_enabled
Definition: spd.h:39
cpu_set_t process_mask
Definition: spd.h:40
cpu_set_t active_mask
Definition: spd.h:41
bool dlb_initialized
Definition: spd.h:36
policy_t lb_policy
Definition: spd.h:44
pid_t pid
Definition: spd.h:35
balance_policy_t lb_funcs
Definition: spd.h:45
bool dlb_initialized_via_ompt
Definition: spd.h:38
policy_t
Definition: types.h:123