source: trunk/pbs_drmaa/pbs_conn.h @ 76

Revision 76, 2.0 KB checked in by mmamonski, 10 years ago (diff)

Wrap PBS API in single class

  • Property svn:keywords set to Id
Line 
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
32#include <session.h>
33
34#include <pbs_ifl.h>
35
36typedef struct pbsdrmaa_pbs_conn_s pbsdrmaa_pbs_conn_t;
37
38pbsdrmaa_pbs_conn_t * pbsdrmaa_pbs_conn_new ( pbsdrmaa_session_t * session, char *server);
39
40void
41pbsdrmaa_pbs_conn_destroy ( pbsdrmaa_pbs_conn_t * self );
42
43struct pbsdrmaa_pbs_conn_s {
44        pbsdrmaa_session_t *volatile session;
45
46        char* (*submit) ( pbsdrmaa_pbs_conn_t *self, struct attropl *attrib, char *script, char *destination );
47
48        struct batch_status* (*statjob) ( pbsdrmaa_pbs_conn_t *self,  char *job_id, struct attrl *attrib );
49
50        void (*statjob_free) ( pbsdrmaa_pbs_conn_t *self, struct batch_status* job_status );
51
52        void (*sigjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id, char *signal );
53
54        void (*deljob) ( pbsdrmaa_pbs_conn_t *self, char *job_id );
55
56        void (*rlsjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id );
57
58        void (*holdjob) ( pbsdrmaa_pbs_conn_t *self, char *job_id );
59       
60        /* contact string */
61        char *server;
62        /* connection descriptor */
63        int connection_fd;
64       
65        /* timestamp of last usage */
66        time_t last_usage;     
67};
68
69#endif /* __PBS_DRMAA__PBS_CONN_H */
Note: See TracBrowser for help on using the repository browser.