Skip to content

Commit

Permalink
Remove inter-dependencies between OSC modules.
Browse files Browse the repository at this point in the history
The osc monitoring component needed to include other OSC components
header in order to be able tu access communicator through the
component specific ompi_osc_*_module_t structures. This commit remove
the dependency, and resolve the issue open-mpi#4523.

Extend the common monitoring API.

  * Now it's possible to translate from local rank to world rank from
    both the communicator and the group.
  * Remove useless hashtable as we directly use the w_group contained
    in window structure.

Add automatic generation at config time.

The templates are expanded at configure time. It creates a new header
file that generates all the variables/functions needed. Adding this
during the autogen automagicaly generates for each of the available
modules the proper functions.

Only keep a generated argv-style array.

Following Jeff's advice, the configure.m4 file generate a simple array
of module variables to be iterated over to find the proper module.

Signed-off-by: Clement Foyer <clement.foyer@inria.fr>
  • Loading branch information
clementFoyer committed Feb 15, 2018
1 parent b6e825f commit 614f583
Show file tree
Hide file tree
Showing 33 changed files with 305 additions and 245 deletions.
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_allgather.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -34,7 +34,7 @@ int mca_coll_monitoring_allgather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down Expand Up @@ -63,7 +63,7 @@ int mca_coll_monitoring_iallgather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_allgatherv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -34,7 +34,7 @@ int mca_coll_monitoring_allgatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down Expand Up @@ -63,7 +63,7 @@ int mca_coll_monitoring_iallgatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_allreduce.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -34,7 +34,7 @@ int mca_coll_monitoring_allreduce(const void *sbuf, void *rbuf, int count,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down Expand Up @@ -62,7 +62,7 @@ int mca_coll_monitoring_iallreduce(const void *sbuf, void *rbuf, int count,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_alltoall.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -32,7 +32,7 @@ int mca_coll_monitoring_alltoall(const void *sbuf, int scount, struct ompi_datat
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down Expand Up @@ -61,7 +61,7 @@ int mca_coll_monitoring_ialltoall(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_alltoallv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -33,7 +33,7 @@ int mca_coll_monitoring_alltoallv(const void *sbuf, const int *scounts, const in
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
data_size_aggreg += data_size;
}
Expand Down Expand Up @@ -65,7 +65,7 @@ int mca_coll_monitoring_ialltoallv(const void *sbuf, const int *scounts,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
data_size_aggreg += data_size;
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_alltoallw.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -35,7 +35,7 @@ int mca_coll_monitoring_alltoallw(const void *sbuf, const int *scounts,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
data_size_aggreg += data_size;
}
Expand Down Expand Up @@ -67,7 +67,7 @@ int mca_coll_monitoring_ialltoallw(const void *sbuf, const int *scounts,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
data_size_aggreg += data_size;
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_barrier.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -25,7 +25,7 @@ int mca_coll_monitoring_barrier(struct ompi_communicator_t *comm,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, 0);
}
}
Expand All @@ -47,7 +47,7 @@ int mca_coll_monitoring_ibarrier(struct ompi_communicator_t *comm,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, 0);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_bcast.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -35,7 +35,7 @@ int mca_coll_monitoring_bcast(void *buff, int count,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down Expand Up @@ -64,7 +64,7 @@ int mca_coll_monitoring_ibcast(void *buff, int count,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_exscan.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -33,7 +33,7 @@ int mca_coll_monitoring_exscan(const void *sbuf, void *rbuf, int count,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand All @@ -60,7 +60,7 @@ int mca_coll_monitoring_iexscan(const void *sbuf, void *rbuf, int count,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_gather.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -32,7 +32,7 @@ int mca_coll_monitoring_gather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down Expand Up @@ -61,7 +61,7 @@ int mca_coll_monitoring_igather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
}
}
Expand Down
6 changes: 3 additions & 3 deletions ompi/mca/coll/monitoring/coll_monitoring_gatherv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -34,7 +34,7 @@ int mca_coll_monitoring_gatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
data_size_aggreg += data_size;
}
Expand Down Expand Up @@ -66,7 +66,7 @@ int mca_coll_monitoring_igatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm, &rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
mca_common_monitoring_record_coll(rank, data_size);
data_size_aggreg += data_size;
}
Expand Down
10 changes: 5 additions & 5 deletions ompi/mca/coll/monitoring/coll_monitoring_neighbor_allgather.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -43,7 +43,7 @@ int mca_coll_monitoring_neighbor_allgather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand All @@ -54,7 +54,7 @@ int mca_coll_monitoring_neighbor_allgather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand Down Expand Up @@ -96,7 +96,7 @@ int mca_coll_monitoring_ineighbor_allgather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand All @@ -107,7 +107,7 @@ int mca_coll_monitoring_ineighbor_allgather(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand Down
10 changes: 5 additions & 5 deletions ompi/mca/coll/monitoring/coll_monitoring_neighbor_allgatherv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2017 Inria. All rights reserved.
* Copyright (c) 2016-2018 Inria. All rights reserved.
* Copyright (c) 2017 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -46,7 +46,7 @@ int mca_coll_monitoring_neighbor_allgatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand All @@ -57,7 +57,7 @@ int mca_coll_monitoring_neighbor_allgatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand Down Expand Up @@ -100,7 +100,7 @@ int mca_coll_monitoring_ineighbor_allgatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(srank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand All @@ -111,7 +111,7 @@ int mca_coll_monitoring_ineighbor_allgatherv(const void *sbuf, int scount,
* If this fails the destination is not part of my MPI_COM_WORLD
* Lookup its name in the rank hastable to get its MPI_COMM_WORLD rank
*/
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm, &world_rank) ) {
if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(drank, comm->c_remote_group, &world_rank) ) {
mca_common_monitoring_record_coll(world_rank, data_size);
data_size_aggreg += data_size;
}
Expand Down
Loading

0 comments on commit 614f583

Please sign in to comment.