| NAME |
| SCI_Query - Queries runtime information of the SCI execution environment |
| |
| C Syntax |
| #include <sci.h> |
| int SCI_Query(sci_query_t query, void *ret_val) |
| |
| INPUT PARAMETERS |
| query |
| Specifies the type of query you want to request (IN). |
| ret_val |
| Specifies the reference parameter for SCI to store as the result of the |
| query. The value of this parameter cannot be NULL (OUT). |
| |
| DESCRIPTION |
| This subroutine is used to query runtime settings and statistics from SCI. |
| SCI defines a set of query types as an enumeration in sci.h. |
| |
| For example, you can query the backend id using the query value of BACKEND_ID: |
| SCI_Query(BACKEND_ID, &ret_val); |
| |
| In SCI, sci_query_t defines the following valid query types: |
| |
| JOB_KEY |
| Query the job key of the current job |
| NUM_BACKENDS |
| Query the number of back ends in the job |
| BACKEND_ID |
| Query the back end id of current back end in the job |
| POLLING_FD |
| Query the external polling file descriptor in polling mode of the current job |
| NUM_FILTERS |
| Query the number of loaded filters in the current job |
| FILTER_IDLIST |
| Query the loaded filter id list of the current job |
| AGENT_ID |
| Query the agent id of current agent in the job |
| NUM_SUCCESSORS |
| Query the number of successors of current entity in the job |
| SUCCESSOR_IDLIST |
| Query the successor id list of current entity in the job |
| HEALTH_STATUS |
| Query the running status of current entity in the job, can be 0 (normal) or |
| 1 (exited) |
| |
| For more information, please refer to SCI's online documents. |
| |
| EXAMPLE |
| { |
| int my_id; |
| SCI_Query(BACKEND_ID, &my_id); |
| int be_num; |
| SCI_Query(NUM_BACKENDS, &be_num); |
| } |
| |
| ERRORS |
| All SCI routines return an error value. |
| |
| SCI_ERR_UNINTIALIZED |
| Uninitialized SCI execution environment |
| SCI_ERR_UNKNOWN_INFO |
| Can't set NULL to ret_val |
| SCI_ERR_INVALID_CALLER |
| Invalid query type for current entity. e.g., BACKEND_NUM can only be used |
| for back end |
| SCI_ERR_MODE |
| For POLLING_FD only, can only be used in polling mode |
| |
| SEE ALSO |
| SCI_Group_query(3) |