PadicoTM

Documentation

« back to PM2 home.
bench_PSP.c File Reference
#include "bench_common.h"
#include <Padico/PSP.h>
#include <Padico/NetSelector.h>
#include <Padico/PadicoTM.h>
#include <Padico/Module.h>
Include dependency graph for bench_PSP.c:

Go to the source code of this file.

Functions

int bench_psp_init (void)
 
int bench_psp_run (int argc, char **argv)
 
static void padico_module_create_initializer__bench_PSP (void)
 
static void my_memcpy (void *_dest, const void *_source, size_t len)
 
static void bench_psp_post_recv (char *buffer, size_t lenbuf)
 
static void bench_psp_wait (void)
 
static void bench_psp_send (void *buffer, size_t lenbuf)
 
static void bench_psp_handler (const void *_header, padico_topo_node_t from, void *key, padico_psp_pump_t pump, void *token)
 
static void psp_server (char *buffer, size_t lenbuf)
 
static void psp_client (char *buffer, size_t lenbuf)
 

Variables

struct puk_mod_binary_s padico_mod_binary__bench_PSP = { .name = "bench_PSP", .funcs = &padico_mod_funcs__bench_PSP , .mod = NULL, .profile = { .total_mem = 0, .max_mem = 0, .num_malloc = 0, .num_free = 0 } , .auto_deps = & puk_mod_dep_PSP , .n_deps = sizeof((char*[]){ 0, }) / sizeof(char*), .deps = { NULL, } }
 
static const struct puk_mod_funcs_s padico_mod_funcs__bench_PSP = { .init = ( bench_psp_init ), .run = ( bench_psp_run ), .finalize = ( NULL ) }
 
static char * recv_buffer = NULL
 buffer for receipt
 
static size_t recv_lenbuf = 0
 len of above buffer
 
static size_t len_offset = 0
 
static pthread_t recv_tid
 
static int num_trips = 0
 number of messages received
 
static pthread_mutex_t mutex
 
static pthread_cond_t cond
 
static padico_topo_node_t peer
 
static struct puk_receptacle_PadicoSimplePackets_s psp
 
static const struct bench_desc_s psp_bench
 

Function Documentation

◆ bench_psp_handler()

static void bench_psp_handler ( const void *  _header,
padico_topo_node_t  from,
void *  key,
padico_psp_pump_t  pump,
void *  token 
)
static

Definition at line 94 of file bench_PSP.c.

References cond, header, len, len_offset, mutex, NULL, num_trips, recv_buffer, recv_lenbuf, recv_tid, and tid.

Referenced by bench_psp_init().

◆ bench_psp_init()

◆ bench_psp_post_recv()

static void bench_psp_post_recv ( char *  buffer,
size_t  lenbuf 
)
static

Definition at line 40 of file bench_PSP.c.

References buffer, cond, mutex, recv_buffer, recv_lenbuf, and recv_tid.

Referenced by psp_client(), and psp_server().

◆ bench_psp_run()

int bench_psp_run ( int  argc,
char **  argv 
)

Definition at line 201 of file bench_PSP.c.

References psp_bench, and the_bench().

◆ bench_psp_send()

◆ bench_psp_wait()

static void bench_psp_wait ( void  )
static

Definition at line 51 of file bench_PSP.c.

References cond, mutex, NULL, num_trips, recv_buffer, and recv_lenbuf.

Referenced by psp_client(), and psp_server().

◆ my_memcpy()

static void my_memcpy ( void *  _dest,
const void *  _source,
size_t  len 
)
inlinestatic

Definition at line 27 of file bench_PSP.c.

References i, int, len, and source.

◆ padico_module_create_initializer__bench_PSP()

static void padico_module_create_initializer__bench_PSP ( void  )
static

Definition at line 13 of file bench_PSP.c.

◆ psp_client()

static void psp_client ( char *  buffer,
size_t  lenbuf 
)
static

Definition at line 185 of file bench_PSP.c.

References bench_psp_post_recv(), bench_psp_send(), bench_psp_wait(), and buffer.

◆ psp_server()

static void psp_server ( char *  buffer,
size_t  lenbuf 
)
static

Definition at line 176 of file bench_PSP.c.

References bench_psp_post_recv(), bench_psp_send(), bench_psp_wait(), and buffer.

Variable Documentation

◆ cond

pthread_cond_t cond
static

Definition at line 22 of file bench_PSP.c.

Referenced by bench_psp_handler(), bench_psp_init(), bench_psp_post_recv(), and bench_psp_wait().

◆ len_offset

size_t len_offset = 0
static

Definition at line 17 of file bench_PSP.c.

Referenced by bench_psp_handler(), bench_psp_init(), and bench_psp_send().

◆ mutex

pthread_mutex_t mutex
static

Definition at line 21 of file bench_PSP.c.

Referenced by bench_psp_handler(), bench_psp_init(), bench_psp_post_recv(), and bench_psp_wait().

◆ num_trips

int num_trips = 0
static

number of messages received

Definition at line 19 of file bench_PSP.c.

Referenced by bench_psp_handler(), bench_psp_send(), and bench_psp_wait().

◆ padico_mod_binary__bench_PSP

struct puk_mod_binary_s padico_mod_binary__bench_PSP = { .name = "bench_PSP", .funcs = &padico_mod_funcs__bench_PSP , .mod = NULL, .profile = { .total_mem = 0, .max_mem = 0, .num_malloc = 0, .num_free = 0 } , .auto_deps = & puk_mod_dep_PSP , .n_deps = sizeof((char*[]){ 0, }) / sizeof(char*), .deps = { NULL, } }

Definition at line 13 of file bench_PSP.c.

◆ padico_mod_funcs__bench_PSP

const struct puk_mod_funcs_s padico_mod_funcs__bench_PSP = { .init = ( bench_psp_init ), .run = ( bench_psp_run ), .finalize = ( NULL ) }
static

Definition at line 13 of file bench_PSP.c.

◆ peer

padico_topo_node_t peer
static

Definition at line 24 of file bench_PSP.c.

Referenced by bench_psp_init(), and bench_psp_send().

◆ psp

◆ psp_bench

const struct bench_desc_s psp_bench
static
Initial value:
=
{
.name = "PSP",
.server = &psp_server,
.client = &psp_client
}
static void psp_server(char *buffer, size_t lenbuf)
Definition bench_PSP.c:176
static void psp_client(char *buffer, size_t lenbuf)
Definition bench_PSP.c:185

Definition at line 194 of file bench_PSP.c.

Referenced by bench_psp_run().

◆ recv_buffer

char* recv_buffer = NULL
static

buffer for receipt

Definition at line 15 of file bench_PSP.c.

Referenced by bench_psp_handler(), bench_psp_post_recv(), and bench_psp_wait().

◆ recv_lenbuf

size_t recv_lenbuf = 0
static

len of above buffer

Definition at line 16 of file bench_PSP.c.

Referenced by bench_psp_handler(), bench_psp_post_recv(), and bench_psp_wait().

◆ recv_tid

pthread_t recv_tid
static

Definition at line 18 of file bench_PSP.c.

Referenced by bench_psp_handler(), and bench_psp_post_recv().