OpenMPI  0.1.1
plm_private.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2006 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 (c) 2011 Los Alamos National Security, LLC.
13  * All rights reserved.
14  * $COPYRIGHT$
15  *
16  * Additional copyrights may follow
17  *
18  * $HEADER$
19  */
20 /** @file:
21  */
22 
23 #ifndef MCA_PLM_PRIVATE_H
24 #define MCA_PLM_PRIVATE_H
25 
26 /*
27  * includes
28  */
29 #include "orte_config.h"
30 #include "orte/types.h"
31 
32 #ifdef HAVE_SYS_TIME_H
33 #include <sys/time.h>
34 #endif /* HAVE_SYS_TIME_H */
35 
36 #include "opal/class/opal_list.h"
38 #include "opal/dss/dss_types.h"
39 #include "opal/threads/condition.h"
40 
41 #include "opal/dss/dss_types.h"
42 #include "orte/mca/plm/plm_types.h"
43 #include "orte/mca/rml/rml_types.h"
46 
47 
48 BEGIN_C_DECLS
49 
50 /* globals for use solely within PLM framework */
51 typedef struct {
52  /** Verbose/debug output stream */
53  int output;
54  /* orted cmd comm lock */
55  opal_mutex_t orted_cmd_lock;
56  /* orted cmd cond */
57  opal_condition_t orted_cmd_cond;
58  /* next jobid */
59  uint16_t next_jobid;
60  /* time when daemons started launch */
61  struct timeval daemonlaunchstart;
62  /* spawn lock */
63  opal_mutex_t spawn_lock;
64  /* spawn cond */
65  opal_condition_t spawn_cond;
66  /* spawn status */
67  int spawn_status;
68  /* completion flag */
69  bool spawn_complete;
70  /* spawn in progress cond */
71  opal_condition_t spawn_in_progress_cond;
72  /* flag */
73  bool spawn_in_progress;
74  /* tree spawn cmd */
75  opal_buffer_t tree_spawn_cmd;
76  /* daemon nodes assigned at launch */
77  bool daemon_nodes_assigned_at_launch;
78  /* handle allocator-to-actual nodename matches */
79  bool strip_prefix_from_node_names;
81 /**
82  * Global instance of PLM framework data
83  */
84 ORTE_DECLSPEC extern orte_plm_globals_t orte_plm_globals;
85 
86 
87 /**
88  * Utility routine to set progress engine schedule
89  */
90 ORTE_DECLSPEC int orte_plm_base_set_progress_sched(int sched);
91 
92 /*
93  * Launch support
94  */
95 ORTE_DECLSPEC int orte_plm_base_setup_job(orte_job_t *jdata);
96 ORTE_DECLSPEC int orte_plm_base_launch_apps(orte_jobid_t job);
97 
98 ORTE_DECLSPEC int orte_plm_base_daemon_callback(orte_std_cntr_t num_daemons);
99 
100 ORTE_DECLSPEC int orte_plm_base_set_hnp_name(void);
101 
102 ORTE_DECLSPEC int orte_plm_base_create_jobid(orte_job_t *jdata);
103 
104 ORTE_DECLSPEC void orte_plm_base_reset_job(orte_job_t *jdata);
105 
106 ORTE_DECLSPEC int orte_plm_base_setup_orted_cmd(int *argc, char ***argv);
107 ORTE_DECLSPEC int orte_plm_base_setup_virtual_machine(orte_job_t *jdata);
108 
109 /**
110  * Utilities for plm components that use proxy daemons
111  */
112 ORTE_DECLSPEC int orte_plm_base_orted_exit(orte_daemon_cmd_flag_t command);
113 ORTE_DECLSPEC int orte_plm_base_orted_terminate_job(orte_jobid_t jobid);
114 ORTE_DECLSPEC int orte_plm_base_orted_kill_local_procs(opal_pointer_array_t *procs);
115 ORTE_DECLSPEC int orte_plm_base_orted_signal_local_procs(orte_jobid_t job, int32_t signal);
116 
117 /*
118  * communications utilities
119  */
120 ORTE_DECLSPEC int orte_plm_base_comm_start(void);
121 ORTE_DECLSPEC int orte_plm_base_comm_stop(void);
122 ORTE_DECLSPEC void orte_plm_base_recv(int status, orte_process_name_t* sender,
123  opal_buffer_t* buffer, orte_rml_tag_t tag,
124  void* cbdata);
125 
126 
127 /**
128  * Construct basic ORTE Daemon command line arguments
129  */
130 ORTE_DECLSPEC int orte_plm_base_orted_append_basic_args(int *argc, char ***argv,
131  char *ess_module,
132  int *proc_vpid_index,
133  char *nodes);
134 
135 /*
136  * Proxy functions for use by daemons and application procs
137  * needing dynamic operations
138  */
139 ORTE_DECLSPEC int orte_plm_proxy_init(void);
140 ORTE_DECLSPEC int orte_plm_proxy_spawn(orte_job_t *jdata);
141 ORTE_DECLSPEC int orte_plm_proxy_finalize(void);
142 
143 END_C_DECLS
144 
145 #endif /* MCA_PLS_PRIVATE_H */
Definition: plm_private.h:51
dynamic pointer array
Definition: opal_pointer_array.h:45
Definition: condition.h:49
ORTE_DECLSPEC int orte_plm_base_set_progress_sched(int sched)
Utility routine to set progress engine schedule.
uint32_t orte_jobid_t
Set the allowed range for ids in each space.
Definition: types.h:76
Definition: types.h:146
int32_t orte_std_cntr_t
Supported datatypes for messaging and storage operations.
Definition: types.h:34
Definition: mutex_unix.h:53
The opal_list_t interface is used to provide a generic doubly-linked list container for Open MPI...
See opal_bitmap.h for an explanation of why there is a split between OPAL and ORTE for this generic c...
ORTE_DECLSPEC int orte_plm_base_orted_exit(orte_daemon_cmd_flag_t command)
Utilities for plm components that use proxy daemons.
Definition: plm_base_orted_cmds.c:95
ORTE_DECLSPEC int orte_plm_base_orted_append_basic_args(int *argc, char ***argv, char *ess_module, int *proc_vpid_index, char *nodes)
Construct basic ORTE Daemon command line arguments.
Definition: plm_base_launch_support.c:777
Buffer management types.
ORTE_DECLSPEC orte_plm_globals_t orte_plm_globals
Global instance of PLM framework data.
Definition: plm_base_open.c:68
uint32_t orte_rml_tag_t
Message matching tag.
Definition: rml_types.h:220
Definition: orte_globals.h:316
int output
Verbose/debug output stream.
Definition: plm_private.h:53
Global params for OpenRTE.
Structure for holding a buffer to be used with the RML or OOB subsystems.
Definition: dss_types.h:159
Contains the typedefs for the use of the rml.