File: pml_monitoring_start.c

package info (click to toggle)
openmpi 5.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 202,312 kB
  • sloc: ansic: 612,441; makefile: 42,495; sh: 11,230; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,154; python: 1,856; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (53 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (c) 2013-2015 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2013-2018 Inria.  All rights reserved.
 * Copyright (c) 2019      Research Organization for Information Science
 *                         and Technology (RIST).  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#include "ompi_config.h"
#include "pml_monitoring.h"
#include "ompi/mca/pml/base/pml_base_request.h"

/* manage persistent requests*/
int mca_pml_monitoring_start(size_t count,
                             ompi_request_t** requests)
{
    size_t i;

    for( i = 0; i < count; i++ ) {
        mca_pml_base_request_t *pml_request = (mca_pml_base_request_t*)requests[i];
        int world_rank;

        if(NULL == pml_request) {
            continue;
        }
        if(OMPI_REQUEST_PML != requests[i]->req_type) {
            continue;
        }
        if(MCA_PML_REQUEST_SEND != pml_request->req_type) {
            continue;
        }

        /**
         * If this fails the destination is not part of my MPI_COM_WORLD
         */
        if(OPAL_SUCCESS == mca_common_monitoring_get_world_rank(pml_request->req_peer,
                                                                pml_request->req_comm->c_remote_group,
								&world_rank)) {
            size_t type_size, data_size;
            ompi_datatype_type_size(pml_request->req_datatype, &type_size);
            data_size = pml_request->req_count * type_size;
            mca_common_monitoring_record_pml(world_rank, data_size, 1);
        }
    }
    return pml_selected_module.pml_start(count, requests);
}