source: trunk/pbs_drmaa/log_reader.h @ 21

Revision 21, 2.4 KB checked in by mmatloka, 9 years ago (diff)

exec host from accounting file

  • Property svn:keywords set to Id
Line 
1/* $Id$ */
2/*
3 *  FedStage DRMAA for PBS Pro
4 *  Copyright (C) 2006-2009  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 __PBS_DRMAA__LOG_READER_H
21#define __PBS_DRMAA__LOG_READER_H
22
23#ifdef HAVE_CONFIG_H
24#       include <config.h>
25#endif
26
27#include <drmaa_utils/job.h>
28#include <drmaa_utils/session.h>
29
30typedef struct pbsdrmaa_log_reader_s pbsdrmaa_log_reader_t;
31
32pbsdrmaa_log_reader_t *
33pbsdrmaa_log_reader_new ( fsd_drmaa_session_t * session, fsd_job_t * job );
34
35pbsdrmaa_log_reader_t *
36pbsdrmaa_log_reader_accounting_new ( fsd_drmaa_session_t * session, fsd_job_t * job );
37
38void
39pbsdrmaa_log_reader_destroy ( pbsdrmaa_log_reader_t * self );
40
41struct pbsdrmaa_log_reader_s {
42        fsd_drmaa_session_t *volatile session ;
43        fsd_job_t *volatile job;
44       
45        bool (*
46        read_log) ( pbsdrmaa_log_reader_t * self );
47       
48        void (*
49        select_file) ( pbsdrmaa_log_reader_t * self );
50       
51        /* line - read line, buffer - keeps read but not returned lines, idx, end_idx and line_idx values needed to be kept outside the function */
52        ssize_t (*
53        read_line) ( pbsdrmaa_log_reader_t * self, char * line, char * buffer, ssize_t size, int * idx, int * end_idx, int * line_idx );
54       
55        /* specifies if function should run */
56        bool run_flag;
57       
58        /* date of current file */
59        time_t t;       
60       
61        /* for job_on_missing  - available log files */
62        char ** log_files;
63       
64        /* for job_on_missing - number of log files */
65        int log_files_number;
66       
67        /* log file descriptor */
68        int volatile fd;
69       
70        /* for job_on_missing - log file size when function was ran */
71        off_t log_file_initial_size;
72       
73        /* for job_on_missing - read lines size */
74        off_t log_file_read_size;
75       
76        /* for wait_thread - day changed */
77        bool volatile date_changed;
78       
79        /* for wait_thread - log file first open */
80        bool volatile first_open;       
81       
82        char * name;
83};
84
85#endif /* __PBS_DRMAA__LOG_READER_H */
Note: See TracBrowser for help on using the repository browser.