/* * * print_queue_info - print all information in a queue_info struct * * qinfo - queue to print * brief - only print queue name * deep - print jobs in queue also * * returns nothing * */ void print_queue_info(queue_info *qinfo, char brief, char deep) { job_info *jinfo; if (qinfo == NULL) return; if (qinfo -> name != NULL) printf("\n%sQueue name: %s\n", brief ? " " : "", qinfo -> name); if (!brief) { printf("is_started: %s\n", qinfo -> is_started ? "TRUE" : "FALSE"); printf("is_exec: %s\n", qinfo -> is_exec ? "TRUE" : "FALSE"); printf("is_route: %s\n", qinfo -> is_route ? "TRUE" : "FALSE"); printf("dedtime_queue: %s\n", qinfo -> dedtime_queue ? "TRUE" : "FALSE"); printf("is_ok_to_run: %s\n", qinfo -> is_ok_to_run ? "TRUE" : "FALSE"); printf("max_run: %d\n", qinfo -> max_run); printf("max_user_run: %d\n", qinfo -> max_user_run); printf("max_group_run: %d\n", qinfo -> max_group_run); printf("priority: %d\n", qinfo -> priority); print_state_count(&(qinfo -> sc)); } if (deep) { jinfo = qinfo -> jobs[0]; while (jinfo != NULL) { print_job_info(jinfo, brief); jinfo++; } } }
/* * * print_server_info - print server_info structure * * sinfo - the struct to print * brief - only print the name of the server * * returns nothing * */ void print_server_info(server_info *sinfo, char brief) { resource *resp; /* used in printing the resources */ if (sinfo == NULL) return; if (sinfo -> name != NULL) printf("Server name: %s\n", sinfo -> name); if (!brief) { printf("default_queue: %s\n", sinfo -> default_queue); printf("max_run: %d\n", sinfo -> max_run); printf("max_user_run: %d\n", sinfo -> max_user_run); printf("max_group_run: %d\n", sinfo -> max_group_run); printf("num_nodes: %d\n", sinfo -> num_nodes); printf("num_queues: %d\n", sinfo -> num_queues); print_state_count(&sinfo -> sc); resp = sinfo -> res; while (resp != NULL) { printf("res %s max: %-10ld avail: %-10ld assigned: %-10ld\n", resp -> name, resp -> max, resp -> avail, resp -> assigned); resp = resp -> next; } } }