Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#ifndef __MXQ_SERVER_H__
#define __MXQ_SERVER_H__ 1
#include "mx_mysql.h"
#include "mxq_job.h"
#include "mxq_group.h"
#include "mxq_daemon.h"
#include "keywordset.h"
#include <sched.h>
enum job_killevent {
KILLEVENT_CHECK, // time passed, check timeouts
KILLEVENT_OVERTIME, // job is over time
KILLEVENT_OVERMEMORY, // job is over memory
KILLEVENT_CANCEL, // job is cancelled (user or non-gracefull server shutdown)
};
enum job_killstate {
KILLSTATE_RUNNING = 0, // (initial)
KILLSTATE_WAIT_TERM, // (after overtime) XCPU has been sent, waiting for timeout to send TERM and KILL
KILLSTATE_WAIT_KILL, // TERM has been sent, waiting for timeout to send (next) KILL
};
struct mxq_job_list {
struct mxq_group_list *group;
struct mxq_job_list *next;
struct mxq_job job;
unsigned long long int max_sumrss;
enum job_killstate killstate;
time_t next_signal_at_uptime_seconds;
};
struct mxq_group_list {
struct mxq_user_list *user;
struct mxq_group_list *next;
struct mxq_group group;
struct mxq_job_list *jobs;
unsigned long job_cnt;
long double memory_per_job_thread;
unsigned long slots_per_job;
long double memory_available_for_group;
unsigned long memory_max;
unsigned long slots_max;
unsigned long jobs_max;
unsigned long jobs_running;
unsigned long threads_running;
unsigned long slots_running;
unsigned long memory_used;
unsigned long global_threads_running;
unsigned long global_slots_running;
short orphaned;
};
struct mxq_user_list {
struct mxq_server *server;
struct mxq_user_list *next;
struct mxq_group_list *groups;
unsigned long group_cnt;
unsigned long job_cnt;
unsigned long jobs_running;
unsigned long threads_running;
unsigned long slots_running;
unsigned long memory_used;
unsigned long global_threads_running;
unsigned long global_slots_running;
};
struct mxq_server {
struct mxq_user_list *users;
struct mxq_daemon daemon;
unsigned long user_cnt;
unsigned long group_cnt;
unsigned long job_cnt;
unsigned long jobs_running;
unsigned long threads_running;
unsigned long slots_running;
unsigned long memory_used;
cpu_set_t cpu_set_running;
unsigned long global_threads_running;
unsigned long global_slots_running;
unsigned long slots;
unsigned long memory_total;
long double memory_avg_per_slot;
unsigned long memory_limit_slot_soft;
unsigned long memory_limit_slot_hard;
unsigned long maxtime;
cpu_set_t cpu_set_available;
struct mx_mysql *mysql;
char *boot_id;
unsigned long long int starttime;
char *host_id;
char *hostname;
char *hostname_short;
char *daemon_name;
char *pidfilename;
char *finished_jobsdir;
struct mx_flock *flock;
char *initial_path;
char *initial_tmpdir;
char recoveronly;
size_t supgid_cnt;
gid_t *supgid;
struct keywordset *tags;
};
#endif