Skip to content

Commit

Permalink
get rid of DEBUG in favor of log
Browse files Browse the repository at this point in the history
  • Loading branch information
ntBre committed Jul 31, 2024
1 parent 6423eda commit 38225fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
2 changes: 0 additions & 2 deletions src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ mod drain;

pub use drain::Check;

static DEBUG: bool = false;

#[derive(PartialEq, Eq, Debug)]
pub struct Resubmit {
pub inp_file: String,
Expand Down
26 changes: 11 additions & 15 deletions src/queue/drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
queue::drain::{dump::Dump, resub::ResubOutput},
};

use super::{Queue, DEBUG};
use super::Queue;

/// time the duration of `$body` and store the resulting Duration in `$elapsed`
#[macro_export]
Expand Down Expand Up @@ -263,13 +263,11 @@ pub(crate) trait Drain {
qstat.insert(job_id);
cur_jobs.extend(jobs);
}
if DEBUG {
eprintln!(
"finished {} jobs in {:.1} s",
finished,
loop_time.elapsed().as_millis() as f64 / 1000.0
);
}
log::debug!(
"finished {} jobs in {:.1} s",
finished,
loop_time.elapsed().as_millis() as f64 / 1000.0
);
if cur_jobs.len().saturating_sub(failed_jobs.len()) == 0
&& out_of_jobs
{
Expand Down Expand Up @@ -414,13 +412,11 @@ pub(crate) trait Drain {
queue.build_chunk(dir, jobs, chunk_num, self.procedure());
let job_id = jobs[0].job_id.clone();
let elapsed = now.elapsed();
if DEBUG {
eprintln!(
"submitted chunk {} after {:.1} s",
chunk_num,
elapsed.as_millis() as f64 / 1000.0
);
}
log::debug!(
"submitted chunk {} after {:.1} s",
chunk_num,
elapsed.as_millis() as f64 / 1000.0
);
(jobs.to_vec(), slurm_jobs, job_id, wi, ws, ss, chunk_num)
})
.collect();
Expand Down

0 comments on commit 38225fc

Please sign in to comment.