Skip to content

Commit

Permalink
Bugfix, remove "undefined" when args unspecified
Browse files Browse the repository at this point in the history
  • Loading branch information
ThFriedrich committed Sep 20, 2023
1 parent db4579a commit 91fc6b9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/task_fcns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ export function resolve_task(tsk: Task): Task | undefined {
const file = window.activeTextEditor?.document.fileName
const tdf: lmp_task = <any>tsk.definition;
const execution = new ShellExecution('')
let add_args:String = ''
if (tdf.args) {add_args = tdf.args}
if (tdf.mpi_tasks && tdf.gpu_nodes) { // Multi-Task GPU
execution.commandLine = `mpirun -np ${tdf.mpi_tasks.toString()} ${tdf.binary} -sf gpu -pk gpu ${tdf.gpu_nodes.toString()} -in ${file} ${tdf.args}`;
execution.commandLine = `mpirun -np ${tdf.mpi_tasks.toString()} ${tdf.binary} -sf gpu -pk gpu ${tdf.gpu_nodes.toString()} -in ${file} ${add_args}`;
}
else if (!tdf.mpi_tasks && tdf.gpu_nodes) { // Single-Task GPU
execution.commandLine = `${tdf.binary} -sf gpu -pk gpu ${tdf.gpu_nodes.toString()} -in ${file} ${tdf.args}`;
execution.commandLine = `${tdf.binary} -sf gpu -pk gpu ${tdf.gpu_nodes.toString()} -in ${file} ${add_args}`;
}
else if (tdf.mpi_tasks && !tdf.gpu_nodes) { // Multi-Task CPU
execution.commandLine = `mpirun -np ${tdf.mpi_tasks.toString()} ${tdf.binary} -in ${file} ${tdf.args}`;
execution.commandLine = `mpirun -np ${tdf.mpi_tasks.toString()} ${tdf.binary} -in ${file} ${add_args}`;
}
else { // Single-Task CPU
execution.commandLine = `${tdf.binary} -in ${file} ${tdf.args}`;
execution.commandLine = `${tdf.binary} -in ${file} ${add_args}`;
}
return new Task(
tdf,
Expand Down

0 comments on commit 91fc6b9

Please sign in to comment.