Blame src/include/netloc_util.h

Packit Service c5cf8c
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
Packit Service c5cf8c
/*
Packit Service c5cf8c
 *  (C) 2001 by Argonne National Laboratory.
Packit Service c5cf8c
 *      See COPYRIGHT in top-level directory.
Packit Service c5cf8c
 *
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
#ifndef NETLOC_UTIL_H_INCLUDED
Packit Service c5cf8c
#define NETLOC_UTIL_H_INCLUDED
Packit Service c5cf8c
Packit Service c5cf8c
#include "netloc.h"
Packit Service c5cf8c
Packit Service c5cf8c
typedef enum {
Packit Service c5cf8c
    MPIR_NETLOC_NETWORK_TYPE__FAT_TREE,
Packit Service c5cf8c
    MPIR_NETLOC_NETWORK_TYPE__CLOS_NETWORK,
Packit Service c5cf8c
    MPIR_NETLOC_NETWORK_TYPE__TORUS,
Packit Service c5cf8c
    MPIR_NETLOC_NETWORK_TYPE__INVALID,
Packit Service c5cf8c
} MPIR_Netloc_network_topo_type;
Packit Service c5cf8c
Packit Service c5cf8c
typedef struct {
Packit Service c5cf8c
    MPIR_Netloc_network_topo_type type;
Packit Service c5cf8c
Packit Service c5cf8c
    union {
Packit Service c5cf8c
        struct {
Packit Service c5cf8c
            /* The levels at which the host and switch nodes are in
Packit Service c5cf8c
             * the network */
Packit Service c5cf8c
            int *node_levels;
Packit Service c5cf8c
        } tree;
Packit Service c5cf8c
        struct {
Packit Service c5cf8c
            int dimension;
Packit Service c5cf8c
            int *geometry;
Packit Service c5cf8c
            /* Flat index of the node the current
Packit Service c5cf8c
             * rank is mapped to */
Packit Service c5cf8c
            int node_idx;
Packit Service c5cf8c
        } torus;
Packit Service c5cf8c
    } u;
Packit Service c5cf8c
Packit Service c5cf8c
    netloc_node_t *network_endpoint;
Packit Service c5cf8c
} MPIR_Netloc_network_attributes;
Packit Service c5cf8c
Packit Service c5cf8c
int MPIR_Netloc_parse_topology(netloc_topology_t topology,
Packit Service c5cf8c
                               MPIR_Netloc_network_attributes * network_attr);
Packit Service c5cf8c
Packit Service c5cf8c
int MPIR_Netloc_get_network_end_point(MPIR_Netloc_network_attributes,
Packit Service c5cf8c
                                      netloc_topology_t netloc_topology,
Packit Service c5cf8c
                                      hwloc_topology_t hwloc_topology, netloc_node_t ** end_point);
Packit Service c5cf8c
Packit Service c5cf8c
int MPIR_Netloc_get_switches_at_level(netloc_topology_t netloc_topology,
Packit Service c5cf8c
                                      MPIR_Netloc_network_attributes attributes, int level,
Packit Service c5cf8c
                                      netloc_node_t *** switches_at_level, int *switch_count);
Packit Service c5cf8c
Packit Service c5cf8c
int MPIR_Netloc_get_hostnode_index_in_tree(MPIR_Netloc_network_attributes attributes,
Packit Service c5cf8c
                                           netloc_topology_t topology,
Packit Service c5cf8c
                                           netloc_node_t * network_endpoint,
Packit Service c5cf8c
                                           int *index, int *num_nodes);
Packit Service c5cf8c
Packit Service c5cf8c
#endif /* NETLOC_UTIL_H_INCLUDED */