2
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3
* University Research and Technology
4
* Corporation. All rights reserved.
5
* Copyright (c) 2004-2005 The University of Tennessee and The University
6
* of Tennessee Research Foundation. All rights
8
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9
* University of Stuttgart. All rights reserved.
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
* All rights reserved.
14
* Additional copyrights may follow
18
* These symbols are in a file by themselves to provide nice linker
19
* semantics. Since linkers generally pull in symbols by object fules,
20
* keeping these symbols as the only symbols in this file prevents
21
* utility programs such as "ompi_info" from having to import entire
22
* modules just to query their version and parameters
24
#include "ompi_config.h"
30
#include "ompi/communicator/communicator.h"
31
#include "ompi/mca/topo/topo.h"
32
#include "ompi/mca/topo/base/base.h"
33
#include "ompi/mca/topo/unity/topo_unity.h"
36
* *******************************************************************
37
* ************************ actions structure ************************
38
* *******************************************************************
40
static mca_topo_base_module_1_0_0_t unity = {
41
mca_topo_unity_module_init, /* initalise after being selected */
42
mca_topo_unity_module_finalize, /* close a module on a communicator */
43
NULL, /* topo_cart_coords */
44
NULL, /* topo_cart_create */
45
NULL, /* topo_cart_get */
46
NULL, /* topo_cartdim_get */
47
mca_topo_unity_cart_map,
48
NULL, /* topo_cart_rank */
49
NULL, /* topo_cart_shift */
50
NULL, /* topo_cart_sub */
51
NULL, /* topo_graph_create */
52
NULL, /* topo_graph_get */
53
mca_topo_unity_graph_map,
54
NULL, /* topo_graphdims_get */
55
NULL, /* topo_graph_neighbors */
56
NULL /* topo_graph_neighbors_count */
59
* *******************************************************************
60
* ************************* structure ends **************************
61
* *******************************************************************
64
int mca_topo_unity_component_init_query(bool enable_progress_threads,
65
bool enable_mpi_threads)
72
struct mca_topo_base_module_1_0_0_t *
73
mca_topo_unity_component_comm_query (int *priority)
75
/* this is the lowest module on the totem pole */
78
/* the check as to whether this is an inter communicator
79
* or and intra communicator has to be done before reaching
80
* here. this is my solemn opinion. Therefore I am ignoring
85
int mca_topo_unity_component_comm_unquery (struct ompi_communicator_t *comm)
87
/* This function might be needed for some purposes later. for now it
88
* does not have anything to do since there are no steps which need
89
* to be undone if this module is not selected */
94
int mca_topo_unity_module_init (struct ompi_communicator_t *comm)
96
/* This function is used to initialize the module on the communicator. We
97
* need to hang the data off of the communicator. For this we still use the
98
* same data structure which was defined in topo.h, mca_topo_comm_1_0_0_t.
99
* There are no additional things which we need. If some other module needs
100
* to hang additional data, then it has to have this structure as the first
101
* member and then extend. This is a must rule */
103
struct mca_topo_base_comm_1_0_0_t *topo_data;
105
/* allocate the data */
107
comm->c_topo_comm = NULL;
108
topo_data = malloc(sizeof(struct mca_topo_base_comm_1_0_0_t));
109
if (NULL == topo_data) {
113
comm->c_topo_comm = topo_data;
118
int mca_topo_unity_module_finalize (struct ompi_communicator_t *comm)
120
/* All we need to do for now is to remove the allocated data */
122
if (NULL != comm->c_topo_comm) {
123
free (comm->c_topo_comm);