PadicoTM

Documentation

« back to PM2 home.
psm2-discover.c
Go to the documentation of this file.
1/*
2 * Padico -- a High Performance Parallel and Distributed Computing Environment
3 * Copyright (c) 2002-2024 INRIA and the University of Rennes 1
4 * Alexandre DENIS <Alexandre.Denis@inria.fr>
5 * Christian PEREZ <Christian.Perez@inria.fr>
6 *
7 * The software has been registered at the Agency for the Protection of
8 * Programs (APP) under the number IDDN.FR.001.260013.000.S.P.2002.000.10000.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
29#include <Padico/Puk.h>
30#include <Padico/Module.h>
31#include <Padico/Topology.h>
32#include <psm2.h>
33
34static int padico_psm2_init(void);
35static void padico_psm2_finalize(void);
36
38 "Topology");
39
40/* ********************************************************* */
41
42static uint64_t dummy_addr = 0; /* dummy address; real PSM2 addressing system uses ibverbs */
43
44static int init_done = 0;
45
46static void padico_psm2_discover(void)
47{
48 if(getenv("HFI_NO_CPUAFFINITY") == NULL)
49 {
50 setenv("HFI_NO_CPUAFFINITY", "1", 1);
51 padico_out(puk_verbose_notice, "HFI_NO_CPUAFFINITY not defined in current environnment; forcing HFI_NO_CPUAFFINITY=1\n");
52 }
53#ifdef PIOMAN
54 if(getenv("PSM2_RCVTHREAD") == NULL)
55 {
56 setenv("PSM2_RCVTHREAD", "0", 1);
57 padico_out(puk_verbose_notice, "PSM2_RCVTHREAD not defined in current environnment; forcing PSM2_RCVTHREAD=0\n");
58 }
59#endif /* PIOMAN */
60
64 if(rc != PSM2_OK)
65 {
66 padico_out(puk_verbose_critical, "cannot init PSM2 library.\n");
67 return;
68 }
69 init_done = 1;
72 if(rc == PSM2_OK)
73 {
74 padico_print("detected %d devices.\n", num_units);
75 const char*s_uuid = padico_getenv("PADICO_BOOT_UUID");
77 padico_string_printf(s_net, "PSM2-[%s]", s_uuid);
79 if(network == NULL)
80 {
82 }
84 int i;
85 for(i = 1; i <= num_units; i++)
86 {
89
90 }
91 }
92 else
93 {
94 padico_print("no device found.\n");
95 }
96}
97
98static int padico_psm2_init(void)
99{
101 return 0;
102}
103
104static void padico_psm2_finalize(void)
105{
106 if(init_done)
107 {
108 init_done = 0;
110 }
111}
return NULL
Definition Shm.h:88
static int done
Definition console-mod.c:49
padico_rc_t rc
Definition PadicoTM.h:146
padico_topo_network_t padico_topo_network_create(const char *id, padico_topo_binding_scope_t scope, size_t addr_size, int family)
Definition topology.c:1853
padico_topo_network_t padico_topo_network_getbyid(const char *network_id)
Definition topology.c:2351
#define padico_topo_getlocalhost()
Definition Topology.h:319
void padico_topo_binding_add_index(padico_topo_binding_t binding, int64_t index)
Definition topology.c:205
padico_topo_binding_t padico_topo_host_bind(padico_topo_host_t host, padico_topo_network_t network, const void *address)
Declare a new binding for a host.
Definition topology.c:1609
@ PADICO_TOPO_SCOPE_HOST
Definition Topology.h:95
static int init_done
static uint64_t dummy_addr
static void padico_psm2_discover(void)
static int padico_psm2_init(void)
static void padico_psm2_finalize(void)
padico_topo_network_t network
Definition psp-mx.c:113
a binding of an entity with a network (protocol level)
a network, containing entities with bindings