This source file includes following definitions.
- mca_coll_monitoring_reduce
- mca_coll_monitoring_ireduce
1
2
3
4
5
6
7
8
9
10 #include <ompi_config.h>
11 #include <ompi/op/op.h>
12 #include <ompi/request/request.h>
13 #include <ompi/datatype/ompi_datatype.h>
14 #include <ompi/communicator/communicator.h>
15 #include "coll_monitoring.h"
16
17 int mca_coll_monitoring_reduce(const void *sbuf, void *rbuf, int count,
18 struct ompi_datatype_t *dtype,
19 struct ompi_op_t *op,
20 int root,
21 struct ompi_communicator_t *comm,
22 mca_coll_base_module_t *module)
23 {
24 mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
25 if( root == ompi_comm_rank(comm) ) {
26 int i, rank;
27 size_t type_size, data_size;
28 const int comm_size = ompi_comm_size(comm);
29 ompi_datatype_type_size(dtype, &type_size);
30 data_size = count * type_size;
31 for( i = 0; i < comm_size; ++i ) {
32 if( root == i ) continue;
33
34
35
36
37 if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
38 mca_common_monitoring_record_coll(rank, data_size);
39 }
40 }
41 mca_common_monitoring_coll_a2o(data_size * (comm_size - 1), monitoring_module->data);
42 }
43 return monitoring_module->real.coll_reduce(sbuf, rbuf, count, dtype, op, root, comm, monitoring_module->real.coll_reduce_module);
44 }
45
46 int mca_coll_monitoring_ireduce(const void *sbuf, void *rbuf, int count,
47 struct ompi_datatype_t *dtype,
48 struct ompi_op_t *op,
49 int root,
50 struct ompi_communicator_t *comm,
51 ompi_request_t ** request,
52 mca_coll_base_module_t *module)
53 {
54 mca_coll_monitoring_module_t*monitoring_module = (mca_coll_monitoring_module_t*) module;
55 if( root == ompi_comm_rank(comm) ) {
56 int i, rank;
57 size_t type_size, data_size;
58 const int comm_size = ompi_comm_size(comm);
59 ompi_datatype_type_size(dtype, &type_size);
60 data_size = count * type_size;
61 for( i = 0; i < comm_size; ++i ) {
62 if( root == i ) continue;
63
64
65
66
67 if( OPAL_SUCCESS == mca_common_monitoring_get_world_rank(i, comm->c_remote_group, &rank) ) {
68 mca_common_monitoring_record_coll(rank, data_size);
69 }
70 }
71 mca_common_monitoring_coll_a2o(data_size * (comm_size - 1), monitoring_module->data);
72 }
73 return monitoring_module->real.coll_ireduce(sbuf, rbuf, count, dtype, op, root, comm, request, monitoring_module->real.coll_ireduce_module);
74 }