PadicoTM

Documentation

« back to PM2 home.
psm-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 <psm.h>
33
34static int padico_psm_init(void);
35static void padico_psm_finalize(void);
36
38
39/* ********************************************************* */
40
41static uint64_t dummy_addr = 0; /* dummy address; real PSM addressing system uses ibverbs */
42
43static int init_done = 0;
44
45static void padico_psm_discover(void)
46{
50 if(rc != PSM_OK)
51 {
52 padico_out(puk_verbose_critical, "cannot init PSM library.\n");
53 return;
54 }
55 init_done = 1;
58 if(rc == PSM_OK)
59 {
60 padico_print("detected %d devices.\n", num_units);
61 const char*s_uuid = padico_getenv("PADICO_BOOT_UUID");
63 padico_string_printf(s_net, "PSM-[%s]", s_uuid);
65 if(network == NULL)
66 {
68 }
71 }
72 else
73 {
74 padico_out(puk_verbose_notice, "no device found.\n");
75 }
76}
77
78static int padico_psm_init(void)
79{
81 return 0;
82}
83
84static void padico_psm_finalize(void)
85{
86 if(init_done)
87 {
88 init_done = 0;
90 }
91}
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
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 int padico_psm_init(void)
static uint64_t dummy_addr
static void padico_psm_discover(void)
static void padico_psm_finalize(void)
padico_topo_network_t network
Definition psp-mx.c:113
a network, containing entities with bindings