#include <stdlib.h>
#include <stdio.h>
#include "../common/nm_examples_helper.h"
#define SIZE (64 * 1024)
#define NHEADERS 40
int main(int argc, char**argv)
{
char*buf = malloc(SIZE + 1);
{
int i;
for(i = 0; i < NHEADERS; i++)
{
}
}
else
{
int i;
for(i = 0; i < NHEADERS; i++)
{
printf(
"received h[%d] = %d\n", i,
h);
{
NM_WARN(
"corrupted header: expected = %d; received = %d\n", i,
h);
}
}
}
free(buf);
return 0;
}
int nm_pack(nm_pack_cnx_t *p_cnx, const void *ptr, nm_len_t len)
Append a data fragment to the current message.
int nm_end_packing(nm_pack_cnx_t *p_cnx)
End building and send the current message.
int nm_end_unpacking(nm_pack_cnx_t *p_cnx)
End receiving and flush extraction of the current message.
int nm_begin_unpacking(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, nm_pack_cnx_t *p_cnx)
Start receiving and extracting a new message.
int nm_begin_packing(nm_session_t p_session, nm_gate_t p_gate, nm_tag_t tag, nm_pack_cnx_t *p_cnx)
Start building a new message for sending.
int nm_unpack(nm_pack_cnx_t *p_cnx, void *ptr, nm_len_t len)
Extract a data fragment from the current message; data will actually be available after end_unpacking...
int nm_unpack_express(nm_pack_cnx_t *p_cnx, void *ptr, nm_len_t len)
Extract a data fragment from the current message in express mode: data will be available upon functio...
int nm_pack_express(nm_pack_cnx_t *p_cnx, const void *ptr, nm_len_t len)
Append a data fragment to the current message, in express mode: data will be aavailable immediately a...
without even the implied warranty of !MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU !General Public License for more details !mpif h
static void nm_examples_init(int *argc, char *argv[])
static nm_session_t p_session
static void nm_examples_exit(void)
#define NM_WARN(format,...)
Content for the request in the pack interface.