PadicoTM

Documentation

« back to PM2 home.
PSP.h
Go to the documentation of this file.
1/*
2 * Padico -- a High Performance Parallel and Distributed Computing Environment
3 * Copyright (c) 2002-2025 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
30#ifndef PADICO_NA_PSP_H
31#define PADICO_NA_PSP_H
32
33#include <Padico/Puk.h>
34#include <Padico/Topology.h>
35#include <Padico/PadicoTM.h>
36
38#undef PADICO_LAST_MODULE_NAME
39#define PADICO_LAST_MODULE_NAME PSP
40
48/* ********************************************************* */
49/* *** Interface: PadicoSimplePackets */
50
56/* ** Values and intervals for PSP channels */
57
58
59/* implicit channels */
60#define PADICO_PSP_TAG_NONE ((uint32_t)0x00000000)
61#define PADICO_PSP_CONTROL ((uint32_t)0x01000000)
62#define PADICO_PSP_CIRCUIT ((uint32_t)0x02000000)
63#define PADICO_PSP_VOPW ((uint32_t)0x03000000)
64#define PADICO_PSP_NEWMADICO ((uint32_t)0x04000000)
65#define PADICO_PSP_MINIDRIVER ((uint32_t)0x05000000)
66/* reserved values for system use */
67#define PADICO_PSP_RESERVED ((uint32_t)0xF0000000)
68#define PADICO_PSP_CLOSE_CHANNEL ((uint32_t)0xF1000000)
69#define PADICO_PSP_SYSTEM ((uint32_t)0xF2000000)
71#define PADICO_PSP_ADAPTER_MASK ((uint32_t)0xFF000000)
72#define PADICO_PSP_INSTANCE_MASK ((uint32_t)0x00FFFFFF)
73
94
97typedef void (*padico_psp_pump_t)(void*token, void*bytes, size_t size);
98
103typedef void (*padico_psp_handler_t)(const void*header, padico_topo_node_t from, void*key,
105
109
158
161
162/* ** helper functions */
163
164static inline void padico_psp_init(const struct puk_receptacle_PadicoSimplePackets_s*psp, uint32_t tag, const char*label,
165 size_t*h_size, padico_psp_handler_t handler, void*key)
166{
167 (*psp->driver->init)(psp->_status, tag, label, h_size, handler, key);
168}
169
175
181
187
189 padico_psp_connection_t conn, const char*bytes, size_t size)
190{
191 (*psp->driver->pack)(psp->_status, conn, bytes, size);
192}
193
198
199
200/* *********************************************************
201 * *** PSP directory ***************************************
202 *
203 * This directory is used for PSP demultiplexing of incoming
204 * messages. This is a toolbox to be used by components
205 * exhibiting the PSP interface.
206 */
207
218
220{
221 return a;
222}
224{
225 return a == b;
226}
227
230
239
241
243 padico_psp_handler_t handler, void*key,
244 uint32_t tag, size_t h_size);
245
247
249
250
251
255#endif /* PADICO_NA_PSP_H */
#define PADICO_LAST_MODULE_NAME
Definition PSP.h:39
PUK_IFACE_TYPE(ProxyFactory, struct padico_proxyfactory_s)
return NULL
Definition Shm.h:88
PUK_MOD_AUTO_DEP(SysIO, PADICO_LAST_MODULE_NAME)
static const int tag
Definition bench_MPI.c:13
static struct puk_receptacle_PadicoSimplePackets_s psp
Definition bench_PSP.c:25
static int done
Definition console-mod.c:49
static int size
Definition datacheck.c:34
padico_psp_slot_t padico_psp_slot_insert(struct padico_psp_directory_s *d, padico_psp_handler_t handler, void *key, uint32_t tag, size_t h_size)
Definition psp.c:63
assert(slab_size > 0)
static padico_psp_connection_t padico_psp_new_message(const struct puk_receptacle_PadicoSimplePackets_s *psp, padico_topo_node_t node, void **sbuf)
Definition PSP.h:182
#define PADICO_PSP_ADAPTER_MASK
Definition PSP.h:71
static void padico_psp_listen(const struct puk_receptacle_PadicoSimplePackets_s *psp, padico_topo_node_t node)
Definition PSP.h:170
static uint32_t padico_psp_tag_get_component(uint32_t tag)
get the 'component' (static) part from a PSP tag
Definition PSP.h:84
static void padico_psp_pack(const struct puk_receptacle_PadicoSimplePackets_s *psp, padico_psp_connection_t conn, const char *bytes, size_t size)
Definition PSP.h:188
static uint32_t padico_psp_tag_build(uint32_t component_tag, uint32_t instance_tag)
build a PSP tag from an component tag and an instance tag
Definition PSP.h:76
padico_psp_slot_hash_entry_slice_lfstack_init & a
Definition PSP.h:229
static uint32_t padico_psp_tag_hash(const uint32_t a)
Definition PSP.h:219
static void padico_psp_init(const struct puk_receptacle_PadicoSimplePackets_s *psp, uint32_t tag, const char *label, size_t *h_size, padico_psp_handler_t handler, void *key)
Definition PSP.h:164
const uint32_t key
Definition PSP.h:229
static uint32_t padico_psp_tag_get_instance(uint32_t tag)
get the 'instance' (dynamic) part from a PSP tag
Definition PSP.h:90
struct padico_psp_slot_hash_entry_s * b
Definition PSP.h:229
void padico_psp_directory_init(struct padico_psp_directory_s *d)
Definition psp.c:56
void(* padico_psp_pump_t)(void *token, void *bytes, size_t size)
the function to pump data in PSP callbacks
Definition PSP.h:97
#define PADICO_PSP_INSTANCE_MASK
Definition PSP.h:72
void * padico_psp_connection_t
An outgoing connection object, supposed to be opaque for the user.
Definition PSP.h:108
static int padico_psp_tag_eq(uint32_t a, uint32_t b)
Definition PSP.h:223
static void padico_psp_connect(const struct puk_receptacle_PadicoSimplePackets_s *psp, padico_topo_node_t node)
Definition PSP.h:176
padico_psp_slot_t padico_psp_slot_lookup(struct padico_psp_directory_s *d, uint32_t tag)
Definition psp.c:93
void
Definition PSP.h:229
void padico_psp_slot_remove(struct padico_psp_directory_s *d, padico_psp_slot_t slot)
Definition psp.c:84
void(* padico_psp_handler_t)(const void *header, padico_topo_node_t from, void *key, padico_psp_pump_t pump, void *token)
A callback for PSP.
Definition PSP.h:103
struct padico_psp_slot_s * padico_psp_slot_t
Definition PSP.h:217
static void padico_psp_end_message(const struct puk_receptacle_PadicoSimplePackets_s *psp, padico_psp_connection_t conn)
Definition PSP.h:194
padico_topo_node_t node
Definition na-control.c:65
struct padico_ibv_lz_header_s header
void * sbuf
Definition psp-ibv.c:213
PSP slot directory used for multiplexing.
Definition PSP.h:234
struct padico_psp_slot_hashtable_s table
Definition PSP.h:236
pthread_spinlock_t lock
Definition PSP.h:235
padico_psp_slot_t cache
Definition PSP.h:237
driver descriptor for the PSP interface.
Definition PSP.h:113
void(* listen)(void *_instance, padico_topo_node_t node)
listen for connections from given node.
Definition PSP.h:126
padico_psp_connection_t(* new_message)(void *_instance, padico_topo_node_t node, void **sbuf)
begin a new outgoing message
Definition PSP.h:142
void(* connect)(void *_instance, padico_topo_node_t node)
connects a remote node through PSP
Definition PSP.h:134
void(* end_message)(void *_instance, padico_psp_connection_t conn)
terminates an outgoing message
Definition PSP.h:156
void(* pack)(void *_instance, padico_psp_connection_t conn, const char *bytes, size_t size)
add a new segment of data to an outgoing message
Definition PSP.h:150
void(* init)(void *_instance, uint32_t tag, const char *label, size_t *h_size, padico_psp_handler_t handler, void *key)
init a new PSP instance
Definition PSP.h:122
a PSP slot, i.e.
Definition PSP.h:210
void * key
Definition PSP.h:212
size_t h_size
Definition PSP.h:214
padico_psp_handler_t handler
Definition PSP.h:211
uint32_t tag
Definition PSP.h:213
struct padico_psp_driver_s * driver
Definition PSP.h:160