int ompi_coll_tuned_bcast_intra_do_this(void *buf, int count, struct ompi_datatype_t *dtype, int root, struct ompi_communicator_t *comm, mca_coll_base_module_t *module, int algorithm, int faninout, int segsize) { OPAL_OUTPUT((ompi_coll_tuned_stream,"coll:tuned:bcast_intra_do_this algorithm %d topo faninout %d segsize %d", algorithm, faninout, segsize)); switch (algorithm) { case (0): return ompi_coll_tuned_bcast_intra_dec_fixed( buf, count, dtype, root, comm, module ); case (1): return ompi_coll_base_bcast_intra_basic_linear( buf, count, dtype, root, comm, module ); case (2): return ompi_coll_base_bcast_intra_chain( buf, count, dtype, root, comm, module, segsize, faninout ); case (3): return ompi_coll_base_bcast_intra_pipeline( buf, count, dtype, root, comm, module, segsize ); case (4): return ompi_coll_base_bcast_intra_split_bintree( buf, count, dtype, root, comm, module, segsize ); case (5): return ompi_coll_base_bcast_intra_bintree( buf, count, dtype, root, comm, module, segsize ); case (6): return ompi_coll_base_bcast_intra_binomial( buf, count, dtype, root, comm, module, segsize ); } /* switch */ OPAL_OUTPUT((ompi_coll_tuned_stream,"coll:tuned:bcast_intra_do_this attempt to select algorithm %d when only 0-%d is valid?", algorithm, ompi_coll_tuned_forced_max_algorithms[BCAST])); return (MPI_ERR_ARG); }
/* * bcast_intra_dec * * Function: - seletects broadcast algorithm to use * Accepts: - same arguments as MPI_Bcast() * Returns: - MPI_SUCCESS or error code (passed from the bcast implementation) */ int ompi_coll_tuned_bcast_intra_dec_dynamic(void *buf, int count, struct ompi_datatype_t *dtype, int root, struct ompi_communicator_t *comm, mca_coll_base_module_t *module) { mca_coll_tuned_module_t *tuned_module = (mca_coll_tuned_module_t*) module; OPAL_OUTPUT((ompi_coll_tuned_stream, "coll:tuned:bcast_intra_dec_dynamic")); /* check to see if we have some filebased rules */ if (tuned_module->com_rules[BCAST]) { /* we do, so calc the message size or what ever we need and use this for the evaluation */ int alg, faninout, segsize, ignoreme; size_t dsize; ompi_datatype_type_size (dtype, &dsize); dsize *= count; alg = ompi_coll_tuned_get_target_method_params (tuned_module->com_rules[BCAST], dsize, &faninout, &segsize, &ignoreme); if (alg) { /* we have found a valid choice from the file based rules for this message size */ return ompi_coll_tuned_bcast_intra_do_this (buf, count, dtype, root, comm, module, alg, faninout, segsize); } /* found a method */ } /*end if any com rules to check */ if (tuned_module->user_forced[BCAST].algorithm) { return ompi_coll_tuned_bcast_intra_do_this(buf, count, dtype, root, comm, module, tuned_module->user_forced[BCAST].algorithm, tuned_module->user_forced[BCAST].chain_fanout, tuned_module->user_forced[BCAST].segsize); } return ompi_coll_tuned_bcast_intra_dec_fixed (buf, count, dtype, root, comm, module); }
int ompi_coll_tuned_bcast_intra_do_forced(void *buf, int count, struct ompi_datatype_t *dtype, int root, struct ompi_communicator_t *comm, mca_coll_base_module_t *module) { mca_coll_tuned_module_t *tuned_module = (mca_coll_tuned_module_t*) module; mca_coll_tuned_comm_t *data = tuned_module->tuned_data; OPAL_OUTPUT((ompi_coll_tuned_stream,"coll:tuned:bcast_intra_do_forced algorithm %d", data->user_forced[BCAST].algorithm)); switch (data->user_forced[BCAST].algorithm) { case (0): return ompi_coll_tuned_bcast_intra_dec_fixed( buf, count, dtype, root, comm, module ); case (1): return ompi_coll_tuned_bcast_intra_basic_linear( buf, count, dtype, root, comm, module ); case (2): return ompi_coll_tuned_bcast_intra_chain( buf, count, dtype, root, comm, module, data->user_forced[BCAST].segsize, data->user_forced[BCAST].chain_fanout ); case (3): return ompi_coll_tuned_bcast_intra_pipeline( buf, count, dtype, root, comm, module, data->user_forced[BCAST].segsize ); case (4): return ompi_coll_tuned_bcast_intra_split_bintree( buf, count, dtype, root, comm, module, data->user_forced[BCAST].segsize ); case (5): return ompi_coll_tuned_bcast_intra_bintree( buf, count, dtype, root, comm, module, data->user_forced[BCAST].segsize ); case (6): return ompi_coll_tuned_bcast_intra_binomial( buf, count, dtype, root, comm, module, data->user_forced[BCAST].segsize ); default: OPAL_OUTPUT((ompi_coll_tuned_stream,"coll:tuned:bcast_intra_do_forced attempt to select algorithm %d when only 0-%d is valid?", data->user_forced[BCAST].algorithm, ompi_coll_tuned_forced_max_algorithms[BCAST])); } /* switch */ return (MPI_ERR_ARG); }