snakemake-executor-plugin-sge 0.6.2__tar.gz → 0.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snakemake-executor-plugin-sge
3
- Version: 0.6.2
3
+ Version: 0.6.4
4
4
  Summary: A Snakemake executor plugin for submitting jobs to SGE/UGE/OGS clusters.
5
5
  License: MIT
6
6
  Keywords: snakemake,plugin,executor,cluster,sge,uge,gridengine
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "snakemake-executor-plugin-sge"
3
- version = "0.6.2"
3
+ version = "0.6.4"
4
4
  description = "A Snakemake executor plugin for submitting jobs to SGE/UGE/OGS clusters."
5
5
  authors = ["Stylianos Charalampous <stylianosc@github.com>"]
6
6
  readme = "README.md"
@@ -743,8 +743,10 @@ class Executor(RemoteExecutor):
743
743
  else f"rule_{jobs[0].name}"
744
744
  )
745
745
 
746
- # Determine array-specific log directory from first job's workdir resource
747
- first_job_logdir = self._get_job_logdir(jobs[0])
746
+ # Array jobs share one -o/-e path across all tasks, so per-task workdir
747
+ # paths are not usable. Always use the main workflow log directory so
748
+ # logs from different subjects don't pile up in the first subject's folder.
749
+ first_job_logdir = self.sge_logdir_default
748
750
  first_job_logdir.mkdir(parents=True, exist_ok=True)
749
751
 
750
752
  # Helper files (manifests, scripts, task maps) are stored in .meta subdirectory
@@ -851,9 +853,10 @@ class Executor(RemoteExecutor):
851
853
  script_path.write_text(script_content)
852
854
  script_path.chmod(0o755)
853
855
 
854
- # Use first job's workdir resource if available, else fall back to workflow workdir
855
- workdir = jobs[0].resources.get("workdir") if hasattr(jobs[0], "resources") else None
856
- workdir = workdir or self.workflow.workdir_init
856
+ # Use the main workflow workdir for the qsub -wd flag. Individual
857
+ # task commands in the task map already carry full absolute paths, so
858
+ # the array-level working directory only needs to be a valid directory.
859
+ workdir = str(self.workflow.workdir_init)
857
860
 
858
861
  job_params = {
859
862
  "run_uuid": self.run_uuid,
@@ -300,13 +300,16 @@ def get_submit_command(
300
300
  f" -N {_safe(job_name)}"
301
301
  )
302
302
 
303
- # Stdout/stderr: pass the log *directory*; SGE appends .oJOBID.TASKID
304
- # Use -o dir/ -e dir/ (trailing slash = treat as directory on most SGE)
305
- call += f" -o {_safe(str(log_dir) + '/')}"
303
+ # Stdout/stderr: specify exact log file paths using SGE variable expansion
304
+ # $JOB_ID expands to the job ID, $TASK_ID expands to the array task index
305
+ # This produces logs named like "1234567.1.log" (jobid.taskid.log)
306
+ log_stdout_path = log_dir / "$JOB_ID.$TASK_ID.log"
307
+ call += f" -o {_safe(str(log_stdout_path))}"
306
308
  if join_logs:
307
309
  call += " -j y"
308
310
  else:
309
- call += f" -e {_safe(str(log_dir) + '/')}"
311
+ log_stderr_path = log_dir / "$JOB_ID.$TASK_ID.error"
312
+ call += f" -e {_safe(str(log_stderr_path))}"
310
313
 
311
314
  # ── working directory ──────────────────────────────────────────────
312
315
  if workdir: