torque  6.0.1
 All Data Structures Files Functions Variables Modules
jobs.h
Go to the documentation of this file.
1 /* $Id: jobs.h,v 1.6 2006/09/08 18:18:08 ciesnik Exp $ */
2 /*
3  * DRMAA library for Torque/PBS
4  * Copyright (C) 2006 Poznan Supercomputing and Networking Center
5  * DSP team <dsp-devel@hedera.man.poznan.pl>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
27 #ifndef __DRMAA__JOBS_H
28 #define __DRMAA__JOBS_H
29 
30 #ifdef HAVE_CONFIG_H
31 # include <pbs_config.h>
32 #endif
33 
34 #include <drmaa_impl.h>
35 
42 typedef enum
43  {
44  DRMAA_JOB_SUSPENDED = 1 << 0,
45  DRMAA_JOB_RESUMED = 1 << 1,
46  DRMAA_JOB_TERMINATED = 1 << 2,
47  DRMAA_JOB_DISPOSE = 1 << 3
48  } job_flag_t;
49 
57  {
59  char *jobid;
69  bool terminated;
73  bool suspended;
74  };
75 
76 typedef struct drmaa_job_iter_s drmaa_job_iter_t;
77 
78 enum { HASHTAB_SIZE = 1024 };
79 
83  {
84  drmaa_session_t *c;
85  unsigned hash;
86  drmaa_job_t **iter;
87  };
88 
94 void
96 
100 
107 void
109  drmaa_session_t *c,
110  drmaa_job_t *job
111 );
112 
124 bool
126  drmaa_session_t *c,
127  const char *jobid,
128  drmaa_job_t *found,
129  unsigned flags
130 );
131 
132 void
133 drmaa_delete_job_hashtab(drmaa_job_t **tab);
134 
137 #endif /* __DRMAA_JOBS_H */
138 
bool suspended
Whether job was suspended within session by drmaa_control().
Definition: jobs.h:73
bool drmaa_find_job(drmaa_session_t *c, const char *jobid, drmaa_job_t *found, unsigned flags)
Checks if job with given identifier exist in hash table and optionally removes it.
Definition: jobs.c:61
unsigned hash
Hash value of job identifier.
Definition: jobs.h:85
drmaa_job_t * drmaa_get_next_job(drmaa_job_iter_t *iter)
Returns next job identifier from set or NULL if set finished.
Definition: jobs.c:141
void drmaa_get_job_list_iter(drmaa_session_t *session, drmaa_job_iter_t *iter)
Returns iterator to jobs held in DRMAA session.
Definition: jobs.c:132
char * jobid
Job identifier from DRM.
Definition: jobs.h:59
bool terminated
Whether we know that job terminated and its status is waiting to rip.
Definition: jobs.h:69
Job data stored for each submitted job.
Definition: jobs.h:56
int time_label
Job submission timestamp increased in DRMAA session with each submitted job.
Definition: jobs.h:64
drmaa_job_t * next
Next job in list or NULL.
Definition: jobs.h:58
Iterates over submitted jobs set.
Definition: jobs.h:82
DRMAA session data.
Definition: drmaa_impl.h:55
void drmaa_add_job(drmaa_session_t *c, drmaa_job_t *job)
Adds job identifier to session.
Definition: jobs.c:116