1. drmaa2_jsession_run_job(3)
  2. DRMAA2
  3. drmaa2_jsession_run_job(3)


drmaa2_jsession_run_job - drmaa2_jsession_run_job, Submits a job based on a template.


#include "drmaa2.h"

drmaa2_j drmaa2_jsession_run_job(const drmaa2_jsession jsession, const drmaa2_jtemplate jtemplate);


This function submits a job in the given job session based on the job description provided by the job template. For a successful job submission the given job session needs to be open. The returned job object can be used for monitoring and controlling the job.

Resource limits and general resource requests which are not part of the job template or the Univa(R) Grid Engine(TM) job template enhancements (but which available in Univa(R) Grid Engine(TM) installation with the -l requests - like user defined complexes), can be requested by using the resourceLimits dictionary which is part of the DRMAA2 job template.


Returns a newly allocated DRMAA2 job object or NULL in case any error happend. In case of an error the error ID and error text is stored in the context of the thread which submitted the job. The error can be read out by drmaa2_lasterror(3) and drmaa2_lasterror_text(3). The returned job object must be freed by drmaa2_j_free(3) after usage.


/* Create and open a new job session. */
drmaa2_jsession js = drmaa2_create_jsession("test_session", NULL);
drmaa2_j job = NULL;

if (js != NULL) {
   /* create a new job template. */
   drmaa2_jtemplate jt = drmaa2_jtemplate_create();

   /* add the job characteristics */
   jt->jobName = strdup("test_job");
   jt->remoteCommand = strdup("sleep");
   /* since no allocated strings are used we don't need to specify a callback */
   args = drmaa2_list_create(DRMAA2_STRINGLIST, NULL);
   drmaa2_list_add(args, "60");
   jt->args = args;

   /* submit the jobs */
   job = drmaa2_jsession_run_job(js, jt);




drmaa2_jtemplate_create(3), drmaa2_jtemplate_free(3), drmaa2_jsession_open(3), drmaa2_jsession_create(3), drmaa2_jsession_close(3), drmaa2_jsession_destroy(3), drmaa2_jsession_run_job(3), drmaa2_jsession_run_bulk_jobs(3), drmaa2_jsession_get_jobs(3), drmaa2_jsession_wait_any_started(3), drmaa2_jsession_wait_any_terminated(3), drmaa2_j_free(3)


Copyright Univa Corporation 2013

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