source: trunk/drmaa_utils/drmaa_utils/drmaa_util.h @ 1

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

Torque/PBS DRMAA initial commit

Line 
1/* $Id: drmaa_util.h 2 2009-10-12 09:51:22Z mamonski $ */
2/*
3 *  FedStage DRMAA utilities library
4 *  Copyright (C) 2006-2008  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_UTILS__DRMAA_UTIL_H
21#define __DRMAA_UTILS__DRMAA_UTIL_H
22
23#ifdef HAVE_CONFIG_H
24#       include <config.h>
25#endif
26
27#include <drmaa_utils/common.h>
28
29enum{
30        FSD_DRMAA_PH_HD    = 1<<0,
31        FSD_DRMAA_PH_WD    = 1<<1,
32        FSD_DRMAA_PH_INCR  = 1<<2
33};
34
35struct fsd_expand_drmaa_ph_s {
36        /**
37         * Expands placeholders in DRMAA job attribute value.
38         * @param self   Context.
39         * @param input  String to transform.  Should be malloc'ed
40         *   and ownership is passed to callee.
41         * @param set    Set of placeholders to expand.  Bitwise
42         *   `or' of any of following bits:
43         *   - FSD_DRMAA_PH_HD,
44         *   - FSD_DRMAA_PH_WD,
45         *   - FSD_DRMAA_PH_INCR
46         * @return Value with expanded placeholders or \c NULL
47         *   upon error.  Caller is responsible for free()'ing it.
48         */
49        char *(*
50        expand)( fsd_expand_drmaa_ph_t *self, char *input, unsigned set );
51
52        void (*
53        set)( fsd_expand_drmaa_ph_t *self, int placeholder, char *value );
54
55        void (*destroy)( fsd_expand_drmaa_ph_t *self );
56
57        char *home_directory;
58        char *working_directory;
59        char *bulk_incr;
60};
61
62fsd_expand_drmaa_ph_t *
63fsd_expand_drmaa_ph_new(
64                char *home_directory,
65                char *working_directory,
66                char *bulk_incr
67                );
68
69int fsd_parse_timedelta( const char *string );
70
71/**
72 * Return textual representation of action
73 * - argument of drmaa_control().
74 */
75const char *drmaa_control_to_str( int action );
76
77/**
78 * Return textual representation of job status
79 * - result of drmaa_job_ps().
80 */
81const char *drmaa_job_ps_to_str( int ps );
82
83int fsd_drmaa_code( int fsd_errno );
84
85int fsd_errno_from_drmaa_code( int drmaa_errno );
86
87const char *
88fsd_drmaa_strerror( int drmaa_errno );
89
90#endif /* __DRMAA_UTILS__DRMAA_UTIL_H */
91
Note: See TracBrowser for help on using the repository browser.