NewMadeleine

Documentation

« back to PM2 home.
nm_examples_helper.h File Reference
Include dependency graph for nm_examples_helper.h:

Go to the source code of this file.

Macros

#define check_rc(RC)
 

Enumerations

enum  nm_example_topo_e { NM_EXAMPLES_TOPO_RING , NM_EXAMPLES_TOPO_PAIRS , NM_EXAMPLES_TOPO_STAR }
 

Functions

static void nm_examples_init_topo (int *argc, char *argv[], enum nm_example_topo_e topo)
 
static void nm_examples_barrier (nm_tag_t tag)
 
static void nm_examples_init (int *argc, char *argv[])
 
static void nm_examples_exit (void)
 
static nm_len_t _next (nm_len_t len, double multiplier, nm_len_t increment)
 
static char buffer_content (nm_len_t offset, int seed)
 
static void fill_buffer_seed (char *buffer, nm_len_t len, int seed) __attribute__((unused))
 
static void fill_buffer (char *buffer, nm_len_t len) __attribute__((unused))
 
static void clear_buffer (char *buffer, nm_len_t len) __attribute__((unused))
 
static void control_buffer_seed (const char *buffer, nm_len_t len, int seed) __attribute__((unused))
 
static void control_buffer (const char *buffer, nm_len_t len) __attribute__((unused))
 
static void compute (unsigned usec)
 
static void fisher_yates_shuffle (int *p_array, size_t n)
 shuffle an array of ints
 
static struct nm_group_s * nm_examples_group_inorder (int n)
 generate a group with ranks in order
 
static struct nm_group_s * nm_examples_group_reverse (int n)
 generate a group with ranks in reverse order
 
static struct nm_group_s * nm_examples_group_shuffled (int n)
 

Variables

static int is_server = -1
 
static nm_session_t p_session = NULL
 
static nm_gate_t p_gate = NULL
 
static nm_comm_t p_comm = NULL
 
static const nm_tag_t data_tag = 0x01
 
static const nm_tag_t sync_tag = 0x02
 

Macro Definition Documentation

◆ check_rc

#define check_rc (   RC)
Value:
if((RC) != NM_ESUCCESS) \
{ \
fprintf(stderr, "Error %d (%s) in %s line %d\n", \
(RC), nm_strerror(RC), __FILE__, __LINE__); \
abort(); \
}
const char * nm_strerror(int rc)
@ NM_ESUCCESS
successful operation
Definition nm_errno.h:36

Definition at line 171 of file nm_examples_helper.h.

Enumeration Type Documentation

◆ nm_example_topo_e

Enumerator
NM_EXAMPLES_TOPO_RING 
NM_EXAMPLES_TOPO_PAIRS 
NM_EXAMPLES_TOPO_STAR 

Definition at line 32 of file nm_examples_helper.h.

Function Documentation

◆ _next()

static nm_len_t _next ( nm_len_t  len,
double  multiplier,
nm_len_t  increment 
)
inlinestatic

Definition at line 98 of file nm_examples_helper.h.

References len.

◆ buffer_content()

static char buffer_content ( nm_len_t  offset,
int  seed 
)
inlinestatic

Definition at line 108 of file nm_examples_helper.h.

Referenced by control_buffer_seed(), and fill_buffer_seed().

◆ clear_buffer()

static void clear_buffer ( char *  buffer,
nm_len_t  len 
)
inlinestatic

Definition at line 130 of file nm_examples_helper.h.

References len.

◆ compute()

static void compute ( unsigned  usec)
inlinestatic

Definition at line 157 of file nm_examples_helper.h.

◆ control_buffer()

static void control_buffer ( const char *  buffer,
nm_len_t  len 
)
inlinestatic

Definition at line 152 of file nm_examples_helper.h.

References control_buffer_seed(), and len.

Here is the call graph for this function:

◆ control_buffer_seed()

static void control_buffer_seed ( const char *  buffer,
nm_len_t  len,
int  seed 
)
inlinestatic

Definition at line 136 of file nm_examples_helper.h.

References buffer_content(), and len.

Referenced by control_buffer().

Here is the call graph for this function:

◆ fill_buffer()

static void fill_buffer ( char *  buffer,
nm_len_t  len 
)
inlinestatic

Definition at line 124 of file nm_examples_helper.h.

References fill_buffer_seed(), and len.

Here is the call graph for this function:

◆ fill_buffer_seed()

static void fill_buffer_seed ( char *  buffer,
nm_len_t  len,
int  seed 
)
inlinestatic

Definition at line 114 of file nm_examples_helper.h.

References buffer_content(), and len.

Referenced by fill_buffer().

Here is the call graph for this function:

◆ fisher_yates_shuffle()

static void fisher_yates_shuffle ( int *  p_array,
size_t  n 
)
inlinestatic

shuffle an array of ints

Definition at line 180 of file nm_examples_helper.h.

Referenced by nm_examples_group_shuffled().

◆ nm_examples_barrier()

static void nm_examples_barrier ( nm_tag_t  tag)
inlinestatic

Definition at line 74 of file nm_examples_helper.h.

References nm_coll_barrier(), p_comm, and tag.

Referenced by nm_examples_exit().

Here is the call graph for this function:

◆ nm_examples_exit()

static void nm_examples_exit ( void  )
inlinestatic

◆ nm_examples_group_inorder()

static struct nm_group_s * nm_examples_group_inorder ( int  n)
inlinestatic

generate a group with ranks in order

Definition at line 194 of file nm_examples_helper.h.

References nm_comm_get_gate(), nm_group_add_node(), nm_group_new(), and p_comm.

Here is the call graph for this function:

◆ nm_examples_group_reverse()

static struct nm_group_s * nm_examples_group_reverse ( int  n)
inlinestatic

generate a group with ranks in reverse order

Definition at line 206 of file nm_examples_helper.h.

References nm_comm_get_gate(), nm_group_add_node(), nm_group_new(), and p_comm.

Here is the call graph for this function:

◆ nm_examples_group_shuffled()

static struct nm_group_s * nm_examples_group_shuffled ( int  n)
inlinestatic

Definition at line 217 of file nm_examples_helper.h.

References fisher_yates_shuffle(), nm_comm_get_gate(), nm_group_add_node(), nm_group_new(), and p_comm.

Here is the call graph for this function:

◆ nm_examples_init()

static void nm_examples_init ( int *  argc,
char *  argv[] 
)
inlinestatic
Examples
nm_onesided_queues.c, nm_onesided_simple.c, nm_pack_headers.c, and nm_sr_peek.c.

Definition at line 79 of file nm_examples_helper.h.

References nm_examples_init_topo(), and NM_EXAMPLES_TOPO_RING.

Here is the call graph for this function:

◆ nm_examples_init_topo()

static void nm_examples_init_topo ( int *  argc,
char *  argv[],
enum nm_example_topo_e  topo 
)
static

Variable Documentation

◆ data_tag

const nm_tag_t data_tag = 0x01
static
Examples
nm_bench_req_monitor.c.

Definition at line 29 of file nm_examples_helper.h.

◆ is_server

int is_server = -1
static

◆ p_comm

◆ p_gate

◆ p_session

◆ sync_tag

const nm_tag_t sync_tag = 0x02
static

Definition at line 30 of file nm_examples_helper.h.