Skip to content

Commit

Permalink
Merge branch 'feature/lsf' of https://github.com/stjude-biohackathon/…
Browse files Browse the repository at this point in the history
…KIDS24-team15 into feature/lsf
  • Loading branch information
a-frantz committed Sep 5, 2024
2 parents 1551ca5 + 3fc39e9 commit 20ca749
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/engine/service/runner/backend/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ use futures::FutureExt;
use nonempty::NonEmpty;
use tokio::sync::oneshot::Sender;

use crate::engine::{
service::runner::backend::backend_config::substitute_placeholders, task::resources, Task,
};
use crate::engine::{service::runner::backend::backend_config::substitute_placeholders, Task};

use super::{
backend_config::{BackendConfig, BackendType},
Backend, ExecutionResult, Reply,
};

/// cwd parameter name for lsf
const CWD: &str = "cwd";
/// memory parameter name for lsf
const MEMORY: &str = "memory";

/// A generic backend
#[derive(Debug)]
pub struct GenericBackend {
Expand Down Expand Up @@ -111,13 +114,13 @@ impl Backend for GenericRunner {
};

if let Some(cwd) = exec.workdir() {
substitutions.insert("cwd".to_string(), cwd.to_string());
substitutions.insert(CWD.to_string(), cwd.to_string());
}

if let Some(resources) = task.resources() {
if let Some(gb) = resources.ram_gb() {
substitutions
.insert("mem".to_string(), ((gb * 1000f64) as usize).to_string());
.insert(MEMORY.to_string(), ((gb * 1000f64) as usize).to_string());
}
}

Expand Down

0 comments on commit 20ca749

Please sign in to comment.