NewMadeleine

Documentation

« back to PM2 home.
Collective operations

Collective operations, working on a communicator or on a group, with contiguous data or with nm_data, blocking or non-blocking. More...

Files

file  nm_coll.h
 

Typedefs

typedef struct nm_coll_req_snm_coll_req_t
 a request for a non-blocking collective
 
typedef void(* nm_coll_req_notifier_t) (void *ref)
 notification function for collective reqs
 
void nm_coll_barrier (nm_comm_t comm, nm_tag_t tag)
 
void nm_coll_bcast (nm_comm_t comm, int root, void *buffer, nm_len_t len, nm_tag_t tag)
 
void nm_coll_scatter (nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
 
void nm_coll_gather (nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
 
void nm_coll_allgather (nm_comm_t comm, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
 
void nm_coll_group_wait (nm_session_t p_session, nm_group_t p_group, int root, nm_tag_t tag)
 root waits for all nodes; equivalent to half-barrier or gather without data
 
void nm_coll_group_barrier (nm_session_t p_session, nm_group_t p_group, nm_tag_t tag)
 
void nm_coll_group_bcast (nm_session_t p_session, nm_group_t p_group, int root, void *buffer, nm_len_t len, nm_tag_t tag)
 
void nm_coll_group_scatter (nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
 
void nm_coll_group_gather (nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
 
void nm_coll_group_allgather (nm_session_t p_session, nm_group_t p_group, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
 
void nm_coll_data_bcast (nm_comm_t comm, int root, struct nm_data_s *p_data, nm_tag_t tag)
 
void nm_coll_data_scatter (nm_comm_t p_comm, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
 scatter using nm_data; p_sdata must contain all data for all processes.
 
void nm_coll_data_gather (nm_comm_t p_comm, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
 gather using nm_data; on root, p_rdata will contain all data for all processes.
 
void nm_coll_data_allgather (nm_comm_t comm, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
 
void nm_coll_group_data_bcast (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag)
 
void nm_coll_group_data_scatter (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
 
void nm_coll_group_data_gather (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
 
void nm_coll_group_data_allgather (nm_session_t p_session, nm_group_t p_group, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
 allgather using nm_data; on all nodes, p_rdata will contain all data for all processes.
 
void nm_coll_req_wait (struct nm_coll_req_s *p_coll_req)
 
int nm_coll_req_test (struct nm_coll_req_s *p_coll_req)
 
struct nm_coll_req_snm_coll_ibcast (nm_comm_t p_comm, int root, void *buffer, nm_len_t len, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
 generic ibcast on communicator with contiguous data, with automatic algorithm selection
 
struct nm_coll_req_snm_coll_group_data_ibcast (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
 generic ibcast on group+data with automatic algorithm selection
 
struct nm_coll_req_snm_coll_ibcast_pipeline (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag, nm_len_t block_size, nm_coll_tree_kind_t kind, nm_coll_req_notifier_t p_notify, void *ref)
 ibcast with pipelined algorithm; for internal use
 
struct nm_coll_req_snm_coll_ibcast_tree (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag, nm_coll_tree_kind_t kind, nm_coll_req_notifier_t p_notify, void *ref)
 ibcast with tree algorithm; for internal use
 
struct nm_coll_req_snm_coll_ibarrier (nm_comm_t p_comm, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
 
struct nm_coll_req_snm_coll_group_ibarrier (nm_session_t p_session, nm_group_t p_group, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
 
struct nm_coll_req_snm_coll_iscatter (nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
 
struct nm_coll_req_snm_coll_group_iscatter (nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
struct nm_coll_req_snm_coll_group_data_iscatter (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
struct nm_coll_req_snm_coll_igather (nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
 
struct nm_coll_req_snm_coll_group_igather (nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
struct nm_coll_req_snm_coll_group_data_igather (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
struct nm_coll_req_snm_coll_iallgather (nm_comm_t comm, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
struct nm_coll_req_snm_coll_group_iallgather (nm_session_t p_session, nm_group_t p_group, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
struct nm_coll_req_snm_coll_group_data_iallgather (nm_session_t p_session, nm_group_t p_group, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
 
void nm_coll_bcast_2trees (nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag1, nm_tag_t tag2, nm_len_t block_size, nm_coll_tree_kind_t kind)
 

Detailed Description

Collective operations, working on a communicator or on a group, with contiguous data or with nm_data, blocking or non-blocking.

Data for scatter, gather, and allgather operations follow these rules:

  • when using contigous data, sbuf for scatter and rbuf for gather points to a message for a single dest, following the MPI_Scatter and MPI_Gather semantics, and slen==rlen is assumed. Data for other processes is assumed to follow (at rbuf + rlen * k)
  • when using nm_data data layout, sdata for scatter and rdata for gather are expected to contain the data for all processes. It is assumed that nm_data_size(p_sdata) == group_size * nm_data_size(p_rdata) for scatter, and nm_data_size(p_rdata) == group_size * nm_data_size(p_sdata) for gather & allgather.

Non-blocking collectives use coll requests (nm_coll_req_t):

  • the coll_req is allocated by the primitive used to post the coll req
  • 3 completion modes are available: wait, test, or notify; they are mutually exclusive, a request with a notifier cannot be tested or waited for. When a notifier is given, the returned coll_req will be NULL; when NULL is given as notifier, the user is assumed to wait for completion with nm_coll_req_wait or nm_coll_req_test
  • the request is automatically freed upon completion in all 3 cases.

Typedef Documentation

◆ nm_coll_req_notifier_t

typedef void(* nm_coll_req_notifier_t) (void *ref)

notification function for collective reqs

Definition at line 131 of file nm_coll.h.

◆ nm_coll_req_t

typedef struct nm_coll_req_s* nm_coll_req_t

a request for a non-blocking collective

Definition at line 126 of file nm_coll.h.

Function Documentation

◆ nm_coll_allgather()

void nm_coll_allgather ( nm_comm_t  comm,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag 
)
extern

◆ nm_coll_barrier()

void nm_coll_barrier ( nm_comm_t  comm,
nm_tag_t  tag 
)
extern

◆ nm_coll_bcast()

void nm_coll_bcast ( nm_comm_t  comm,
int  root,
void *  buffer,
nm_len_t  len,
nm_tag_t  tag 
)
extern

Referenced by nm_sync_clocks_bcast().

◆ nm_coll_bcast_2trees()

void nm_coll_bcast_2trees ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_data,
nm_tag_t  tag1,
nm_tag_t  tag2,
nm_len_t  block_size,
nm_coll_tree_kind_t  kind 
)

◆ nm_coll_data_allgather()

void nm_coll_data_allgather ( nm_comm_t  comm,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag 
)
extern

◆ nm_coll_data_bcast()

void nm_coll_data_bcast ( nm_comm_t  comm,
int  root,
struct nm_data_s p_data,
nm_tag_t  tag 
)
extern

◆ nm_coll_data_gather()

void nm_coll_data_gather ( nm_comm_t  p_comm,
int  root,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag 
)
extern

gather using nm_data; on root, p_rdata will contain all data for all processes.

p_sdata = NULL on root for in-place; p_rdata may be NULL on non-root

◆ nm_coll_data_scatter()

void nm_coll_data_scatter ( nm_comm_t  p_comm,
int  root,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag 
)
extern

scatter using nm_data; p_sdata must contain all data for all processes.

p_rdata = NULL on root for in-place; p_sdata may be NULL on non-root

◆ nm_coll_gather()

void nm_coll_gather ( nm_comm_t  comm,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag 
)
extern

Referenced by nm_sync_clocks_gather().

◆ nm_coll_group_allgather()

void nm_coll_group_allgather ( nm_session_t  p_session,
nm_group_t  p_group,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_barrier()

void nm_coll_group_barrier ( nm_session_t  p_session,
nm_group_t  p_group,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_bcast()

void nm_coll_group_bcast ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
void *  buffer,
nm_len_t  len,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_data_allgather()

void nm_coll_group_data_allgather ( nm_session_t  p_session,
nm_group_t  p_group,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag 
)
extern

allgather using nm_data; on all nodes, p_rdata will contain all data for all processes.

p_sdata = NULL for in-place, with data already in p_rdata

◆ nm_coll_group_data_bcast()

void nm_coll_group_data_bcast ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_data,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_data_gather()

void nm_coll_group_data_gather ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_data_iallgather()

struct nm_coll_req_s * nm_coll_group_data_iallgather ( nm_session_t  p_session,
nm_group_t  p_group,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_group_data_ibcast()

struct nm_coll_req_s * nm_coll_group_data_ibcast ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_data,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

generic ibcast on group+data with automatic algorithm selection

◆ nm_coll_group_data_igather()

struct nm_coll_req_s * nm_coll_group_data_igather ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_group_data_iscatter()

struct nm_coll_req_s * nm_coll_group_data_iscatter ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_group_data_scatter()

void nm_coll_group_data_scatter ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_sdata,
struct nm_data_s p_rdata,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_gather()

void nm_coll_group_gather ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_iallgather()

struct nm_coll_req_s * nm_coll_group_iallgather ( nm_session_t  p_session,
nm_group_t  p_group,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_group_ibarrier()

struct nm_coll_req_s * nm_coll_group_ibarrier ( nm_session_t  p_session,
nm_group_t  p_group,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

◆ nm_coll_group_igather()

struct nm_coll_req_s * nm_coll_group_igather ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_group_iscatter()

struct nm_coll_req_s * nm_coll_group_iscatter ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_group_scatter()

void nm_coll_group_scatter ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag 
)
extern

◆ nm_coll_group_wait()

void nm_coll_group_wait ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
nm_tag_t  tag 
)
extern

root waits for all nodes; equivalent to half-barrier or gather without data

◆ nm_coll_iallgather()

struct nm_coll_req_s * nm_coll_iallgather ( nm_comm_t  comm,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  p_ref 
)
extern

◆ nm_coll_ibarrier()

struct nm_coll_req_s * nm_coll_ibarrier ( nm_comm_t  p_comm,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

◆ nm_coll_ibcast()

struct nm_coll_req_s * nm_coll_ibcast ( nm_comm_t  p_comm,
int  root,
void *  buffer,
nm_len_t  len,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

generic ibcast on communicator with contiguous data, with automatic algorithm selection

◆ nm_coll_ibcast_pipeline()

struct nm_coll_req_s * nm_coll_ibcast_pipeline ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_data,
nm_tag_t  tag,
nm_len_t  block_size,
nm_coll_tree_kind_t  kind,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

ibcast with pipelined algorithm; for internal use

◆ nm_coll_ibcast_tree()

struct nm_coll_req_s * nm_coll_ibcast_tree ( nm_session_t  p_session,
nm_group_t  p_group,
int  root,
struct nm_data_s p_data,
nm_tag_t  tag,
nm_coll_tree_kind_t  kind,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

ibcast with tree algorithm; for internal use

◆ nm_coll_igather()

struct nm_coll_req_s * nm_coll_igather ( nm_comm_t  comm,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

◆ nm_coll_iscatter()

struct nm_coll_req_s * nm_coll_iscatter ( nm_comm_t  comm,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag,
nm_coll_req_notifier_t  p_notify,
void *  ref 
)
extern

◆ nm_coll_req_test()

int nm_coll_req_test ( struct nm_coll_req_s p_coll_req)
extern

◆ nm_coll_req_wait()

void nm_coll_req_wait ( struct nm_coll_req_s p_coll_req)
extern

◆ nm_coll_scatter()

void nm_coll_scatter ( nm_comm_t  comm,
int  root,
const void *  sbuf,
nm_len_t  slen,
void *  rbuf,
nm_len_t  rlen,
nm_tag_t  tag 
)
extern