1. drmaa2_msession_get_all_queues(3)
  2. DRMAA2
  3. drmaa2_msession_get_all_queues(3)

NAME

drmaa2_msession_get_all_queues - drmaa2_msession_get_all_queues, Returns all Univa(R) Grid Engine(TM) queues

SYNOPSIS

#include "drmaa2.h"

drmaa2_queueinfo_list drmaa2_msession_get_all_queues(const drmaa2_msession monitoring_session, const drmaa2_string_list filter);

DESCRIPTION

Returns a list of all queues currently stored in Grid Engine. The queue list might also contain queues which are not available for the user.

The second argument defines a filter for the queues to be returned. Only queues with names given by the filter are returned if filter is != NULL. If filter is NULL all queues are returned.

RETURN VALUES

Returns a newly allocated list of queues in a drmaa2_queueinfo_list structure or NULL in case of an error. The queue list was initialized with an appropriate callback function so that drmaa2_list_free(&result) frees the complete list with all drmaa2_queueinfo objects inside. In case of an error the error number and error message can be fetched with drmaa2_lasterror(3) and drmaa2_lasterror_text().

EXAMPLE

drmaa2_msession monitoring_session = drmaa2_open_msession(NULL);

if (ms != NULL) {       
   drmaa2_queueinfo_list qi_list = drmaa2_msession_get_all_queues(monitoring_session, NULL);

   if (qi_list == NULL) {
      /* handle error */
      drmaa2_string error = drmaa2_lasterror_text();
      fprintf(stderr, "Error during fetching the queueinfo list from the monitoring session: %s\n", error);
      drmaa2_string_free(&error);
   } else {
      int i;
      size_t size = drmaa2_list_size(qi_list);

      fprintf(stdout, "There are %lld queues in the system:\n", size); 
      for (i = 0; i < size; i++) {
          drmaa2_queueinfo qi = (drmaa2_queueinfo) drmaa2_list_get(qi_list, i);
          fprintf(stdout, "Queue name is %s.\n", (char *) qi->name);
      }
      drmaa2_list_free(&qi_list);
   }

   ...
   drmaa2_close_msession(monitoring_session);
   drmaa2_msession_free(&monitoring_session);
}

SEE ALSO

drmaa2_open_msession(3), drmaa2_close_msession(3), drmaa2_msession_free(3), drmaa2_msession_get_all_jobs(3), drmaa2_msession_get_all_machines(3), drmaa2_list_free(3) )

AUTHOR

Copyright Univa Corporation 2013

  1. Univa Corporation
  2. October 2013
  3. drmaa2_msession_get_all_queues(3)