Skip to content

Commit

Permalink
Small fixups lsf driver
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 19, 2023
1 parent 1270e90 commit df78841
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/clib/lib/job_queue/lsf_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ struct lsf_driver_struct {
std::vector<std::string> exclude_hosts{};
char *login_shell = nullptr;
char *project_code = nullptr;
pthread_mutex_t submit_lock;
pthread_mutex_t submit_lock{};

lsf_submit_method_enum submit_method = LSF_SUBMIT_LOCAL_SHELL;
int submit_sleep = 0;
Expand All @@ -114,15 +114,15 @@ struct lsf_driver_struct {
/*-----------------------------------------------------------------*/
/* Fields used by the shell based functions */
bool debug_output = false;
int bjobs_refresh_interval;
int bjobs_refresh_interval = 0;
time_t last_bjobs_update = time(nullptr);
/** A hash table of all jobs submitted by this ERT instance - to ensure
* that we do not check status of old jobs in e.g. ZOMBIE status. */
hash_type *my_jobs;
/** The output of calling bjobs is cached in this table. */
hash_type *bjobs_cache;
/** Only one thread should update the bjobs_chache table. */
pthread_mutex_t bjobs_mutex;
pthread_mutex_t bjobs_mutex{};
char *remote_lsf_server = nullptr;
char *rsh_cmd = nullptr;
char *bsub_cmd = nullptr;
Expand Down Expand Up @@ -922,8 +922,6 @@ static void lsf_driver_shell_init(lsf_driver_type *lsf_driver) {
lsf_driver->last_bjobs_update = time(nullptr);
lsf_driver->bjobs_cache = hash_alloc();
lsf_driver->my_jobs = hash_alloc();

pthread_mutex_init(&lsf_driver->bjobs_mutex, nullptr);
}

bool lsf_driver_has_project_code(const lsf_driver_type *driver) {
Expand All @@ -932,7 +930,6 @@ bool lsf_driver_has_project_code(const lsf_driver_type *driver) {

void *lsf_driver_alloc() {
lsf_driver_type *lsf_driver = new lsf_driver_type();
pthread_mutex_init(&lsf_driver->submit_lock, nullptr);
lsf_driver_shell_init(lsf_driver);

lsf_driver_set_option(lsf_driver, LSF_SERVER, NULL);
Expand Down

0 comments on commit df78841

Please sign in to comment.