source: trunk/pbs_drmaa/pbs_conn.h @ 76

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

Wrap PBS API in single class

  • Property svn:keywords set to Id
RevLine 
[12]1/* $Id$ */
[7]2/*
[76]3 *  PSNC DRMAA for Torque/PBS Pro
4 *  Copyright (C) 2012 Poznan Supercomputing and Networking Center
[7]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 
[76]20#ifndef __PBS_DRMAA__PBS_CONN_H
21#define __PBS_DRMAA__PBS_CONN_H
[7]22
23#ifdef HAVE_CONFIG_H
24#       include <config.h>
25#endif
26
[29]27#include <stdio.h>
28
[7]29#include <drmaa_utils/job.h>
30#include <drmaa_utils/session.h>
31
[76]32#include <session.h>
[7]33
[76]34#include <pbs_ifl.h>
[7]35
[76]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
[7]40void
[76]41pbsdrmaa_pbs_conn_destroy ( pbsdrmaa_pbs_conn_t * self );
[7]42
[76]43struct pbsdrmaa_pbs_conn_s {
44        pbsdrmaa_session_t *volatile session;
[48]45
[76]46        char* (*submit) ( pbsdrmaa_pbs_conn_t *self, struct attropl *attrib, char *script, char *destination );
[48]47
[76]48        struct batch_status* (*statjob) ( pbsdrmaa_pbs_conn_t *self,  char *job_id, struct attrl *attrib );
[48]49
[76]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 );
[7]59       
[76]60        /* contact string */
61        char *server;
62        /* connection descriptor */
63        int connection_fd;
[7]64       
[76]65        /* timestamp of last usage */
66        time_t last_usage;     
[7]67};
68
[76]69#endif /* __PBS_DRMAA__PBS_CONN_H */
Note: See TracBrowser for help on using the repository browser.