void resrc_flow_list_unstage_resources (resrc_flow_list_t *rtl) { resrc_flow_t *rt; if (rtl) { rt = resrc_flow_list_first (rtl); while (rt) { resrc_flow_unstage_resources (rt); rt = resrc_flow_list_next (rtl); } } }
void resrc_flow_print (resrc_flow_t *resrc_flow) { if (resrc_flow) { resrc_print_resource (resrc_flow->flow_resrc); if (resrc_flow_num_children (resrc_flow)) { resrc_flow_t *child = resrc_flow_list_first (resrc_flow->children); while (child) { resrc_flow_print (child); child = resrc_flow_list_next (resrc_flow->children); } } } }
int resrc_flow_list_release_all_reservations (resrc_flow_list_t *rtl) { resrc_flow_t *rt; int rc = -1; if (rtl) { rc = 0; rt = resrc_flow_list_first (rtl); while (!rc && rt) { rc = resrc_flow_release_all_reservations (rt); rt = resrc_flow_list_next (rtl); } } return rc; }
int resrc_flow_list_release (resrc_flow_list_t *rtl, int64_t job_id) { resrc_flow_t *rt; int rc = -1; if (rtl) { rc = 0; rt = resrc_flow_list_first (rtl); while (!rc && rt) { rc = resrc_flow_release (rt, job_id); rt = resrc_flow_list_next (rtl); } } return rc; }
void resrc_flow_list_destroy (resrc_flow_list_t *resrc_flow_list) { if (resrc_flow_list) { if (resrc_flow_list_size (resrc_flow_list)) { resrc_flow_t *child = resrc_flow_list_first (resrc_flow_list); while (child) { resrc_flow_destroy (child); child = resrc_flow_list_next (resrc_flow_list); } } if (resrc_flow_list->list) { zlist_destroy (&(resrc_flow_list->list)); } free (resrc_flow_list); } }
int resrc_flow_list_reserve (resrc_flow_list_t *rtl, int64_t job_id, int64_t starttime, int64_t endtime) { resrc_flow_t *rt; int rc = -1; if (rtl) { rc = 0; rt = resrc_flow_list_first (rtl); while (!rc && rt) { rc = resrc_flow_reserve (rt, job_id, starttime, endtime); rt = resrc_flow_list_next (rtl); } } return rc; }
int resrc_flow_list_serialize (json_t *o, resrc_flow_list_t *rfl) { resrc_flow_t *rf; int rc = -1; if (o && rfl && rfl->list) { rc = 0; rf = resrc_flow_list_first (rfl); while (rf) { json_t *co = Jnew (); if ((rc = resrc_flow_serialize (co, rf))) break; json_array_append_new (o, co); rf = resrc_flow_list_next (rfl); } } return rc; }
int resrc_flow_list_serialize (JSON o, resrc_flow_list_t *rfl) { resrc_flow_t *rf; int rc = -1; if (o && rfl && rfl->list) { rc = 0; rf = resrc_flow_list_first (rfl); while (rf) { JSON co = Jnew (); if ((rc = resrc_flow_serialize (co, rf))) break; json_object_array_add (o, co); rf = resrc_flow_list_next (rfl); } } return rc; }