57
typedef struct SHostInfoTag* HOST_INFO;
60
/* Return CPU count or -1 if error occurred.
62
extern NCBI_XCONNECT_EXPORT int HINFO_CpuCount(const HOST_INFO host_info);
65
/* Return task count or -1 if error occurred.
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*/
60
/* Return CPU count or -1 if an error occurred.
62
extern NCBI_XCONNECT_EXPORT
63
int HINFO_CpuCount(const HOST_INFO host_info);
66
/* Return number of actual CPU units, 0 if the number cannot
67
* be determined, or -1 if an error occurred.
69
extern NCBI_XCONNECT_EXPORT
70
int HINFO_CpuUnits(const HOST_INFO host_info);
73
/* Return CPU clock rate (in MHz) or 0 if an error occurred.
75
extern NCBI_XCONNECT_EXPORT
76
double HINFO_CpuClock(const HOST_INFO host_info);
79
/* Return task count or -1 if an error occurred.
81
extern NCBI_XCONNECT_EXPORT
82
int HINFO_TaskCount(const HOST_INFO host_info);
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.
94
extern NCBI_XCONNECT_EXPORT
95
int/*bool*/ HINFO_Memusage(const HOST_INFO host_info, double memusage[5]);
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.
75
extern NCBI_XCONNECT_EXPORT int/*bool*/ HINFO_LoadAverage
76
(const HOST_INFO host_info,
103
extern NCBI_XCONNECT_EXPORT
104
int/*bool*/ HINFO_LoadAverage(const HOST_INFO host_info, double lavg[2]);
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.
87
extern NCBI_XCONNECT_EXPORT int/*bool*/ HINFO_Status
88
(const HOST_INFO host_info,
93
/* Obsolete. Always returns 0 and does not touch its "blast" argument.
95
extern NCBI_XCONNECT_EXPORT int/*bool*/ HINFO_BLASTParams
96
(const HOST_INFO host_info,
101
/* Obtain and return host environment. The host environment is the
111
* does not provide such information. Return 0 on error.
113
extern NCBI_XCONNECT_EXPORT
114
int/*bool*/ HINFO_Status(const HOST_INFO host_info, double status[2]);
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.
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);
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.
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);
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);
128
144
#ifdef __cplusplus
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
142
* Revision 6.6 2006/03/05 17:33:15 lavr
143
* +HINFO_AffinityArgument, +HINFO_AffinityArgvalue
145
* Revision 6.5 2003/04/09 19:05:42 siyan
146
* Added doxygen support
148
* Revision 6.4 2003/02/08 21:03:51 lavr
149
* Unimportant change in comments
151
* Revision 6.3 2003/01/08 01:59:32 lavr
152
* DLL-ize CONNECT library for MSVC (add NCBI_XCONNECT_EXPORT)
154
* Revision 6.2 2002/11/08 17:16:11 lavr
155
* NULL parameter acceptance explicitly stated
157
* Revision 6.1 2002/10/28 20:12:02 lavr
160
* ==========================================================================
163
151
#endif /* CONNECT___NCBI_HOST_INFO__H */