7 #ifndef BATCH_JOB_INTERNAL_H_
8 #define BATCH_JOB_INTERNAL_H_
16 #include "copy_stream.h"
22 #define BATCH_JOB_LINE_MAX 8192
31 void (*option_update) (
struct batch_queue *Q,
const char *what,
const char *value);
40 int (*chdir) (
struct batch_queue *q,
const char *path);
41 int (*getcwd) (
struct batch_queue *q,
char *buf,
size_t size);
42 int (*mkdir) (
struct batch_queue *q,
const char *path, mode_t mode,
int recursive);
43 int (*putfile) (
struct batch_queue *q,
const char *lpath,
const char *rpath);
44 int (*rename) (
struct batch_queue *q,
const char *lpath,
const char *rpath);
45 int (*stat) (
struct batch_queue *q,
const char *path,
struct stat *buf);
46 int (*unlink) (
struct batch_queue *q,
const char *path);
53 char logfile[PATH_MAX];
54 struct hash_table *options;
55 struct hash_table *features;
56 struct itable *job_table;
57 struct itable *output_table;
62 #define batch_queue_stub_create(name) static int batch_queue_##name##_create (struct batch_queue *Q) { return 0; }
63 #define batch_queue_stub_free(name) static int batch_queue_##name##_free (struct batch_queue *Q) { return 0; }
64 #define batch_queue_stub_port(name) static int batch_queue_##name##_port (struct batch_queue *Q) { return 0; }
65 #define batch_queue_stub_option_update(name) static void batch_queue_##name##_option_update (struct batch_queue *Q, const char *what, const char *value) { return; }
67 #define batch_fs_stub_chdir(name) static int batch_fs_##name##_chdir (struct batch_queue *Q, const char *path) { return chdir(path); }
68 #define batch_fs_stub_getcwd(name) static int batch_fs_##name##_getcwd (struct batch_queue *Q, char *buf, size_t size) { getcwd(buf, size); return 0; }
69 #define batch_fs_stub_mkdir(name) static int batch_fs_##name##_mkdir (struct batch_queue *Q, const char *path, mode_t mode, int recursive) { if (recursive) return create_dir(path, mode); else return mkdir(path, mode); }
70 #define batch_fs_stub_putfile(name) static int batch_fs_##name##_putfile (struct batch_queue *Q, const char *lpath, const char *rpath) { return copy_file_to_file(lpath, rpath); }
71 #define batch_fs_stub_rename(name) static int batch_fs_##name##_rename (struct batch_queue *Q, const char *lpath, const char *rpath) { return create_dir_parents(rpath, 0755) && !rename(lpath, rpath) ? 0 : -1; }
72 #define batch_fs_stub_stat(name) static int batch_fs_##name##_stat (struct batch_queue *Q, const char *path, struct stat *buf) { return stat(path, buf); }
73 #define batch_fs_stub_unlink(name) static int batch_fs_##name##_unlink (struct batch_queue *Q, const char *path) { return unlink_recursive(path); }
Definition: batch_job_internal.h:24
int64_t batch_job_id_t
An integer type indicating a unique batch job number.
Definition: batch_job.h:28
Create a new directory recursively.
batch_queue_type_t
Indicates which type of batch submission to use.
Definition: batch_job.h:34
Definition: rmsummary.h:26
Definition: batch_job_internal.h:50
A general purpose hash table.
JX value representing any expression type.
Definition: jx.h:117
Describes a batch job when it has completed.
Definition: batch_job.h:58
An integer-indexed hash table.