/* * Get information about each of the queues in the list of lists. If * schd_get_queue_limits() fails, return the error condition. It may * be a transient or a hard failure, which the caller may want to deal * with. If all queues are successful, return '0'. */ int schd_get_queues(void) { int ret; QueueList *qptr; ret = schd_get_queue_limits(schd_SubmitQueue->queue); if (ret) { DBPRT(("schd_get_queues: get_queue_limits for %s failed.\n", schd_SubmitQueue->queue->qname)); return(-1); } for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) { ret = schd_get_queue_limits(qptr->queue); if (ret) DBPRT(("schd_get_queues: get_queue_limits for %s failed.\n", qptr->queue->qname)); } return (0); }
/* * Get information about each of the queues in the list of lists. If * schd_get_queue_limits() fails, return the error condition. It may * be a transient or a hard failure, which the caller may want to deal * with. If all queues are successful, return '0'. */ static int get_all_queue_info(int numqlists, ...) { va_list ap; int count = 0, ret; QueueList *list; QueueList *qptr; va_start(ap, numqlists); while (count < numqlists) { list = va_arg(ap, QueueList *); for (qptr = list; qptr != NULL; qptr = qptr->next) { /* * Get the limits, current resources, and any jobs for this * queue. */ if ((ret = schd_get_queue_limits(qptr->queue)) != 0) { DBPRT(("get_all_queue_info: get_queue_limits for %s failed.\n", qptr->queue->qname)); va_end(ap); return (ret); } /* * Set the queue flags if limits are exceeded. Don't bother * getting a reason string. */ schd_check_queue_limits(qptr->queue, NULL); } count ++; } va_end(ap); return (0); }
/* * Get information about each of the queues in the list of lists. If * schd_get_queue_limits() fails, return the error condition. It may * be a transient or a hard failure, which the caller may want to deal * with. If all queues are successful, return '0'. */ int schd_get_queues(void) { int ret; char *id = "get_queue_util"; QueueList *qptr; /* first get queue information from the Server */ ret = schd_get_queue_limits(schd_SubmitQueue->queue); if (ret) { DBPRT(("schd_get_queues: get_queue_limits for %s failed.\n", schd_SubmitQueue->queue->qname)); return(-1); } for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) { ret = schd_get_queue_limits(qptr->queue); if (ret) DBPRT(("schd_get_queues: get_queue_limits for %s failed.\n", qptr->queue->qname)); } /* Next, get status of nodes from the server. */ get_node_status(); /* Next, get resource usage data for those nodes from the server. */ qptr = schd_SubmitQueue; ret = schd_get_queue_info(qptr->queue); if (ret) DBPRT(("get_queue_util: get_queue_info for %s failed.\n", schd_SubmitQueue->queue->qname)); for (qptr = schd_BatchQueues; qptr != NULL; qptr = qptr->next) { if (qptr->queue->flags & QFLAGS_NODEDOWN) { sprintf(log_buffer, "Skipping UNAVAILABLE node %s", qptr->queue->exechost); DBPRT(("%s: %s\n", id, log_buffer)); log_record(PBSEVENT_ERROR, PBS_EVENTCLASS_SERVER, id, log_buffer); } else { ret = schd_get_queue_info(qptr->queue); if (ret) DBPRT(("get_queue_util: get_queue_info for %s failed.\n", qptr->queue->qname)); } } return (0); }