25 #ifndef OMPI_COMMUNICATOR_H
26 #define OMPI_COMMUNICATOR_H
28 #include "ompi_config.h"
42 #define OMPI_COMM_INTER 0x00000001
43 #define OMPI_COMM_CART 0x00000002
44 #define OMPI_COMM_GRAPH 0x00000004
45 #define OMPI_COMM_NAMEISSET 0x00000008
46 #define OMPI_COMM_ISFREED 0x00000010
47 #define OMPI_COMM_INTRINSIC 0x00000020
48 #define OMPI_COMM_DYNAMIC 0x00000040
49 #define OMPI_COMM_INVALID 0x00000080
50 #define OMPI_COMM_PML_ADDED 0x00000100
51 #define OMPI_COMM_EXTRA_RETAIN 0x00000200
54 #define OMPI_COMM_IS_INTER(comm) ((comm)->c_flags & OMPI_COMM_INTER)
55 #define OMPI_COMM_IS_INTRA(comm) (!((comm)->c_flags & OMPI_COMM_INTER))
56 #define OMPI_COMM_IS_CART(comm) ((comm)->c_flags & OMPI_COMM_CART)
57 #define OMPI_COMM_IS_GRAPH(comm) ((comm)->c_flags & OMPI_COMM_GRAPH)
58 #define OMPI_COMM_IS_INTRINSIC(comm) ((comm)->c_flags & OMPI_COMM_INTRINSIC)
59 #define OMPI_COMM_IS_FREED(comm) ((comm)->c_flags & OMPI_COMM_ISFREED)
60 #define OMPI_COMM_IS_DYNAMIC(comm) ((comm)->c_flags & OMPI_COMM_DYNAMIC)
61 #define OMPI_COMM_IS_INVALID(comm) ((comm)->c_flags & OMPI_COMM_INVALID)
62 #define OMPI_COMM_IS_PML_ADDED(comm) ((comm)->c_flags & OMPI_COMM_PML_ADDED)
63 #define OMPI_COMM_IS_EXTRA_RETAIN(comm) ((comm)->c_flags & OMPI_COMM_EXTRA_RETAIN)
65 #define OMPI_COMM_SET_DYNAMIC(comm) ((comm)->c_flags |= OMPI_COMM_DYNAMIC)
66 #define OMPI_COMM_SET_INVALID(comm) ((comm)->c_flags |= OMPI_COMM_INVALID)
68 #define OMPI_COMM_SET_PML_ADDED(comm) ((comm)->c_flags |= OMPI_COMM_PML_ADDED)
69 #define OMPI_COMM_SET_EXTRA_RETAIN(comm) ((comm)->c_flags |= OMPI_COMM_EXTRA_RETAIN)
75 #define OMPI_COMM_ALLGATHER_TAG -31078
76 #define OMPI_COMM_BARRIER_TAG -31079
77 #define OMPI_COMM_ALLREDUCE_TAG -31080
86 #define OMPI_COMM_CID_INTRA 0x00000020
87 #define OMPI_COMM_CID_INTER 0x00000040
88 #define OMPI_COMM_CID_INTRA_BRIDGE 0x00000080
89 #define OMPI_COMM_CID_INTRA_OOB 0x00000100
90 #if OPAL_ENABLE_FT_MPI
91 #define OMPI_COMM_CID_INTRA_FT 0x00000200
92 #define OMPI_COMM_CID_INTER_FT 0x00000400
93 #define OMPI_COMM_CID_INTRA_BRIDGE_FT 0x00000800
94 #define OMPI_COMM_CID_INTRA_OOB_FT 0x00001000
101 #define OMPI_COMM_BLOCK_WORLD 16
102 #define OMPI_COMM_BLOCK_OTHERS 8
105 #define OMPI_COMM_CID_IS_LOWER(comm1,comm2) ( ((comm1)->c_contextid < (comm2)->c_contextid)? 1:0)
108 #if OPAL_ENABLE_FT_MPI
122 char c_name[MPI_MAX_OBJECT_NAME];
123 uint32_t c_contextid;
130 int c_id_start_index;
165 #ifdef OMPI_WANT_PERUSE
185 #if OPAL_ENABLE_FT_MPI
187 bool any_source_enabled;
189 int any_source_offset;
193 bool collectives_force_error;
195 int num_active_local;
196 int num_active_remote;
264 #define PREDEFINED_COMMUNICATOR_PAD (sizeof(void*) * 128)
302 if ((NULL == comm) || (MPI_COMM_NULL == comm) ||
303 (OMPI_COMM_IS_FREED(comm)) || (OMPI_COMM_IS_INVALID(comm)) )
314 return comm->c_my_rank;
331 return (comm->c_flags & OMPI_COMM_INTER ? comm->c_remote_group->
grp_proc_count : 0);
340 return comm->c_contextid;
353 #if OPAL_ENABLE_DEBUG
355 opal_output(0,
"ompi_comm_peer_lookup: invalid peer index (%d)", peer_id);
369 #if OPAL_ENABLE_DEBUG
371 opal_output(0,
"ompi_comm_peer_lookup_id: invalid ompi_proc (NULL)");
378 #if OPAL_ENABLE_FT_MPI
379 #define OMPI_COMM_SET_FT(COMM, NPROCS, EPOCH) \
381 (COMM)->any_source_enabled = true; \
382 (COMM)->any_source_offset = 0; \
383 (COMM)->comm_revoked = false; \
384 (COMM)->collectives_force_error = false; \
385 (COMM)->num_active_local = (NPROCS); \
386 (COMM)->num_active_remote = (NPROCS); \
387 (COMM)->lleader = 0; \
388 (COMM)->rleader = 0; \
389 (COMM)->epoch = (EPOCH); \
397 return (comm->any_source_enabled);
405 return (comm->collectives_force_error);
413 return (comm->comm_revoked);
431 OMPI_DECLSPEC
int ompi_comm_init_revoke(
void);
432 OMPI_DECLSPEC
int ompi_comm_finalize_revoke(
void);
449 return (comm->num_active_local);
453 return (comm->num_active_remote);
459 OMPI_DECLSPEC
bool ompi_comm_is_proc_active(
ompi_communicator_t *comm,
int peer_id,
bool remote);
464 OMPI_DECLSPEC
int ompi_comm_set_rank_failed(
ompi_communicator_t *comm,
int peer_id,
bool remote);
469 static inline bool ompi_comm_iface_p2p_check_proc(
ompi_communicator_t *comm,
int peer_id,
int *err)
471 if( ompi_comm_is_revoked(comm) ) {
472 *err = MPI_ERR_REVOKED;
475 else if( !ompi_comm_is_proc_active(comm, peer_id, OMPI_COMM_IS_INTRA(comm)) ) {
476 *err = MPI_ERR_PROC_FAILED;
484 if( ompi_comm_is_revoked(comm) ) {
485 *err = MPI_ERR_REVOKED;
488 else if( ompi_comm_force_error_on_collectives(comm) ) {
489 *err = MPI_ERR_PROC_FAILED;
497 return ompi_comm_iface_coll_check(comm, err);
504 int ompi_comm_allreduce_intra_ft(
int *inbuf,
int *outbuf,
511 int ompi_comm_allreduce_inter_ft(
int *inbuf,
int *outbuf,
518 int ompi_comm_allreduce_intra_bridge_ft(
int *inbuf,
int *outbuf,
522 void* lleader,
void* rleader,
524 int ompi_comm_allreduce_intra_oob_ft(
int *inbuf,
int *outbuf,
528 void* lleader,
void* rleader,
531 #define OMPI_COMM_SET_FT(COMM, NPROCS, EPOCH)
536 if(peer_id < 0 || peer_id >= comm->c_remote_group->
grp_proc_count) {
546 int ompi_comm_init(
void);
547 OMPI_DECLSPEC
int ompi_comm_link_function(
void);
567 int *periods_or_edges,
596 int split_type,
int key,
633 int remote_group_size);
665 int ompi_comm_finalize (
void);
698 int ompi_comm_overlapping_groups (
int size,
struct ompi_proc_t ** lprocs,
732 void ompi_comm_reg_init(
void);
733 void ompi_comm_reg_finalize(
void);
736 extern int ompi_comm_num_dyncomm;
744 OMPI_DECLSPEC
int ompi_comm_cid_init (
void );
Definition: opal_hash_table.h:42
Common type for all MCA components.
Definition: mca.h:250
dynamic pointer array
Definition: opal_pointer_array.h:45
Back-end type for MPI_Errorhandler.
Definition: errhandler.h:108
Definition: peruse-internal.h:30
Cached on ompi_communicator_t to hold queues/state used by the PML<->PTL interface for matching logic...
Definition: pml_bfo_comm.h:51
Definition: mutex_unix.h:53
static void * opal_pointer_array_get_item(opal_pointer_array_t *table, int element_index)
Get the value of an element in array.
Definition: opal_pointer_array.h:125
struct mca_topo_base_comm_1_0_0_t * c_topo_comm
structure containing basic information about the topology
Definition: communicator.h:155
int grp_proc_count
number of processes in group
Definition: group.h:81
Process identification structure interface.
Remote Open MPI process structure.
Definition: proc.h:56
Definition: communicator.h:266
OMPI_DECLSPEC int ompi_group_peer_lookup_id(ompi_group_t *group, ompi_proc_t *proc)
Determine the rank of the specified process in this group.
Definition: group_plist.c:305
Collective Communication Interface.
const struct mca_topo_base_module_1_0_0_t * c_topo
structure of function pointers
Definition: communicator.h:152
OPAL_DECLSPEC void opal_output(int output_id, const char *format,...) __opal_attribute_format__(__printf__
Main function to send output to a stream.
static struct ompi_proc_t * ompi_group_peer_lookup(ompi_group_t *group, int peer_id)
Inline function to check if sparse groups are enabled and return the direct access to the proc pointe...
Definition: group.h:333
Group structure Currently we have four formats for storing the process pointers that are members of t...
Definition: group.h:79
Base object.
Definition: opal_object.h:182
struct mca_topo_base_module_comm_t * c_topo_module
module specific data
Definition: communicator.h:158
Infrastructure for MPI group support.
Mutual exclusion functions.
A simple C-language object-oriented system with single inheritance and ownership-based memory managem...
Definition: communicator.h:118
int epoch
Identifier used to keep trace of the communicators revoked.
Definition: communicator.h:132
struct opal_hash_table_t * c_keyhash
inscribing cube dimension
Definition: communicator.h:144
Back-end type of MPI_Op.
Definition: op.h:100
Collectives communicator cache structure.
Definition: coll.h:367
ompi_errhandler_type_t
Enum used to describe what kind MPI object an error handler is used for.
Definition: errhandler.h:84
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236