50 peer = (rank + 1) %
size;
55 fprintf(stderr,
"%s: FATAL- needs an even number of nodes.\n", argv[0]);
59 peer =
is_server ? (rank + 1) : (rank - 1);
113 return 'a' + (offset % 26);
119 for(i = 0; i <
len; i++)
127 memset(buffer, 0,
len);
133 for(i = 0; i <
len; i++)
136 if(buffer[i] != expected)
138 fprintf(stderr,
"Bad data at byte %d: expected 0x%x (%c), received 0x%x (%c)\n",
139 (
int)i, expected, expected, buffer[i], buffer[i]);
155 while(PUK_TIMING_DELAY(t1,t2) < usec);
159#define check_rc(RC) \
160 if((RC) != NM_ESUCCESS) \
162 fprintf(stderr, "Error %d (%s) in %s line %d\n", \
163 (RC), nm_strerror(RC), __FILE__, __LINE__); \
void nm_coll_barrier(nm_comm_t comm, nm_tag_t tag)
void nm_comm_destroy(nm_comm_t p_comm)
destroy a communicator- no synchronization is done
nm_comm_t nm_comm_world(const char *label)
create a new global communicator with given label
struct nm_core_event_s __attribute__
int nm_launcher_get_rank(int *rank)
Returns process rank.
int nm_launcher_get_size(int *size)
Returns the number of nodes.
int nm_launcher_exit(void)
Cleans session.
int nm_launcher_get_gate(int dest, nm_gate_t *gate)
Returns the gate for the process dest.
static int nm_launcher_init(int *argc, char **argv)
Initializes nmad.
int nm_session_open(nm_session_t *pp_session, const char *label)
Open a new session, assuming processes are already connected.
int nm_session_close(nm_session_t p_session)
Disconnect and destroy a session.
nm_tag_t tag
the user-supplied tag
static char buffer_content(nm_len_t offset)
static void control_buffer(const char *buffer, nm_len_t len) __attribute__((unused))
static void fill_buffer(char *buffer, nm_len_t len) __attribute__((unused))
static void nm_examples_barrier(nm_tag_t tag)
static void clear_buffer(char *buffer, nm_len_t len) __attribute__((unused))
static void nm_examples_init(int *argc, char *argv[])
static const nm_tag_t sync_tag
static nm_session_t p_session
static void nm_examples_exit(void)
static void nm_examples_init_topo(int *argc, char *argv[], enum nm_example_topo_e topo)
static nm_len_t _next(nm_len_t len, double multiplier, nm_len_t increment)
static void compute(unsigned usec)
static const nm_tag_t data_tag
nm_len_t size
size of the onsided data (not incuding target-side completion)
This is the common public header for NewMad.
uint64_t nm_tag_t
user tags, 64 bits, contained in indirect hashtable
uint64_t nm_len_t
data length used by nmad
Connection to another process.