int MPIR_T_pvar_read_impl(MPI_T_pvar_session session, MPI_T_pvar_handle handle, void *buf) { int mpi_errno = MPI_SUCCESS; /* the extra indirection through "info" might be too costly for some tools, * consider moving this value to or caching it in the handle itself */ if (likely(handle->info->impl_kind == MPIR_T_PVAR_IMPL_SIMPLE)) { MPIU_Memcpy(buf, handle->handle_state, handle->count * handle->bytes); } else { MPIU_Assertp(FALSE); /* _IMPL_CB not yet implemented */ } fn_exit: return mpi_errno; fn_fail: goto fn_exit; }
static int init_default_collops(void) { int mpi_errno = MPI_SUCCESS; int i; struct MPID_Collops *ops = NULL; MPIU_CHKPMEM_DECL(MPID_HIERARCHY_SIZE + 1); /* first initialize the intracomms */ for (i = 0; i < MPID_HIERARCHY_SIZE; ++i) { MPIU_CHKPMEM_CALLOC(ops, struct MPID_Collops *, sizeof(struct MPID_Collops), mpi_errno, "default intracomm collops"); ops->ref_count = 1; /* force existence until finalize time */ /* intracomm default defaults... */ ops->Ibcast_sched = &MPIR_Ibcast_intra; ops->Ibarrier_sched = &MPIR_Ibarrier_intra; ops->Ireduce_sched = &MPIR_Ireduce_intra; ops->Ialltoall_sched = &MPIR_Ialltoall_intra; ops->Ialltoallv_sched = &MPIR_Ialltoallv_intra; ops->Ialltoallw_sched = &MPIR_Ialltoallw_intra; ops->Iallreduce_sched = &MPIR_Iallreduce_intra; ops->Igather_sched = &MPIR_Igather_intra; ops->Igatherv_sched = &MPIR_Igatherv; ops->Iscatter_sched = &MPIR_Iscatter_intra; ops->Iscatterv_sched = &MPIR_Iscatterv; ops->Ireduce_scatter_sched = &MPIR_Ireduce_scatter_intra; ops->Ireduce_scatter_block_sched = &MPIR_Ireduce_scatter_block_intra; ops->Iallgather_sched = &MPIR_Iallgather_intra; ops->Iallgatherv_sched = &MPIR_Iallgatherv_intra; ops->Iscan_sched = &MPIR_Iscan_rec_dbl; ops->Iexscan_sched = &MPIR_Iexscan; ops->Neighbor_allgather = &MPIR_Neighbor_allgather_default; ops->Neighbor_allgatherv = &MPIR_Neighbor_allgatherv_default; ops->Neighbor_alltoall = &MPIR_Neighbor_alltoall_default; ops->Neighbor_alltoallv = &MPIR_Neighbor_alltoallv_default; ops->Neighbor_alltoallw = &MPIR_Neighbor_alltoallw_default; ops->Ineighbor_allgather = &MPIR_Ineighbor_allgather_default; ops->Ineighbor_allgatherv = &MPIR_Ineighbor_allgatherv_default; ops->Ineighbor_alltoall = &MPIR_Ineighbor_alltoall_default; ops->Ineighbor_alltoallv = &MPIR_Ineighbor_alltoallv_default; ops->Ineighbor_alltoallw = &MPIR_Ineighbor_alltoallw_default; /* override defaults, such as for SMP */ switch (i) { case MPID_HIERARCHY_FLAT: break; case MPID_HIERARCHY_PARENT: ops->Ibcast_sched = &MPIR_Ibcast_SMP; ops->Iscan_sched = &MPIR_Iscan_SMP; ops->Iallreduce_sched = &MPIR_Iallreduce_SMP; ops->Ireduce_sched = &MPIR_Ireduce_SMP; break; case MPID_HIERARCHY_NODE: break; case MPID_HIERARCHY_NODE_ROOTS: break; /* --BEGIN ERROR HANDLING-- */ default: MPIU_Assertp(FALSE); break; /* --END ERROR HANDLING-- */ } /* this is a default table, it's not overriding another table */ ops->prev_coll_fns = NULL; default_collops[i] = ops; } /* now the intercomm table */ { MPIU_CHKPMEM_CALLOC(ops, struct MPID_Collops *, sizeof(struct MPID_Collops), mpi_errno, "default intercomm collops"); ops->ref_count = 1; /* force existence until finalize time */ /* intercomm defaults */ ops->Ibcast_sched = &MPIR_Ibcast_inter; ops->Ibarrier_sched = &MPIR_Ibarrier_inter; ops->Ireduce_sched = &MPIR_Ireduce_inter; ops->Ialltoall_sched = &MPIR_Ialltoall_inter; ops->Ialltoallv_sched = &MPIR_Ialltoallv_inter; ops->Ialltoallw_sched = &MPIR_Ialltoallw_inter; ops->Iallreduce_sched = &MPIR_Iallreduce_inter; ops->Igather_sched = &MPIR_Igather_inter; ops->Igatherv_sched = &MPIR_Igatherv; ops->Iscatter_sched = &MPIR_Iscatter_inter; ops->Iscatterv_sched = &MPIR_Iscatterv; ops->Ireduce_scatter_sched = &MPIR_Ireduce_scatter_inter; ops->Ireduce_scatter_block_sched = &MPIR_Ireduce_scatter_block_inter; ops->Iallgather_sched = &MPIR_Iallgather_inter; ops->Iallgatherv_sched = &MPIR_Iallgatherv_inter; /* scan and exscan are not valid for intercommunicators, leave them NULL */ /* Ineighbor_all* routines are not valid for intercommunicators, leave * them NULL */ /* this is a default table, it's not overriding another table */ ops->prev_coll_fns = NULL; ic_default_collops = ops; } /* run after MPID_Finalize to permit collective usage during finalize */ MPIR_Add_finalize(cleanup_default_collops, NULL, MPIR_FINALIZE_CALLBACK_PRIO - 1); MPIU_CHKPMEM_COMMIT(); fn_exit: return mpi_errno; /* --BEGIN ERROR HANDLING-- */ fn_fail: MPIU_CHKPMEM_REAP(); goto fn_exit; /* --END ERROR HANDLING-- */ }
int MPID_nem_ptl_probe(MPIDI_VC_t *vc, int source, int tag, MPID_Comm *comm, int context_offset, MPI_Status *status) { MPIU_Assertp(0 && "This function shouldn't be called."); return MPI_SUCCESS; }