queue_info *new_queue_info() { queue_info *qinfo; if ((qinfo = (queue_info *)malloc(sizeof(queue_info))) == NULL) return NULL; qinfo -> is_started = 0; qinfo -> is_exec = 0; qinfo -> is_route = 0; qinfo -> dedtime_queue = 0; qinfo -> is_ok_to_run = 0; qinfo -> priority = 0; init_state_count(&(qinfo -> sc)); qinfo -> max_run = INFINITY; qinfo -> max_user_run = INFINITY; qinfo -> max_group_run = INFINITY; qinfo -> name = NULL; qinfo -> qres = NULL; qinfo -> jobs = NULL; qinfo -> running_jobs = NULL; qinfo -> server = NULL; return qinfo; }
/* * * new_server_info - allocate and initalize a new server_info struct * * returns pointer to new allocated struct * */ server_info *new_server_info() { server_info *sinfo; /* the new server */ if ((sinfo = (server_info *) malloc(sizeof(server_info))) == NULL) return NULL; sinfo -> name = NULL; sinfo -> res = NULL; sinfo -> default_queue = NULL; sinfo -> queues = NULL; sinfo -> jobs = NULL; sinfo -> running_jobs = NULL; sinfo -> nodes = NULL; sinfo -> timesharing_nodes = NULL; sinfo -> num_queues = 0; sinfo -> num_nodes = 0; sinfo -> max_run = INFINITY; sinfo -> max_user_run = INFINITY; sinfo -> max_group_run = INFINITY; sinfo -> tokens = NULL; init_state_count(&(sinfo -> sc)); return sinfo; }
queue_info * new_queue_info(int limallocflag) { queue_info *qinfo; if ((qinfo = malloc(sizeof(queue_info))) == NULL) { log_err(errno, "new_queue_info", MEM_ERR_MSG); return NULL; } qinfo->is_started = 0; qinfo->is_exec = 0; qinfo->is_route = 0; qinfo->is_ded_queue = 0; qinfo->is_prime_queue = 0; qinfo->is_nonprime_queue = 0; qinfo->is_ok_to_run = 0; qinfo->has_nodes = 0; qinfo->priority = 0; qinfo->has_soft_limit = 0; qinfo->has_hard_limit = 0; qinfo->is_peer_queue = 0; qinfo->has_resav_limit = 0; init_state_count(&(qinfo->sc)); if ((limallocflag != 0)) qinfo->liminfo = lim_alloc_liminfo(); qinfo->num_nodes = 0; qinfo->name = NULL; qinfo->qres = NULL; qinfo->jobs = NULL; qinfo->running_jobs = NULL; qinfo->server = NULL; qinfo->resv = NULL; qinfo->nodes = NULL; qinfo->nodes_in_partition = NULL; qinfo->alljobcounts = NULL; qinfo->group_counts = NULL; qinfo->project_counts = NULL; qinfo->user_counts = NULL; qinfo->total_alljobcounts = NULL; qinfo->total_group_counts = NULL; qinfo->total_project_counts = NULL; qinfo->total_user_counts = NULL; qinfo->nodepart = NULL; qinfo->node_group_key= NULL; qinfo->allpart = NULL; qinfo->num_parts = 0; qinfo->num_topjobs = 0; qinfo->backfill_depth = UNSPECIFIED; #ifdef NAS /* localmod 046 */ qinfo->max_starve = 0; /* localmod 034 */ qinfo->max_borrow = UNSPECIFIED; /* localmod 038 */ qinfo->is_topjob_set_aside = 0; /* localmod 040 */ qinfo->ignore_nodect_sort = 0; #endif qinfo->partition = NULL; return qinfo; }