00001 /* $Id: jobs.h,v 1.6 2006/09/08 18:18:08 ciesnik Exp $ */ 00002 /* 00003 * DRMAA library for Torque/PBS 00004 * Copyright (C) 2006 Poznan Supercomputing and Networking Center 00005 * DSP team <dsp-devel@hedera.man.poznan.pl> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00020 */ 00021 00027 #ifndef __DRMAA__JOBS_H 00028 #define __DRMAA__JOBS_H 00029 00030 #ifdef HAVE_CONFIG_H 00031 # include <pbs_config.h> 00032 #endif 00033 00034 #include <drmaa_impl.h> 00035 00042 typedef enum 00043 { 00044 DRMAA_JOB_SUSPENDED = 1 << 0, 00045 DRMAA_JOB_RESUMED = 1 << 1, 00046 DRMAA_JOB_TERMINATED = 1 << 2, 00047 DRMAA_JOB_DISPOSE = 1 << 3 00048 } job_flag_t; 00049 00056 struct drmaa_job_s 00057 { 00058 drmaa_job_t *next; 00059 char *jobid; 00064 int time_label; 00069 bool terminated; 00073 bool suspended; 00074 }; 00075 00076 typedef struct drmaa_job_iter_s drmaa_job_iter_t; 00077 00078 enum { HASHTAB_SIZE = 1024 }; 00079 00082 struct drmaa_job_iter_s 00083 { 00084 drmaa_session_t *c; 00085 unsigned hash; 00086 drmaa_job_t **iter; 00087 }; 00088 00094 void 00095 drmaa_get_job_list_iter(drmaa_session_t *session, drmaa_job_iter_t *iter); 00096 00098 drmaa_job_t * 00099 drmaa_get_next_job(drmaa_job_iter_t *iter); 00100 00107 void 00108 drmaa_add_job( 00109 drmaa_session_t *c, 00110 drmaa_job_t *job 00111 ); 00112 00124 bool 00125 drmaa_find_job( 00126 drmaa_session_t *c, 00127 const char *jobid, 00128 drmaa_job_t *found, 00129 unsigned flags 00130 ); 00131 00132 void 00133 drmaa_delete_job_hashtab(drmaa_job_t **tab); 00134 00137 #endif /* __DRMAA_JOBS_H */ 00138