source: trunk/pbs_drmaa/pbs_drmaa.h @ 1

Revision 1, 3.4 KB checked in by mmamonski, 13 years ago (diff)

Torque/PBS DRMAA initial commit

Line 
1/* $Id: pbs_drmaa.h 2 2009-10-12 09:51:22Z mamonski $ */
2/*
3 *  FedStage DRMAA for PBS Pro
4 *  Copyright (C) 2006-2007  FedStage Systems
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 __DRMAA__PBS_DRMAA_H
21#define __DRMAA__PBS_DRMAA_H
22
23#ifdef HAVE_CONFIG_H
24#       include <config.h>
25#endif
26
27#include <sys/types.h>
28#include <stdbool.h>
29#include <time.h>
30#include <pbs_ifl.h>
31
32#include <drmaa_utils/common.h>
33#include <pbs_drmaa/pbs_attrib.h>
34
35
36/** PBS DRMAA specific session data. */
37struct drmaa_session_impl_s {
38        int                 pbs_conn;    /**< PBS connection (or -1). */
39        drmaa_mutex_t       conn_mutex;  /**< Mutex for PBS connection. */
40        drmaa_thread_t      wait_thread;
41        bool                wait_thread_started;
42        struct attrl       *status_attrl;
43};
44
45
46enum { PBS_ATTRIBS_BITSET_SIZE = (N_PBS_DRMAA_ATTRIBS+31) / 32 };
47struct drmaa_submit_impl_s {
48        struct attrl *pbs_attribs;
49        uint32_t pbs_attribs_bitset[ PBS_ATTRIBS_BITSET_SIZE ];
50        char *script_filename;
51};
52
53
54void *
55drmaa_wait_thread( void *arg );
56
57drmaa_submit_ctx_t *
58drmaa_create_submission_context(
59                const drmaa_job_template_t *jt, int bulk_no,
60                drmaa_err_ctx_t *err
61                );
62
63void
64drmaa_free_submission_context( drmaa_submit_ctx_t *c, drmaa_err_ctx_t* );
65
66void drmaa_set_job_defaults        ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
67void drmaa_create_job_script       ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
68void drmaa_set_job_submit_state    ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
69void drmaa_set_job_files           ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
70void drmaa_set_file_staging        ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
71void drmaa_set_job_resources       ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
72void drmaa_set_job_environment     ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
73void drmaa_set_job_email_notif     ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
74void drmaa_apply_native_spec       ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
75void drmaa_apply_job_category      ( drmaa_submit_ctx_t*, drmaa_err_ctx_t* );
76char *drmaa_translate_staging( const char *stage, drmaa_err_ctx_t* );
77
78void
79drmaa_parse_qsub_args(
80                drmaa_submit_ctx_t *ctx, const char *string,
81                drmaa_err_ctx_t *err
82                );
83
84void
85drmaa_job_missing( drmaa_job_t *job, drmaa_err_ctx_t *err );
86
87void
88drmaa_add_pbs_attr(
89                drmaa_submit_ctx_t *c,
90                int attr, char *resource, char *value,
91                unsigned set,
92                drmaa_err_ctx_t *err
93                );
94
95char *
96drmaa_write_tmpfile(
97         const char *content, size_t len,
98         drmaa_err_ctx_t *err
99         );
100
101struct attrl *
102drmaa_create_pbs_attrl( drmaa_err_ctx_t *err );
103
104void
105drmaa_log_attrl( const struct attrl *attribute_list, const char *prefix );
106
107void
108drmaa_free_attrl( struct attrl *attr );
109
110void
111drmaa_err_pbs_error( drmaa_err_ctx_t *err );
112
113int
114drmaa_err_map_pbs_error( int pbs_errcode );
115
116#define RAISE_PBS() \
117        drmaa_err_pbs_error( err )
118
119#endif /* __DRMAA__PBS_DRMAA_H */
120
Note: See TracBrowser for help on using the repository browser.