1/* BEGIN LICENSE BLOCK
2 * Version: CMPL 1.1
3 *
4 * The contents of this file are subject to the Cisco-style Mozilla Public
5 * License Version 1.1 (the "License"); you may not use this file except
6 * in compliance with the License.  You may obtain a copy of the License
7 * at www.eclipse-clp.org/license.
8 *
9 * Software distributed under the License is distributed on an "AS IS"
10 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See
11 * the License for the specific language governing rights and limitations
12 * under the License.
13 *
14 * The Original Code is  The ECLiPSe Constraint Logic Programming System.
15 * The Initial Developer of the Original Code is  Cisco Systems, Inc.
16 * Portions created by the Initial Developer are
17 * Copyright (C) 1994-2006 Cisco Systems, Inc.  All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * END LICENSE BLOCK */
22
23/**********************************************************************
24**      System: Parallel Eclipse
25**        File: wm_msgs.h
26**      Author: Shyam Mudambi
27** Description: Worker Manager messages header file
28**
29**********************************************************************/
30
31
32
33/* Worker Manager Simple Message Types */
34/* use wm_simple_msg_t */
35#define DONE_INIT_OPENS 1
36#define ALL_CONNECTED 2
37#define SENT_INIT_PORT_NAMES 3
38#define ROOT_INITIALISED 4
39#define EXITING 5
40#define HALT_SYSTEM1 6
41#define REQ_TIME 7
42#define GOTO_SLEEP 10
43#define WAKEUP 11
44#define CONFIG_NOTIFY 12
45#define STATUS_REQ 13
46#define STATUS_NOTIFY 14
47#define START_INTERFACE 15
48#define REMOVE_INTERFACE 16
49#define HOST_STATUS_NOTIFY 17
50#define WORKER_INFO_NOTIFY 18
51#define START_TRACING 19
52#define STOP_TRACING 20
53#define SET_ONE_SLEEPING 21
54#define REQ_START_TIME 22
55#define WSTAT_REQ 23
56#define WSTAT_RESET 24
57#define SET_TRACE_RET 25
58#define GET_TRACE_HEADER 26
59#define HALT_SYSTEM2 27
60#define HALT_SYSTEM_REQ 28
61#define REQ_WM_HOSTNAME 29
62
63
64
65/* Worker Maganger Complex Message Types */
66
67/* uses port_name_msg_t structure */
68#define PORT_NAME 1
69/* uses root_node_msg_t structure */
70#define ROOT_NODE_REGISTER 1
71/* uses time_msg_t structure */
72#define SEND_TIME 1
73/* uses config_msg_t structure */
74#define ADD_WORKERS 1
75#define SLEEP_WORKERS 2
76#define WAKEUP_WORKERS 3
77/* uses host_status_req_msg_t structure */
78#define HOST_STATUS_REQ 1
79#define WM_HOSTNAME 2
80/* uses worker_info_msg_t structure */
81#define WORKER_INFO_SET 1
82#define WORKER_INFO_GET 2
83/* uses hrtime_msg_t */
84#define SEND_START_TIME 1
85/* uses wstat_msg_t */
86#define WSTAT_RET 1
87/* uses trace_msg_t */
88#define SET_TRACE_HEADER 1
89#define GET_TRACE_RET 2
90
91
92#define MAXHOSTLEN 257
93#define MAX_MACHINES 128
94#define MAX_PROCS 256
95
96typedef char sstring [MAX_PATH_LEN];
97
98#define ECLIPSE_WM_INTERFACE  1024
99
100typedef struct {
101  int msg_type;
102  int wid;
103} wm_msg_header_t;
104
105typedef struct {
106  wm_msg_header_t header;
107  int msg_value;
108} wm_simple_msg_t;
109
110typedef struct {
111  wm_msg_header_t header;
112  int index;
113  nsrv_name_t port_name;
114  aport_id_t wm_aport_id;
115} port_name_msg_t;
116
117typedef struct {
118  wm_msg_header_t header;
119  st_handle_t node;
120} node_msg_t;
121
122
123typedef struct {
124  wm_msg_header_t header;
125#ifdef HAVE_GETHRTIME
126  hrtime_t start_time;
127#else
128#ifdef BSD_TIMES
129  time_t start_time;
130#else
131  clock_t start_time;
132#endif
133#endif
134} start_time_msg_t;
135
136
137typedef struct {
138  wm_msg_header_t header;
139  double cur_time;
140} time_msg_t;
141
142
143typedef struct {
144  wm_msg_header_t header;
145  int workers;
146  nsrv_name_t hostname;
147} config_msg_t;
148
149typedef struct {
150  wm_msg_header_t header;
151  nsrv_name_t hostname;
152} host_name_msg_t;
153
154typedef struct {
155  int num_workers;
156  int num_awake;
157  nsrv_name_t hostname;
158} mc_status_t;
159
160typedef struct {
161  wm_msg_header_t header;
162  int num_machines;
163  int total_workers;
164  mc_status_t machines[MAX_MACHINES];
165} status_msg_t;
166
167typedef struct {
168  wm_msg_header_t header;
169  int num_awake;
170  int num_asleep;
171  int awake_ids[MAX_PROCS];
172  int asleep_ids[MAX_PROCS];
173} host_status_msg_t;
174
175typedef struct {
176  wm_msg_header_t header;
177  struct worker_stat_ext stat;
178} wstat_msg_t;
179
180#ifdef WORKER_TRACING
181typedef struct {
182  wm_msg_header_t header;
183  trace_header_t trace_header;
184} trace_msg_t;
185#endif
186
187typedef struct {
188  wm_msg_header_t header;
189  int infotype;
190  int req_wid;   /* id of requesting worker */
191  int pro_wid;   /* id of providing worker */
192  int size;
193} worker_info_msg_t;
194