Skip to content

Commit 18ac501

Browse files
committed
topo/example: updates for const and API changes
Signed-off-by: Jeff Squyres <[email protected]> (cherry picked from commit 4dea0fe)
1 parent af8f6a2 commit 18ac501

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

ompi/mca/topo/example/topo_example.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,15 @@ OBJ_CLASS_DECLARATION(mca_topo_example_module_t);
6666

6767
int mca_topo_example_cart_map(struct ompi_communicator_t *comm,
6868
int ndims,
69-
int *dims,
70-
int *periods,
69+
const int *dims,
70+
const int *periods,
7171
int *newrank);
7272

73+
7374
int mca_topo_example_graph_map(struct ompi_communicator_t *comm,
7475
int nnodes,
75-
int *index,
76-
int *edges,
76+
const int *index,
77+
const int *edges,
7778
int *newrank);
7879
/*
7980
* ******************************************************************

ompi/mca/topo/example/topo_example_cart_map.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141

4242
int mca_topo_example_cart_map (ompi_communicator_t* comm,
4343
int ndims,
44-
int *dims,
45-
int *periods,
44+
const int *dims,
45+
const int *periods,
4646
int *newrank)
4747
{
4848
int nprocs;
4949
int rank;
5050
int size;
5151
int i;
52-
int *p;
52+
const int *p;
5353

5454
/*
5555
* Compute the # of processes in the grid.

ompi/mca/topo/example/topo_example_component.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ const char *mca_topo_example_component_version_string =
3434
* Local functions
3535
*/
3636
static int init_query(bool enable_progress_threads, bool enable_mpi_threads);
37-
static struct mca_topo_base_module_t *
38-
comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type);
37+
static struct mca_topo_base_module_t *query(const ompi_communicator_t *comm, const ompi_group_t *group, int *priority, uint32_t type);
3938

4039
/*
4140
* Public component structure
@@ -57,7 +56,7 @@ mca_topo_base_component_2_2_0_t mca_topo_example_component =
5756
},
5857

5958
.topoc_init_query = init_query,
60-
.topoc_comm_query = comm_query,
59+
.topoc_query = query,
6160
};
6261
MCA_BASE_COMPONENT_INIT(ompi, topo, example)
6362

@@ -71,7 +70,7 @@ static int init_query(bool enable_progress_threads, bool enable_mpi_threads)
7170

7271

7372
static struct mca_topo_base_module_t *
74-
comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type)
73+
query(const ompi_communicator_t *comm, const ompi_group_t *group, int *priority, uint32_t type)
7574
{
7675
mca_topo_example_module_t *example = OBJ_NEW(mca_topo_example_module_t);
7776
if (NULL == example) {
@@ -88,5 +87,3 @@ comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type)
8887
example->super.type = type;
8988
return &(example->super);
9089
}
91-
92-

ompi/mca/topo/example/topo_example_graph_map.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040

4141
int mca_topo_example_graph_map (ompi_communicator_t* comm,
4242
int nnodes,
43-
int *index,
44-
int *edges,
43+
const int *index,
44+
const int *edges,
4545
int *newrank)
4646
{
4747
int myrank;

0 commit comments

Comments
 (0)