File: coll_tuned_dynamic_rules.h

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 (104 lines) | stat: -rw-r--r-- 3,723 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

/*
 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
 *                         University Research and Technology
 *                         Corporation.  All rights reserved.
 * Copyright (c) 2004-2005 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * Copyright (c) 2011-2012 FUJITSU LIMITED.  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef MCA_COLL_TUNED_DYNAMIC_RULES_H_HAS_BEEN_INCLUDED
#define MCA_COLL_TUNED_DYNAMIC_RULES_H_HAS_BEEN_INCLUDED

#include "ompi_config.h"

BEGIN_C_DECLS


typedef struct msg_rule_s {
    /* paranoid / debug */
    int mpi_comsize;  /* which MPI comm size is this for */

    /* paranoid / debug */
    int alg_rule_id; /* unique alg rule id */
    int com_rule_id; /* unique com rule id */
    int msg_rule_id; /* unique msg rule id */

    /* RULE */
    size_t msg_size; /* message size */

    /* RESULT */
    int result_alg;              /* result algorithm to use */
    int result_topo_faninout;    /* result topology fan in/out to use (if applicable) */
    long result_segsize;         /* result segment size to use */
    int result_max_requests;     /* maximum number of outstanding requests (if applicable) */
} ompi_coll_msg_rule_t;


typedef struct com_rule_s {
    /* paranoid / debug */
    int mpi_comsize;  /* which MPI comm size is this for */

    /* paranoid / debug */
    int alg_rule_id; /* unique alg rule id */
    int com_rule_id; /* unique com rule id */

    /* RULE */
    int n_msg_sizes;
    ompi_coll_msg_rule_t *msg_rules;

}  ompi_coll_com_rule_t;


typedef struct alg_rule_s {
    /* paranoid / debug */
    int alg_rule_id; /* unique alg rule id */

    /* RULE */
    int n_com_sizes;
    ompi_coll_com_rule_t *com_rules;

} ompi_coll_alg_rule_t;

/* function prototypes */

/* these are used to build the rule tables (by the read file routines) */
ompi_coll_alg_rule_t* ompi_coll_tuned_mk_alg_rules (int n_alg);
ompi_coll_com_rule_t* ompi_coll_tuned_mk_com_rules (int n_com_rules, int alg_rule_id);
ompi_coll_msg_rule_t* ompi_coll_tuned_mk_msg_rules (int n_msg_rules, int alg_rule_id, int com_rule_id, int mpi_comsize);

/* debugging support */
int ompi_coll_tuned_dump_msg_rule (ompi_coll_msg_rule_t* msg_p);
int ompi_coll_tuned_dump_com_rule (ompi_coll_com_rule_t* com_p);
int ompi_coll_tuned_dump_alg_rule (ompi_coll_alg_rule_t* alg_p);
int ompi_coll_tuned_dump_all_rules (ompi_coll_alg_rule_t* alg_p, int n_rules);

/* free alloced memory routines, used by file and tuned component/module */
int ompi_coll_tuned_free_msg_rules_in_com_rule (ompi_coll_com_rule_t* com_p);
int ompi_coll_tuned_free_coms_in_alg_rule (ompi_coll_alg_rule_t* alg_p);
int ompi_coll_tuned_free_all_rules (ompi_coll_alg_rule_t* alg_p, int n_algs);


/* the IMPORTANT routines, i.e. the ones that do stuff for everyday communicators and collective calls */

ompi_coll_com_rule_t* ompi_coll_tuned_get_com_rule_ptr (ompi_coll_alg_rule_t* rules, int alg_id, int mpi_comsize);

int ompi_coll_tuned_get_target_method_params (ompi_coll_com_rule_t* base_com_rule, size_t mpi_msgsize,
                                              int* result_topo_faninout, int* result_segsize,
                                              int* max_requests);


END_C_DECLS
#endif /* MCA_COLL_TUNED_DYNAMIC_RULES_H_HAS_BEEN_INCLUDED */