~ubuntu-branches/ubuntu/quantal/ncbi-tools6/quantal

« back to all changes in this revision

Viewing changes to connect/ncbi_host_info.h

Tags: upstream-6.1.20081116a
ImportĀ upstreamĀ versionĀ 6.1.20081116a

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef CONNECT___NCBI_HOST_INFO__H
2
2
#define CONNECT___NCBI_HOST_INFO__H
3
3
 
4
 
/*  $Id: ncbi_host_info.h,v 6.7 2006/03/06 20:23:59 lavr Exp $
 
4
/*  $Id: ncbi_host_info.h,v 6.9 2008/09/03 20:55:44 kazimird Exp $
5
5
 * ===========================================================================
6
6
 *
7
7
 *                            PUBLIC DOMAIN NOTICE
53
53
#endif
54
54
 
55
55
 
56
 
struct SHostInfoTag;
57
 
typedef struct SHostInfoTag* HOST_INFO;
58
 
 
59
 
 
60
 
/* Return CPU count or -1 if error occurred.
61
 
 */
62
 
extern NCBI_XCONNECT_EXPORT int HINFO_CpuCount(const HOST_INFO host_info);
63
 
 
64
 
 
65
 
/* Return task count or -1 if error occurred.
66
 
 */
67
 
extern NCBI_XCONNECT_EXPORT int HINFO_TaskCount(const HOST_INFO host_info);
 
56
struct SHostInfoTag;  /*forward declaration of an opaque private structure*/
 
57
typedef struct SHostInfoTag* HOST_INFO; /*handle for the user code use*/
 
58
 
 
59
 
 
60
/* Return CPU count or -1 if an error occurred.
 
61
 */
 
62
extern NCBI_XCONNECT_EXPORT
 
63
int HINFO_CpuCount(const HOST_INFO host_info);
 
64
 
 
65
 
 
66
/* Return number of actual CPU units, 0 if the number cannot
 
67
 * be determined, or -1 if an error occurred.
 
68
 */
 
69
extern NCBI_XCONNECT_EXPORT
 
70
int HINFO_CpuUnits(const HOST_INFO host_info);
 
71
 
 
72
 
 
73
/* Return CPU clock rate (in MHz) or 0 if an error occurred.
 
74
 */
 
75
extern NCBI_XCONNECT_EXPORT
 
76
double HINFO_CpuClock(const HOST_INFO host_info);
 
77
 
 
78
 
 
79
/* Return task count or -1 if an error occurred.
 
80
 */
 
81
extern NCBI_XCONNECT_EXPORT
 
82
int HINFO_TaskCount(const HOST_INFO host_info);
 
83
 
 
84
 
 
85
/* Return non-zero on success and store memory usage (in MB
 
86
 * in the provided array "memusage" at the following layout:
 
87
 * index 0 = total RAM, MB;
 
88
 * index 1 = discardable RAM (cached), MB;
 
89
 * index 2 = free RAM, MB;
 
90
 * index 3 = total swap, MB;
 
91
 * index 4 = free swap, MB.
 
92
 * Return 0 if an error occurred.
 
93
 */
 
94
extern NCBI_XCONNECT_EXPORT
 
95
int/*bool*/ HINFO_Memusage(const HOST_INFO host_info, double memusage[5]);
68
96
 
69
97
 
70
98
/* Return non-zero on success and store load averages in the
71
99
 * provided array "lavg", with the standard load average for last
72
100
 * minute stored at index [0], and instant load average
73
 
 * (aka BLAST) stored at index [1]. Return 0 on error.
 
101
 * (aka BLAST) stored at index [1].  Return 0 on error.
74
102
 */
75
 
extern NCBI_XCONNECT_EXPORT int/*bool*/ HINFO_LoadAverage
76
 
(const HOST_INFO host_info,
77
 
 double          lavg[2]
78
 
 );
 
103
extern NCBI_XCONNECT_EXPORT
 
104
int/*bool*/ HINFO_LoadAverage(const HOST_INFO host_info, double lavg[2]);
79
105
 
80
106
 
81
107
/* Return non-zero on success and store host status coefficients in
82
108
 * the provided array "status", with status based on the standard
83
109
 * load average stored at index [0], and that based on instant load
84
110
 * average stored at index [1]. Status may return as 0 if the host
85
 
 * does not provide such information. Return 0 on error.
86
 
 */
87
 
extern NCBI_XCONNECT_EXPORT int/*bool*/ HINFO_Status
88
 
(const HOST_INFO host_info,
89
 
 double          status[2]
90
 
 );
91
 
 
92
 
 
93
 
/* Obsolete.  Always returns 0 and does not touch its "blast" argument.
94
 
 */
95
 
extern NCBI_XCONNECT_EXPORT int/*bool*/ HINFO_BLASTParams
96
 
(const HOST_INFO host_info,
97
 
 unsigned int    blast[8]
98
 
 );
99
 
 
100
 
 
101
 
/* Obtain and return host environment. The host environment is the
 
111
 * does not provide such information.  Return 0 on error.
 
112
 */
 
113
extern NCBI_XCONNECT_EXPORT
 
114
int/*bool*/ HINFO_Status(const HOST_INFO host_info, double status[2]);
 
115
 
 
116
 
 
117
/* Obtain and return host environment.  The host environment is the
102
118
 * sequence of lines (separated by \n), all having the form "name=value",
103
119
 * which are provided to load-balancing service mapping daemon (LBSMD)
104
 
 * in the configuration file on that host. Return 0 if the host
105
 
 * environment cannot be obtained. If completed successfully, the
 
120
 * in the configuration file on that host.  Return 0 if the host
 
121
 * environment cannot be obtained.  If completed successfully, the
106
122
 * host environment remains valid until the handle 'host_info' deleted
107
123
 * in the application program.
108
124
 */
109
 
extern NCBI_XCONNECT_EXPORT const char* HINFO_Environment
110
 
(const HOST_INFO host_info);
 
125
extern NCBI_XCONNECT_EXPORT
 
126
const char* HINFO_Environment(const HOST_INFO host_info);
111
127
 
112
128
 
113
129
/* Obtain affinity argument and value that has keyed the service
114
130
 * selection (if affinities have been used at all).  NULL gets returned
115
 
 * as argument if no affinity has been found (in this case value
116
 
 * will be returned 0 as well).  Otherwise, NULL gets returned as
117
 
 * value if there was no particular value matched but the argument
 
131
 * as argument if no affinity has been found (in this case the value
 
132
 * will be returned NULL as well).  Otherwise, NULL gets returned as
 
133
 * the value if there was no particular value matched but the argument
118
134
 * played alone; "" is the value has been used empty, or any other
119
 
 * substring from the host environment that has keyed the decision.
 
135
 * substring from the host environment that keyed the selection decision.
120
136
 */
121
 
extern NCBI_XCONNECT_EXPORT const char* HINFO_AffinityArgument
122
 
(const HOST_INFO host_info);
 
137
extern NCBI_XCONNECT_EXPORT
 
138
const char* HINFO_AffinityArgument(const HOST_INFO host_info);
123
139
 
124
 
extern NCBI_XCONNECT_EXPORT const char* HINFO_AffinityArgvalue
125
 
(const HOST_INFO host_info);
 
140
extern NCBI_XCONNECT_EXPORT
 
141
const char* HINFO_AffinityArgvalue(const HOST_INFO host_info);
126
142
 
127
143
 
128
144
#ifdef __cplusplus
132
148
 
133
149
/* @} */
134
150
 
135
 
 
136
 
/*
137
 
 * --------------------------------------------------------------------------
138
 
 * $Log: ncbi_host_info.h,v $
139
 
 * Revision 6.7  2006/03/06 20:23:59  lavr
140
 
 * Added "const" qualifier to all host-infos when passed to getters
141
 
 *
142
 
 * Revision 6.6  2006/03/05 17:33:15  lavr
143
 
 * +HINFO_AffinityArgument, +HINFO_AffinityArgvalue
144
 
 *
145
 
 * Revision 6.5  2003/04/09 19:05:42  siyan
146
 
 * Added doxygen support
147
 
 *
148
 
 * Revision 6.4  2003/02/08 21:03:51  lavr
149
 
 * Unimportant change in comments
150
 
 *
151
 
 * Revision 6.3  2003/01/08 01:59:32  lavr
152
 
 * DLL-ize CONNECT library for MSVC (add NCBI_XCONNECT_EXPORT)
153
 
 *
154
 
 * Revision 6.2  2002/11/08 17:16:11  lavr
155
 
 * NULL parameter acceptance explicitly stated
156
 
 *
157
 
 * Revision 6.1  2002/10/28 20:12:02  lavr
158
 
 * Initial revision
159
 
 *
160
 
 * ==========================================================================
161
 
 */
162
 
 
163
151
#endif /* CONNECT___NCBI_HOST_INFO__H */