OpenMPI  0.1.1
base.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2005 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * $COPYRIGHT$
13  *
14  * Additional copyrights may follow
15  *
16  * $HEADER$
17  */
18 /** @file:
19  */
20 
21 #ifndef MCA_GRPCOMM_BASE_H
22 #define MCA_GRPCOMM_BASE_H
23 
24 /*
25  * includes
26  */
27 #include "orte_config.h"
28 
29 #include "opal/class/opal_list.h"
30 #include "opal/mca/mca.h"
31 #include "opal/threads/mutex.h"
32 #include "opal/threads/condition.h"
33 #include "opal/mca/hwloc/hwloc.h"
34 
36 
38 
39 
40 /*
41  * Global functions for MCA overall collective open and close
42  */
43 BEGIN_C_DECLS
44 
45 /*
46  * function definitions
47  */
48 ORTE_DECLSPEC int orte_grpcomm_base_open(void);
49 ORTE_DECLSPEC int orte_grpcomm_base_select(void);
50 ORTE_DECLSPEC int orte_grpcomm_base_close(void);
51 
52 /* daemon collective function */
53 typedef void (*orte_grpcomm_daemon_collective_fn_t)(orte_process_name_t *sender,
54  opal_buffer_t *data);
55 /*
56  * globals that might be needed
57  */
58 typedef struct {
59  int output;
60  bool selected;
61  opal_list_t components_available;
62  orte_grpcomm_base_component_t selected_component;
63  orte_grpcomm_daemon_collective_fn_t daemon_coll;
64 #if OPAL_HAVE_HWLOC
65  hwloc_cpuset_t working_cpuset;
66 #endif
68 
69 ORTE_DECLSPEC extern orte_grpcomm_base_t orte_grpcomm_base;
70 
71 /* structure for tracking collective operations */
72 typedef struct {
73  opal_object_t super;
74  opal_mutex_t lock;
75  opal_condition_t cond;
76  orte_vpid_t recvd;
77  opal_buffer_t results;
80 
81 /*
82  * Base functions
83  */
84 ORTE_DECLSPEC int orte_grpcomm_base_allgather_list(opal_list_t *names,
85  opal_buffer_t *sbuf,
86  opal_buffer_t *rbuf);
87 ORTE_DECLSPEC int orte_grpcomm_base_set_proc_attr(const char *attr_name,
88  const void *data,
89  size_t size);
90 ORTE_DECLSPEC int orte_grpcomm_base_get_proc_attr(const orte_process_name_t proc,
91  const char * attribute_name, void **val,
92  size_t *size);
93 ORTE_DECLSPEC int orte_grpcomm_base_modex_unpack( opal_buffer_t* rbuf);
94 ORTE_DECLSPEC int orte_grpcomm_base_full_modex(opal_list_t *procs);
95 ORTE_DECLSPEC int orte_grpcomm_base_purge_proc_attrs(void);
96 ORTE_DECLSPEC int orte_grpcomm_base_modex_init(void);
97 ORTE_DECLSPEC void orte_grpcomm_base_modex_finalize(void);
98 ORTE_DECLSPEC int orte_grpcomm_base_pack_modex_entries(opal_buffer_t *buf);
99 ORTE_DECLSPEC int orte_grpcomm_base_update_modex_entries(orte_process_name_t *proc_name,
100  opal_buffer_t *rbuf);
101 ORTE_DECLSPEC int orte_grpcomm_base_load_modex_data(orte_process_name_t *proc, char *attribute_name,
102  void *data, int num_bytes);
103 
104 /* app functions */
105 ORTE_DECLSPEC int orte_grpcomm_base_app_barrier(orte_process_name_t *recipient,
107 ORTE_DECLSPEC int orte_grpcomm_base_app_allgather(orte_process_name_t *recipient,
109  opal_buffer_t *sbuf,
110  opal_buffer_t *rbuf);
111 ORTE_DECLSPEC int orte_grpcomm_base_app_pack_xcast(orte_daemon_cmd_flag_t cmd,
112  orte_jobid_t job,
113  opal_buffer_t *buffer,
114  opal_buffer_t *message,
115  orte_rml_tag_t tag);
116 
117 /* Tuned collectives */
118 ORTE_DECLSPEC void orte_grpcomm_base_coll_recv(int status, orte_process_name_t* sender,
119  opal_buffer_t* buffer, orte_rml_tag_t tag,
120  void* cbdata);
121 ORTE_DECLSPEC int orte_grpcomm_base_allgather(opal_buffer_t *sendbuf, opal_buffer_t *recvbuf, int32_t num_entries,
122  orte_jobid_t jobid, orte_vpid_t np, orte_vpid_t *vpids);
123 ORTE_DECLSPEC void orte_grpcomm_base_daemon_coll_recv(int status, orte_process_name_t* sender,
124  opal_buffer_t* buffer, orte_rml_tag_t tag,
125  void* cbdata);
126 ORTE_DECLSPEC void orte_grpcomm_base_daemon_collective(orte_process_name_t *sender,
127  opal_buffer_t *data);
128 
129 END_C_DECLS
130 #endif
Definition: condition.h:49
uint32_t orte_jobid_t
Set the allowed range for ids in each space.
Definition: types.h:76
Definition: types.h:146
The OpenRTE Group Communications.
Definition: mutex_unix.h:53
Definition: base.h:72
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
Top-level interface for all MCA components.
ORTE_DECLSPEC int orte_grpcomm_base_select(void)
Function for selecting one component from all those that are available.
Definition: grpcomm_base_select.c:32
BEGIN_C_DECLS ORTE_DECLSPEC int orte_grpcomm_base_open(void)
Function for finding and opening either all MCA components, or the one that was specifically requeste...
Definition: grpcomm_base_open.c:50
ORTE_DECLSPEC OBJ_CLASS_DECLARATION(mca_oob_base_info_t)
declare the association structure as a class
Base object.
Definition: opal_object.h:182
uint32_t orte_rml_tag_t
Message matching tag.
Definition: rml_types.h:220
Definition: opal_list.h:147
Definition: base.h:58
Structure for holding a buffer to be used with the RML or OOB subsystems.
Definition: dss_types.h:159
Mutual exclusion functions.
Definition: grpcomm.h:119
Definition: cpuset.c:38