cctools
batch_queue_internal.h
1/*
2Copyright (C) 2024 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See the file COPYING for details.
5*/
6
7#ifndef BATCH_JOB_INTERNAL_H_
8#define BATCH_JOB_INTERNAL_H_
9
10#include <sys/stat.h>
11
12#include <limits.h>
13#include <stdlib.h>
14
15#include "batch_queue.h"
16#include "copy_stream.h"
17#include "create_dir.h"
18#include "unlink_recursive.h"
19#include "hash_table.h"
20#include "itable.h"
21
22#define BATCH_JOB_LINE_MAX 8192
23
26 char typestr[128];
27
28 int (*create) (struct batch_queue *Q);
29 int (*free) (struct batch_queue *Q);
30 int (*port) (struct batch_queue *Q);
31 void (*option_update) (struct batch_queue *Q, const char *what, const char *value); /* called when an option is changed */
32
33 batch_queue_id_t (*submit) (struct batch_queue *Q, struct batch_job *bt );
34 batch_queue_id_t (*wait) (struct batch_queue *Q, struct batch_job_info *info, time_t stoptime);
35 int (*remove) (struct batch_queue *Q, batch_queue_id_t id);
36};
37
40
41 char logfile[PATH_MAX];
42 struct hash_table *options;
43 struct hash_table *features;
44 struct itable *job_table;
45 struct hash_table *tv_file_table;
46 struct vine_manager *tv_manager;
47 struct work_queue *wq_manager;
48 const struct batch_queue_module *module;
49};
50
51#define batch_queue_stub_create(name) static int batch_queue_##name##_create (struct batch_queue *Q) { return 0; }
52#define batch_queue_stub_free(name) static int batch_queue_##name##_free (struct batch_queue *Q) { return 0; }
53#define batch_queue_stub_port(name) static int batch_queue_##name##_port (struct batch_queue *Q) { return 0; }
54#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; }
55
56#endif
57
58/* vim: set noexpandtab tabstop=8: */
Batch queue submission library.
int64_t batch_queue_id_t
An integer type indicating a unique batch job number.
Definition batch_queue.h:62
batch_queue_type_t
Indicates which type of batch submission to use.
Definition batch_queue.h:68
Create a new directory recursively.
A general purpose hash table.
An integer-indexed hash table.
Describes a batch job when it has completed.
Definition batch_job_info.h:13
Internal description of a single batch job submitted to a queue.
Definition batch_job.h:27
Definition batch_queue_internal.h:24
Definition batch_queue_internal.h:38