1 /* Copyright (c) 2013-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
9 * University Research and Technology
10 * Corporation. All rights reserved.
11 * Copyright (c) 2004-2005 The University of Tennessee and The University
12 * of Tennessee Research Foundation. All rights
14 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
15 * University of Stuttgart. All rights reserved.
16 * Copyright (c) 2004-2005 The Regents of the University of California.
17 * All rights reserved.
19 * Additional copyrights may follow
22 #ifndef MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
23 #define MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED
25 #include "colls_private.h"
27 #define MAXTREEFANOUT 32
29 #define COLL_TUNED_COMPUTED_SEGCOUNT(SEGSIZE, TYPELNG, SEGCOUNT) \
30 if( ((SEGSIZE) >= (TYPELNG)) && \
31 ((SEGSIZE) < ((TYPELNG) * (SEGCOUNT))) ) { \
33 (SEGCOUNT) = (int)((SEGSIZE) / (TYPELNG)); \
34 residual = (SEGSIZE) - (SEGCOUNT) * (TYPELNG); \
35 if( residual > ((TYPELNG) >> 1) ) \
40 typedef struct ompi_coll_tree_t {
45 int32_t tree_next[MAXTREEFANOUT];
46 int32_t tree_nextsize;
50 ompi_coll_tuned_topo_build_tree( int fanout,
54 ompi_coll_tuned_topo_build_in_order_bintree( MPI_Comm comm );
57 ompi_coll_tuned_topo_build_bmtree( MPI_Comm comm,
60 ompi_coll_tuned_topo_build_in_order_bmtree( MPI_Comm comm,
63 ompi_coll_tuned_topo_build_chain( int fanout,
67 int ompi_coll_tuned_topo_destroy_tree( ompi_coll_tree_t** tree );
69 /* debugging stuff, will be removed later */
70 int ompi_coll_tuned_topo_dump_tree (ompi_coll_tree_t* tree, int rank);
72 #endif /* MCA_COLL_TUNED_TOPO_H_HAS_BEEN_INCLUDED */