reformat code and job array

This commit is contained in:
Rongsong Shen 2025-11-07 16:14:27 +08:00
parent a665ccd4fe
commit 9ff857db9f
64 changed files with 1497 additions and 2476 deletions

View file

@ -22,60 +22,52 @@ typedef struct {
char* key;
} xce_client_config_t;
#define xcecli_jobfinish(ctx, finish) \
xcecli_notify_jobfinish(ctx, finish)
#define xcecli_jobfinish(ctx, finish) xcecli_notify_jobfinish(ctx, finish)
extern int xcecli_ctx_init(xcecli_ctx_t*, xce_client_config_t*);
extern void xcecli_ctx_fini(xcecli_ctx_t);
extern int xcecli_set_handler(xcecli_ctx_t, xce_request_handler_t);
extern int xcecli_start(xcecli_ctx_t);
extern int xcecli_stop(xcecli_ctx_t);
extern int xcecli_wakeup(xcecli_ctx_t, int);
extern int xcecli_hello(xcecli_ctx_t, char*);
extern int xcecli_shutdown(xcecli_ctx_t);
extern int xcecli_reslist(xcecli_ctx_t, xce_resource_t***);
extern int xcecli_join(xcecli_ctx_t, int, hostattrs_t*);
extern int xcecli_workerlist(xcecli_ctx_t, xce_worker_t***);
extern int xcecli_jobdispatch(xcecli_ctx_t, xce_job_dispatch_t*);
extern int xcecli_joblist(xcecli_ctx_t, xce_job_t***);
extern int xcecli_clusterconf(xcecli_ctx_t, xce_clusterconf_t**);
extern int xcecli_notify_jobfinish(xcecli_ctx_t, xce_jobfinish_t*);
extern int xcecli_notify_jobstart(xcecli_ctx_t, job_pidinfo_t*);
extern int xcecli_notify_jobfail(xcecli_ctx_t c, job_failinfo_t*);
extern int xcecli_notify_jobstop(xcecli_ctx_t, uint64_t);
extern int xcecli_notify_jobresume(xcecli_ctx_t, uint64_t);
extern int xcecli_notify_jobpostdone(xcecli_ctx_t, uint64_t);
extern int xcecli_jobsubmit(xcecli_ctx_t, xce_job_submit_t*,
uint64_t*);
extern int xcecli_update_resvals(xcecli_ctx_t, int, xce_resval_t**);
extern int xcecli_resval(xcecli_ctx_t, char*,
char*, xce_resval_t***);
extern int xcecli_update_jusage(xcecli_ctx_t, uint64_t, int, int*,
int, int*, int, xce_rusage_t**);
extern int xcecli_notify(xcecli_ctx_t, xce_notify_data_t*);
extern int xcecli_jobctrl(xcecli_ctx_t, xce_jobctrl_t*);
extern int xcecli_notify_jobchkpt(xcecli_ctx_t, uint64_t, char*);
extern int xcecli_queuectrl(xcecli_ctx_t, xce_queuectrl_t*);
extern int xcecli_runtask(xcecli_ctx_t, xce_taskrun_t*);
extern int xcecli_notify_taskstart(xcecli_ctx_t, xce_task_pidinfo_t*);
extern int xcecli_notify_taskfail(xcecli_ctx_t, xce_task_failinfo_t*);
extern int xcecli_notify_taskfinish(xcecli_ctx_t, xce_task_finish_t*);
extern int xcecli_ctx_init(xcecli_ctx_t*, xce_client_config_t*);
extern void xcecli_ctx_fini(xcecli_ctx_t);
extern int xcecli_set_handler(xcecli_ctx_t, xce_request_handler_t);
extern int xcecli_start(xcecli_ctx_t);
extern int xcecli_stop(xcecli_ctx_t);
extern int xcecli_wakeup(xcecli_ctx_t, int);
extern int xcecli_hello(xcecli_ctx_t, char*);
extern int xcecli_shutdown(xcecli_ctx_t);
extern int xcecli_reslist(xcecli_ctx_t, xce_resource_t***);
extern int xcecli_join(xcecli_ctx_t, int, hostattrs_t*);
extern int xcecli_workerlist(xcecli_ctx_t, xce_worker_t***);
extern int xcecli_jobdispatch(xcecli_ctx_t, xce_job_dispatch_t*);
extern int xcecli_joblist(xcecli_ctx_t, xce_job_t***);
extern int xcecli_clusterconf(xcecli_ctx_t, xce_clusterconf_t**);
extern int xcecli_notify_jobfinish(xcecli_ctx_t, xce_jobfinish_t*);
extern int xcecli_notify_jobstart(xcecli_ctx_t, job_pidinfo_t*);
extern int xcecli_notify_jobfail(xcecli_ctx_t c, job_failinfo_t*);
extern int xcecli_notify_jobstop(xcecli_ctx_t, uint64_t);
extern int xcecli_notify_jobresume(xcecli_ctx_t, uint64_t);
extern int xcecli_notify_jobpostdone(xcecli_ctx_t, uint64_t);
extern int xcecli_jobsubmit(xcecli_ctx_t, xce_job_submit_t*, uint64_t*);
extern int xcecli_update_resvals(xcecli_ctx_t, int, xce_resval_t**);
extern int xcecli_resval(xcecli_ctx_t, char*, char*, xce_resval_t***);
extern int xcecli_update_jusage(xcecli_ctx_t, uint64_t, int, int*, int, int*,
int, xce_rusage_t**);
extern int xcecli_notify(xcecli_ctx_t, xce_notify_data_t*);
extern int xcecli_jobctrl(xcecli_ctx_t, xce_jobctrl_t*);
extern int xcecli_notify_jobchkpt(xcecli_ctx_t, uint64_t, char*);
extern int xcecli_queuectrl(xcecli_ctx_t, xce_queuectrl_t*);
extern int xcecli_runtask(xcecli_ctx_t, xce_taskrun_t*);
extern int xcecli_notify_taskstart(xcecli_ctx_t, xce_task_pidinfo_t*);
extern int xcecli_notify_taskfail(xcecli_ctx_t, xce_task_failinfo_t*);
extern int xcecli_notify_taskfinish(xcecli_ctx_t, xce_task_finish_t*);
extern endpoint_t* xcecli_get_my_endpoint(xcecli_ctx_t);
extern xce_peerinfo_t* xcecli_get_myinfo(xcecli_ctx_t);
extern void xcecli_block_tasks(xcecli_ctx_t);
extern void xcecli_unblock_tasks(xcecli_ctx_t);
#define xcecli_free_ress(nres, ress) \
xce_free_ress(nres, ress)
#define xcecli_free_workers(nworkers, workers) \
#define xcecli_free_ress(nres, ress) xce_free_ress(nres, ress)
#define xcecli_free_workers(nworkers, workers) \
xce_free_workers(nworkers, workers)
#define xcecli_free_jobs(njobs, jobs) \
xce_free_jobs(njobs, jobs)
#define xcecli_free_queues(nqueues, queues) \
xce_free_queues(nqueues, queues)
#define xcecli_free_groups(ngroups, groups) \
xce_free_groups(ngroups, groups)
#define xcecli_free_clusterconf(conf) \
xce_free_clusterconf(conf)
#define xcecli_free_jobs(njobs, jobs) xce_free_jobs(njobs, jobs)
#define xcecli_free_queues(nqueues, queues) xce_free_queues(nqueues, queues)
#define xcecli_free_groups(ngroups, groups) xce_free_groups(ngroups, groups)
#define xcecli_free_clusterconf(conf) xce_free_clusterconf(conf)
#endif

View file

@ -2,8 +2,12 @@
#define _CONFIG_H_
#define BUG_EMAIL "rshen@shenrs.eu"
#define DEFAULT_WORKDIR "/tmp/xce"
#include <stdint.h>
typedef uint64_t jobid_t;
#define BUG_EMAIL "rshen@shenrs.eu"
#define DEFAULT_WORKDIR "/tmp/xce"
#define XCE_MAXNAME_LEN (64)
#define XCE_MAXHOSTNAME_LEN (256) /* hostname suggest to 256 */
@ -19,4 +23,34 @@
#define XCE_MAXCMD_LEN (4096)
#define XCE_MAX_ERRMSG_LEN (4096)
#define N_JOBID_BITS (sizeof(jobid_t) * 8)
#define N_CLUSTER_ID_BITS (6)
#define CLUSTER_ID_SHIFT (N_JOBID_BITS - N_CLUSTER_ID_BITS)
#define N_APISERVER_ID_BITS (4)
#define APISERVER_ID_SHIFT (CLUSTER_ID_SHIFT - N_APISERVER_ID_BITS)
#define N_TIMESTAMP_BITS (32)
#define TIMESTAMP_SHIFT (APISERVER_ID_SHIFT - N_TIMESTAMP_BITS)
#define N_TAG_BITS (2)
#define TAG_SHIFT (TIMESTAMP_SHIFT - N_TAG_BITS)
#define N_ARRAY_IDX_BITS (15)
#define TAG_JOB_ARRAY (0x01)
#define N_SEQENCE_BITS \
(N_JOBID_BITS - N_CLUSTER_ID_BITS - N_APISERVER_ID_BITS - N_TIMESTAMP_BITS \
- N_TAG_BITS)
#define SEQUENCE_HIGH_SHIFT (N_ARRAY_IDX_BITS)
#define UMAX_BITS(w) ((((uint64_t)0x01) << (int)w) - 1)
#define MAX_CLUSTER_ID (UMAX_BITS(N_CLUSTER_ID_BITS))
#define MAX_APISERVER_ID (UMAX_BITS(N_APISERVER_ID_BITS))
#define MAX_ARRAY_IDX (UMAX_BITS(N_ARRAY_IDX_BITS))
#endif

View file

@ -22,8 +22,7 @@ typedef struct {
} hooksys_t;
extern int xce_hook_init(hooksys_t*, int);
extern int xce_add_hook(hooksys_t*, int,
hook_fn_t, void*);
extern int xce_add_hook(hooksys_t*, int, hook_fn_t, void*);
extern int xce_run_hooks(hooksys_t*, int, int, int, ...);
extern void xce_hook_fini(hooksys_t*);

View file

@ -34,8 +34,7 @@ typedef struct {
extern hash_key_fn_t string_hash_key;
extern hash_key_fn_t int_hash_key;
extern int ht_init(htab_t*, int,
hash_key_fn_t);
extern int ht_init(htab_t*, int, hash_key_fn_t);
extern void ht_fini(htab_t*);
extern hent_t* ht_get(htab_t*, void*);
extern hent_t* ht_add(htab_t*, void*);

View file

@ -13,10 +13,8 @@ typedef struct {
zarray_t data;
} kvmgr_t;
extern int kvmgr_init(kvmgr_t*, hash_key_fn_t,
int, int,
zarray_item_killer_t);
extern void kvmgr_fini(kvmgr_t*);
extern int kvmgr_init(kvmgr_t*, hash_key_fn_t, int, int, zarray_item_killer_t);
extern void kvmgr_fini(kvmgr_t*);
extern void* kvmgr_lock(kvmgr_t*, void*, int);
extern int32_t kvmgr_add(kvmgr_t*, void*, void*);
extern void kvmgr_del(kvmgr_t*, void*);

View file

@ -14,13 +14,13 @@
#define OBJ_MAGIC (0x4a424f58)
#define OBJREF_NOP (0) /* ref obj without lock, \
#define OBJREF_NOP \
(0) /* ref obj without lock, \
* just keep object alive */
#define OBJREF_READ (1) /* ref obj with read lock */
#define OBJREF_UPDATE (2) /* ref obj with write lock */
typedef void* (*obj_create_fn_t)(void*, void*,
va_list);
typedef void* (*obj_create_fn_t)(void*, void*, va_list);
typedef void (*obj_fini_fn_t)(void*);
typedef void (*objtype_fini_fn_t)(void*);
@ -50,16 +50,14 @@ typedef struct {
zarray_t types;
} objmgr_t;
#define MYOBJ_TO_OBJ(type, myobj) \
((type)(((char*)myobj) + sizeof(myobj_t)))
#define MYOBJ_TO_OBJ(type, myobj) ((type)(((char*)myobj) + sizeof(myobj_t)))
#define TO_MYOBJ(obj) \
((myobj_t*)(((char*)obj) - sizeof(myobj_t)))
#define TO_MYOBJ(obj) ((myobj_t*)(((char*)obj) - sizeof(myobj_t)))
#define DEREF_OBJ(obj) \
if ((obj) != NULL) { \
obj_deref(obj); \
(obj) = NULL; \
#define DEREF_OBJ(obj) \
if ((obj) != NULL) { \
obj_deref(obj); \
(obj) = NULL; \
}
extern int objmgr_init(objmgr_t*);

View file

@ -25,8 +25,7 @@ typedef struct {
uint32_t nrefs;
} ioctx_t;
#define ITPTR_TO_IOCTX(p) \
((ioctx_t*)(((char*)p) - offsetof(ioctx_t, link)))
#define ITPTR_TO_IOCTX(p) ((ioctx_t*)(((char*)p) - offsetof(ioctx_t, link)))
typedef int (*xce_check_fn_t)(void*);
@ -43,35 +42,29 @@ extern int xce_nop_req(ioctx_t*);
extern int xce_shutdown_req(ioctx_t*);
extern void init_reply_by_req(xce_reply_t*, xce_request_t*);
extern int xce_join_req(ioctx_t*, int, hostattrs_t*);
extern int xce_pushconfig_req(endpoint_t*,
xce_peerinfo_t*,
xce_configdata_t*);
extern int xce_push_data_req(endpoint_t*, xce_peerinfo_t*,
xce_data_t*, xce_check_fn_t,
void*, int);
extern int xce_pushconfig_req(endpoint_t*, xce_peerinfo_t*, xce_configdata_t*);
extern int xce_push_data_req(endpoint_t*, xce_peerinfo_t*, xce_data_t*,
xce_check_fn_t, void*, int);
extern int xce_workerlist_req(ioctx_t*, xce_peerinfo_t*);
extern int xce_reply_workerlist(endpoint_t*, uint64_t, int,
xce_peerinfo_t*, xce_workerlist_t*);
extern int xce_reply_workerlist(endpoint_t*, uint64_t, int, xce_peerinfo_t*,
xce_workerlist_t*);
extern int xce_jobdispatch_req(ioctx_t*, xce_job_dispatch_t*);
extern int xce_jobsubmit_req(ioctx_t*, xce_job_submit_t*);
extern int xce_reply_jobdispatch(endpoint_t*, uint64_t, int32_t,
xce_peerinfo_t*);
extern int xce_reply_jobid(endpoint_t*, int,
uint64_t, uint64_t,
extern int xce_reply_jobid(endpoint_t*, int, uint64_t, uint64_t,
xce_peerinfo_t*);
extern int xce_joblist_req(ioctx_t*, xce_peerinfo_t*);
extern int xce_reply_joblist(endpoint_t*, uint64_t, int,
xce_peerinfo_t*, xce_job_list_t*);
extern int xce_reply_joblist(endpoint_t*, uint64_t, int, xce_peerinfo_t*,
xce_job_list_t*);
extern int xce_startjob_req(ioctx_t*, xce_job_exec_t*);
extern int xce_clusterconf_req(ioctx_t*);
extern int xce_reply_clusterconf(endpoint_t*, uint64_t, int,
xce_peerinfo_t*,
extern int xce_reply_clusterconf(endpoint_t*, uint64_t, int, xce_peerinfo_t*,
xce_clusterconf_t*);
extern int xce_get_req(ioctx_t*, xce_get_t*);
extern int xce_reply_get(endpoint_t*, xce_peerinfo_t*,
xce_reply_t*, xce_check_fn_t,
void*, int);
extern int xce_reply_get(endpoint_t*, xce_peerinfo_t*, xce_reply_t*,
xce_check_fn_t, void*, int);
extern int xce_notify_req(ioctx_t*, xce_notify_data_t*);
extern int extract_data(dataset_t*, xce_data_t*);
extern int xce_update_req(ioctx_t*, xce_update_data_t*);

View file

@ -14,6 +14,12 @@
#include "xce/errnox.h"
#include "xce/types.h"
#define MAKE_JOBID(cluster, apiserver, timestamp, tag, sequence) \
((((uint64_t)cluster) << CLUSTER_ID_SHIFT) \
| (((uint64_t)apiserver) << APISERVER_ID_SHIFT) \
| (((uint64_t)timestamp) << TIMESTAMP_SHIFT) \
| (((uint64_t)tag) << TAG_SHIFT) | sequence)
#define xce_use(x) (void)(x)
#define float_near_zero (0.000001)
@ -26,36 +32,31 @@
#define MK_VERSION(ver, commit) ver commit
#ifndef FREEUP
#define FREEUP(p) \
if ((p) != NULL) { \
free(p); \
(p) = NULL; \
#define FREEUP(p) \
if ((p) != NULL) { \
free(p); \
(p) = NULL; \
}
#endif
#define N_EL_ARRAY(arr) (sizeof(arr) / sizeof(arr[0]))
#define PTR_STEP(p, delta) \
((void*)(((char*)p) + (delta)))
#define N_EL_ARRAY(arr) (sizeof(arr) / sizeof(arr[0]))
#define PTR_STEP(p, delta) ((void*)(((char*)p) + (delta)))
#define N_EL_ARRAY(arr) (sizeof(arr) / sizeof(arr[0]))
#define PTR_STEP(p, delta) \
((void*)(((char*)p) + (delta)))
#define N_EL_ARRAY(arr) (sizeof(arr) / sizeof(arr[0]))
#define PTR_STEP(p, delta) ((void*)(((char*)p) + (delta)))
/* move the owner ship of pointer from src to dst */
#define MOVE_PTR(dst, src) \
do { \
(dst) = (src); \
(src) = NULL; \
#define MOVE_PTR(dst, src) \
do { \
(dst) = (src); \
(src) = NULL; \
} while (0)
#define NULLSTR(p) (((p) == NULL) || (strlen(p) == 0))
#define SET_ERROR(code) \
do { \
set_error((char*)__FILE__, \
(char*)__func__, \
__LINE__, \
(code)); \
#define SET_ERROR(code) \
do { \
set_error((char*)__FILE__, (char*)__func__, __LINE__, (code)); \
} while (0)
#define TRACE(...) tlog_debug3(__VA_ARGS__)
@ -75,26 +76,26 @@ typedef struct {
int code;
} ectx_t;
extern capn_text chars_to_text(const char*);
extern int parse_argv(char*, char***);
extern void free_argv(char**, int);
extern void freeup_kvs(int, xce_kv_t*);
extern int mylog_init(char*, char*, int, int);
extern void mylog_fini(void);
extern int mylog_setlevel(char*);
extern void set_error(char*, char*, int, int);
extern ectx_t* get_ectx(void);
extern int xce_vprintf(const char*, va_list);
extern int xce_strerror_r(int, char*, size_t);
extern void xce_perror(const char*);
extern char* frame_symbol(int);
extern int copy_int_list(int**, int*, int);
extern int copy_strlist(xce_strlist_t*, xce_strlist_t);
extern void free_timewindow_config(xce_timewindow_config_t*);
extern int parse_argv(char*, char***);
extern void free_argv(char**, int);
extern int get_myname(char*, size_t);
extern int mylog_init(char*, char*, int, int);
extern void mylog_fini(void);
extern int mylog_setlevel(char*);
extern void set_error(char*, char*, int, int);
extern ectx_t* get_ectx(void);
extern int xce_vprintf(const char*, va_list);
extern int xce_strerror_r(int, char*, size_t);
extern void xce_perror(const char*);
extern char* frame_symbol(int);
extern int copy_int_list(int**, int*, int);
extern int copy_strlist(xce_strlist_t*, xce_strlist_t);
extern void free_timewindow_config(xce_timewindow_config_t*);
extern xce_timewindow_config_t* dup_timewindow_config(xce_timewindow_config_t*);
extern void free_resource_thresholds(xce_res_threshold_t**, int);
extern xce_res_threshold_t** dup_resource_thresholds(xce_res_threshold_t**, int);
extern void free_resval_with_idx_list(xce_val_with_idx_t***, int);
extern void free_strlist(xce_strlist_t*);
extern void free_resource_thresholds(xce_res_threshold_t**, int);
extern xce_res_threshold_t** dup_resource_thresholds(xce_res_threshold_t**,
int);
extern void free_resval_with_idx_list(xce_val_with_idx_t***, int);
extern void free_strlist(xce_strlist_t*);
#endif

View file

@ -19,7 +19,7 @@ typedef struct {
vtask_func_t entry;
} vtask_t;
#define ITPTR_TO_VTASK(p) \
#define ITPTR_TO_VTASK(p) \
((vtask_t*)(((char*)p) - offsetof(ioctx_t, link) - offsetof(vtask_t, ctx)))
typedef enum {

View file

@ -170,16 +170,12 @@ typedef struct {
#define XCE_WORKER_BUSY (0x00080000)
#define XCE_WORKER_CLOSED (0x00100000)
#define IS_WORKER_UNAVAIL(status) \
(((status) & XCE_WORKER_UNAVAIL) != 0)
#define IS_WORKER_LOCKEDU(status) \
(((status) & XCE_WORKER_LOCKEDU) != 0)
#define IS_WORKER_LOCKEDW(status) \
(((status) & XCE_WORKER_LOCKEDW) != 0)
#define IS_WORKER_LOCKED(status) \
#define IS_WORKER_UNAVAIL(status) (((status) & XCE_WORKER_UNAVAIL) != 0)
#define IS_WORKER_LOCKEDU(status) (((status) & XCE_WORKER_LOCKEDU) != 0)
#define IS_WORKER_LOCKEDW(status) (((status) & XCE_WORKER_LOCKEDW) != 0)
#define IS_WORKER_LOCKED(status) \
(IS_WORKER_LOCKEDU(status) || IS_WORKER_LOCKEDW(status))
#define IS_WORKER_BUSY(status) \
(((status) & XCE_WORKER_BUSY) != 0)
#define IS_WORKER_BUSY(status) (((status) & XCE_WORKER_BUSY) != 0)
typedef struct {
char* hosttype;
@ -303,25 +299,29 @@ typedef struct {
int exitcode;
} job_exitinfo_t;
#define JOB_STAT_NULL 0x00 /**< NULL. */
#define JOB_STAT_PEND 0x01 /**< Job is submitted. */
#define JOB_STAT_RUN 0x02 /**< Job is running. */
#define JOB_STAT_EXIT 0x04 /**< Job is exit. */
#define JOB_STAT_DONE 0x08 /**< Job is done. */
#define JOB_STAT_PSUSP 0x10 /**< Job is pending and suspend*/
#define JOB_STAT_USUSP 0x20 /**< Job is user suspend*/
#define JOB_STAT_SSUSP 0x40 /**< Job is system suspend*/
#define JOB_STAT_NULL 0x00 /**< NULL. */
#define JOB_STAT_PEND 0x01 /**< Job is submitted. */
#define JOB_STAT_RUN 0x02 /**< Job is running. */
#define JOB_STAT_EXIT 0x04 /**< Job is exit. */
#define JOB_STAT_DONE 0x08 /**< Job is done. */
#define JOB_STAT_PSUSP 0x10 /**< Job is pending and suspend*/
#define JOB_STAT_USUSP 0x20 /**< Job is user suspend*/
#define JOB_STAT_SSUSP 0x40 /**< Job is system suspend*/
#define JOB_STAT_PDONE (0x80) /**< Post job process done successfully */
#define JOB_STAT_PERR (0x100) /**< Post job process has error */
#define JOB_STAT_WAIT (0x200) /**< Chunk job waiting its turn to exec */
#define JOB_STAT_RUNKWN 0x8000 /* Flag : Job status is UNKWN caused by losting contact with remote cluster */
#define JOB_STAT_UNKWN 0x10000 /**< The worker on the host on which the \
* job is processed has lost contact with controller */
#define JOB_STAT_PROV (0x20000) /**< this state shows that the job is dispatched to a standby \
* power saved host, and this host is \
* being waken up or started up */
#define JOB_STAT_ERR (0x40000) /**ERROR */
#define JOB_STAT_PDONE (0x80) /**< Post job process done successfully */
#define JOB_STAT_PERR (0x100) /**< Post job process has error */
#define JOB_STAT_WAIT (0x200) /**< Chunk job waiting its turn to exec */
#define JOB_STAT_RUNKWN \
0x8000 /* Flag : Job status is UNKWN caused by losting contact with remote \
cluster */
#define JOB_STAT_UNKWN \
0x10000 /**< The worker on the host on which the \
* job is processed has lost contact with controller */
#define JOB_STAT_PROV \
(0x20000) /**< this state shows that the job is dispatched to a standby \
* power saved host, and this host is \
* being waken up or started up */
#define JOB_STAT_ERR (0x40000) /**ERROR */
#define JOB_EXEC_STAGE_Q_PRE_EXEC (0)
#define JOB_EXEC_STAGE_PRE_EXEC (1)
@ -329,13 +329,15 @@ typedef struct {
#define JOB_EXEC_STAGE_POST_EXEC (3)
#define JOB_EXEC_STAGE_Q_POST_EXEC (4)
#define QUEUE_STAT_OPEN 0x00 /**< OPEN. */
#define QUEUE_STAT_CLOSED 0x01 /**< The queue is closed */
#define QUEUE_STAT_INACT_WINDOW 0x02 /**< The queue inactivated due to dispatch or run windows closed */
#define QUEUE_STAT_INACT_ADMIN 0x04 /**< The queue inactivated by admin */
#define QUEUE_STAT_NOPERM 0x08 /**< Remote queue rejecting jobs. */
#define QUEUE_STAT_DISC 0x10 /**< Remote queue status is disconnected. */
#define QUEUE_STAT_FAIRSHARE_DEFAULT 0x20 /**< Fairshare queue with null user share defined*/
#define QUEUE_STAT_OPEN 0x00 /**< OPEN. */
#define QUEUE_STAT_CLOSED 0x01 /**< The queue is closed */
#define QUEUE_STAT_INACT_WINDOW \
0x02 /**< The queue inactivated due to dispatch or run windows closed */
#define QUEUE_STAT_INACT_ADMIN 0x04 /**< The queue inactivated by admin */
#define QUEUE_STAT_NOPERM 0x08 /**< Remote queue rejecting jobs. */
#define QUEUE_STAT_DISC 0x10 /**< Remote queue status is disconnected. */
#define QUEUE_STAT_FAIRSHARE_DEFAULT \
0x20 /**< Fairshare queue with null user share defined*/
typedef enum {
NORMAL = 0,

View file

@ -13,22 +13,19 @@ extern int xce_reslist(xce_ctx_t*, xce_resource_t***);
extern int xce_join(xce_ctx_t*, int, hostattrs_t*);
extern int xce_workerlist(xce_ctx_t*, xce_worker_t***);
extern int xce_jobdispatch(xce_ctx_t*, xce_job_dispatch_t*);
extern int xce_jobsubmit(xce_ctx_t*, xce_job_submit_t*,
uint64_t*);
extern int xce_jobsubmit(xce_ctx_t*, xce_job_submit_t*, uint64_t*);
extern int xce_joblist(xce_ctx_t*, xce_job_t***);
extern int xce_clusterconf(xce_ctx_t*, xce_clusterconf_t**);
extern int xce_push(xce_ctx_t*, xce_check_fn_t,
void*, int, int, int, void**);
extern int xce_push(xce_ctx_t*, xce_check_fn_t, void*, int, int, int, void**);
extern int xce_update_rows(xce_ctx_t*, int, int, xlist_t*);
extern int xce_resval(xce_ctx_t*, char*,
char*, xce_resval_t***);
extern int xce_resval(xce_ctx_t*, char*, char*, xce_resval_t***);
extern int xce_notify(xce_ctx_t*, xce_notify_data_t*);
extern int xce_update_resvals(xce_ctx_t*, int, xce_resval_t**);
extern int xce_jobctrl(xce_ctx_t*, xce_jobctrl_t*);
extern int xce_queuectrl(xce_ctx_t*, xce_queuectrl_t*);
extern int xce_runtask(xce_ctx_t*, xce_taskrun_t*);
extern int xce_update_jusage(xce_ctx_t*, uint64_t, int,
int*, int, int*, int, xce_rusage_t**);
extern int xce_update_jusage(xce_ctx_t*, uint64_t, int, int*, int, int*, int,
xce_rusage_t**);
#endif

View file

@ -39,8 +39,7 @@ typedef struct {
extern int xce_ctx_init(xce_ctx_t*, char*, char*);
extern void xce_ctx_fini(xce_ctx_t*);
extern int xce_ctx_set_handler(xce_ctx_t*,
xce_request_handler_t);
extern int xce_ctx_set_handler(xce_ctx_t*, xce_request_handler_t);
extern int xce_ctx_start(xce_ctx_t*);
extern int xce_ctx_stop(xce_ctx_t*);
extern int xce_wakeup(xce_ctx_t*, int);

View file

@ -9,15 +9,14 @@ typedef struct {
zarray_t strings;
} xstring_typedata_t;
#define XSTRING_OBJ_TYPE_HTAB(obj) \
#define XSTRING_OBJ_TYPE_HTAB(obj) \
(((xstring_typedata_t*)obj->type->typedata)->tab)
#define XSTRING_OBJ_TYPE_STRINGS(obj) \
#define XSTRING_OBJ_TYPE_STRINGS(obj) \
(((xstring_typedata_t*)obj->type->typedata)->strings)
#define XSTRING_TYPE_HTAB(type) \
(((xstring_typedata_t*)type->typedata)->tab)
#define XSTRING_TYPE_HTAB(type) (((xstring_typedata_t*)type->typedata)->tab)
#define XSTRING_TYPE_STRINGS(type) \
#define XSTRING_TYPE_STRINGS(type) \
(((xstring_typedata_t*)type->typedata)->strings)
extern int register_xstring(objmgr_t*, int, int);

View file

@ -18,8 +18,7 @@ typedef struct {
void** data;
} zarray_t;
extern int zarray_init(zarray_t*, int,
zarray_item_killer_t);
extern int zarray_init(zarray_t*, int, zarray_item_killer_t);
extern int zarray_store(zarray_t*, void*);
extern int zarray_clear(zarray_t*, int);
extern int zarray_iter_ex(zarray_t*, xlist_t*, void*);