1 /* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
7 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
8 * University Research and Technology
9 * Corporation. All rights reserved.
10 * Copyright (c) 2004-2005 The University of Tennessee and The University
11 * of Tennessee Research Foundation. All rights
13 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
14 * University of Stuttgart. All rights reserved.
15 * Copyright (c) 2004-2005 The Regents of the University of California.
16 * All rights reserved.
18 * Additional copyrights may follow
21 #ifndef MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
22 #define MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
24 #include "colls_private.h"
26 #define MAXTREEFANOUT 32
28 #define COLL_TUNED_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT) \
29 if( ((SEGSIZE) >= (TYPELNG)) && \
30 ((SEGSIZE) < ((TYPELNG) * (SEGCOUNT))) ) { \
32 (SEGCOUNT) = (int)((SEGSIZE) / (TYPELNG)); \
33 residual = (SEGSIZE) - (SEGCOUNT) * (TYPELNG); \
34 if( residual > ((TYPELNG) >> 1) ) \
39 typedef struct ompi_coll_tree_t {
44 int32_t tree_next[MAXTREEFANOUT];
45 int32_t tree_nextsize;
49 ompi_coll_tuned_topo_build_tree( int fanout,
53 ompi_coll_tuned_topo_build_in_order_bintree( MPI_Comm comm );
56 ompi_coll_tuned_topo_build_bmtree( MPI_Comm comm,
58 ompi_coll_tree_t* ompi_coll_tuned_topo_build_in_order_bmtree(MPI_Comm comm, int root);
60 ompi_coll_tuned_topo_build_chain( int fanout,
64 int ompi_coll_tuned_topo_destroy_tree( ompi_coll_tree_t** tree );
66 /* debugging stuff, will be removed later */
67 int ompi_coll_tuned_topo_dump_tree (ompi_coll_tree_t* tree, int rank);
69 #endif /* MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED */