Globus Resource Management API



The resource management API provides functions for submitting a job request to a RM, for asking when a job (submitted or not)
might run, for cancelling a request, for requesting notification of state changes for a request, and for checking for pending
notifications.

grm_job_request() - Request access to interactive resources at the current time.

int grm_job_request(const char *resource_manager_contact,
                    const char *description,
                    const int job_state_mask
                    const char *callback_contact,
                    char **job_contact)

If successful, the job_contact argument is set to a unique identifier for the job and can be used as a handle in other functions. (It can be passed among process as a string so as to be usable by other processes.)

A job request is atomic: either all of the requested processes are created, or none are created.

grm_job_check()

Given a job description, returns an estimate of when a request submitted now with that description will reach state ACTIVE. It
returns GRM_SUCCESS if successful, otherwise an error.

int grm_job_check(const char *resource_manager_contact,
                  const char *description,
                  const float conf_percentage,
                  grm_time_t *estimate,
                  grm_time_t *interval_size);
 

The user specifies a confidence, and the RM returns an interval within which it believes with the specified confidence that the job will
start. (E.g., if required_confidence=0.9, then the RM estimates with a confidence of 90% that the start time will occur in the
interval (estimate-interval_size/2,estimate+interval_size/2).

grm_job_start_time()

Determine:

The function returns GRM_SUCCESS if successful, otherwise GRM_ERROR_NOT_SUPPORTED.

int grm_job_start_time(const char *job_contact,
                       const float conf_percentage,
                       grm_time_t *estimate,
                       grm_time_t *interval_size);

where the last three arguments are the same as for grm_job_check().

grm_job_cancel()

This function:

The function returns GRM_SUCCESS if successful, otherwise an error message.

int grm_job_cancel(char *job_contact);

grm_callback_allow()

Create a TCP port on which to listen for job state change callbacks, and return GRM_SUCCESS on success, or an error code. If
successful, fd is set to the file descriptior for the TCP port, and callback_contact is set to a string containing the information
required to contact the callback port.

int grm_callback_allow(void callback_func(char *job_contact, int state,
                       int errorcode), char **callback_contact, int *fd)

where callback_func is invoked at the callback_contact each time the job changes state to a state specified in the job_state_mask provided as an argument to grm_job_submit_request, with as arguments:

The fd returned by this function should be monitored by select() (or a similar function supplied by an event driver). When the fd
becomes ready for reading, grm_callback_check() should be called with this fd. Any callbacks made to this callback port will
cause the callback_func() to be invoked, passing it the job_contact and the new state of the job.

grm_callback_check()

Check for a job state change callback on the file descriptor, fd, which was created by a previous call to grm_callback_allow(). If there is a job state change callback available, then the callback_func() specified for this fd in the previous call to grm_callback_allow() is called, passing it the job_contact and new state of the job.

int grm_callback_check(int fd)



Last Updated: 3rd September 1997 by  Mark Baker