1 #ifndef BATCH_JOB_INTERNAL_H_
2 #define BATCH_JOB_INTERNAL_H_
10 #include "copy_stream.h"
16 #define BATCH_JOB_LINE_MAX 8192
25 void (*option_update) (
struct batch_queue *Q,
const char *what,
const char *value);
34 int (*chdir) (
struct batch_queue *q,
const char *path);
35 int (*getcwd) (
struct batch_queue *q,
char *buf,
size_t size);
36 int (*mkdir) (
struct batch_queue *q,
const char *path, mode_t mode,
int recursive);
37 int (*putfile) (
struct batch_queue *q,
const char *lpath,
const char *rpath);
38 int (*stat) (
struct batch_queue *q,
const char *path,
struct stat *buf);
39 int (*unlink) (
struct batch_queue *q,
const char *path);
46 char logfile[PATH_MAX];
47 struct hash_table *options;
48 struct itable *job_table;
49 struct itable *output_table;
54 #define batch_queue_stub_create(name) static int batch_queue_##name##_create (struct batch_queue *Q) { return 0; }
55 #define batch_queue_stub_free(name) static int batch_queue_##name##_free (struct batch_queue *Q) { return 0; }
56 #define batch_queue_stub_port(name) static int batch_queue_##name##_port (struct batch_queue *Q) { return 0; }
57 #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; }
59 #define batch_fs_stub_chdir(name) static int batch_fs_##name##_chdir (struct batch_queue *Q, const char *path) { return chdir(path); }
60 #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; }
61 #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); }
62 #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); }
63 #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); }
64 #define batch_fs_stub_unlink(name) static int batch_fs_##name##_unlink (struct batch_queue *Q, const char *path) { return delete_dir(path); }
Definition: batch_job_internal.h:18
int64_t batch_job_id_t
An integer type indicating a unique batch job number.
Definition: batch_job.h:27
Create a new directory recursively.
batch_queue_type_t
Indicates which type of batch submission to use.
Definition: batch_job.h:33
See unlink_recursive.h instead.
Definition: nvpair_private.h:15
Definition: batch_job_internal.h:43
A general purpose hash table.
Describes a batch job when it has completed.
Definition: batch_job.h:49
An integer-indexed hash table.