| 1 | /* $Id$ */ |
|---|
| 2 | /* |
|---|
| 3 | * PSNC DRMAA for Torque/PBS Pro |
|---|
| 4 | * Copyright (C) 2012 Poznan Supercomputing and Networking Center |
|---|
| 5 | * |
|---|
| 6 | * This program is free software: you can redistribute it and/or modify |
|---|
| 7 | * it under the terms of the GNU General Public License as published by |
|---|
| 8 | * the Free Software Foundation, either version 3 of the License, or |
|---|
| 9 | * (at your option) any later version. |
|---|
| 10 | * |
|---|
| 11 | * This program is distributed in the hope that it will be useful, |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | * GNU General Public License for more details. |
|---|
| 15 | * |
|---|
| 16 | * You should have received a copy of the GNU General Public License |
|---|
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef __PBS_DRMAA__PBS_CONN_H |
|---|
| 21 | #define __PBS_DRMAA__PBS_CONN_H |
|---|
| 22 | |
|---|
| 23 | #ifdef HAVE_CONFIG_H |
|---|
| 24 | # include <config.h> |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | #include <stdio.h> |
|---|
| 28 | |
|---|
| 29 | #include <drmaa_utils/job.h> |
|---|
| 30 | #include <drmaa_utils/session.h> |
|---|
| 31 | #include <drmaa_utils/thread.h> |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | #include <pbs_ifl.h> |
|---|
| 35 | |
|---|
| 36 | typedef struct pbsdrmaa_pbs_conn_s pbsdrmaa_pbs_conn_t; |
|---|
| 37 | |
|---|
| 38 | pbsdrmaa_pbs_conn_t * |
|---|
| 39 | pbsdrmaa_pbs_conn_new( |
|---|
| 40 | fsd_drmaa_session_t * session, |
|---|
| 41 | const char *server); |
|---|
| 42 | |
|---|
| 43 | void pbsdrmaa_pbs_conn_destroy ( pbsdrmaa_pbs_conn_t * self ); |
|---|
| 44 | |
|---|
| 45 | struct pbsdrmaa_pbs_conn_s { |
|---|
| 46 | fsd_drmaa_session_t *volatile session; |
|---|
| 47 | |
|---|
| 48 | char* (*submit) ( pbsdrmaa_pbs_conn_t *self, struct attropl *attrib, char *script, char *destination ); |
|---|
| 49 | |
|---|
| 50 | struct batch_status* (*statjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id, struct attrl *attrib ); |
|---|
| 51 | |
|---|
| 52 | void (*statjob_free) ( pbsdrmaa_pbs_conn_t *self, struct batch_status* job_status ); |
|---|
| 53 | |
|---|
| 54 | void (*sigjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id, char *signal ); |
|---|
| 55 | |
|---|
| 56 | void (*deljob) ( pbsdrmaa_pbs_conn_t *self, char *job_id ); |
|---|
| 57 | |
|---|
| 58 | void (*rlsjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id ); |
|---|
| 59 | |
|---|
| 60 | void (*holdjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id ); |
|---|
| 61 | |
|---|
| 62 | /* contact string */ |
|---|
| 63 | char *server; |
|---|
| 64 | /* connection descriptor */ |
|---|
| 65 | int connection_fd; |
|---|
| 66 | |
|---|
| 67 | /* timestamp of last connect time */ |
|---|
| 68 | time_t last_connect_time; |
|---|
| 69 | |
|---|
| 70 | fsd_cond_t autoclose_cond; |
|---|
| 71 | fsd_mutex_t autoclose_mutex; |
|---|
| 72 | bool close_connection; |
|---|
| 73 | }; |
|---|
| 74 | |
|---|
| 75 | #endif /* __PBS_DRMAA__PBS_CONN_H */ |
|---|