libpipe 0.9__tar.gz → 0.9.1__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,18 +1,17 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: libpipe
3
- Version: 0.9
3
+ Version: 0.9.1
4
4
  Summary: Pipeline orchestration and node management utilities
5
- License-Expression: GPL-3.0-or-later
6
- License-File: LICENSE
5
+ License: GPL-3.0-or-later
7
6
  Author: Florent Mertens
8
7
  Author-email: florent.mertens@gmail.com
9
8
  Requires-Python: >=3.10,<4.0
9
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: Programming Language :: Python :: 3.13
15
- Classifier: Programming Language :: Python :: 3.14
16
15
  Provides-Extra: dev
17
16
  Provides-Extra: docs
18
17
  Requires-Dist: asyncssh (>=2.0)
@@ -693,6 +693,7 @@ class SlurmClient:
693
693
  text = line.decode(errors='replace')
694
694
  if task.slurm_job_id is None and text.startswith(SLURM_MARKER):
695
695
  task.slurm_job_id = text[len(SLURM_MARKER):].split()[0]
696
+ task.start_time = time.time()
696
697
  task.log(line, self.host)
697
698
 
698
699
  async def execute(self, task):
@@ -705,6 +706,8 @@ class SlurmClient:
705
706
  self.srun_command(task), stdout=asyncio.subprocess.PIPE,
706
707
  stderr=asyncio.subprocess.PIPE, preexec_fn=os.setpgrp, env=self.env)
707
708
  task.set_process(Process(self, process))
709
+ # srun waits for the job or the step to start: running from the marker line
710
+ task.start_time = None
708
711
 
709
712
  await asyncio.gather(
710
713
  self._log_stdout(task, process.stdout),
@@ -1096,6 +1099,7 @@ class WorkerPool:
1096
1099
  tasks = self.get_all_tasks()
1097
1100
  n_done = len(tasks[TaskStatus.SUCCESS])
1098
1101
  n_todo = len(tasks[TaskStatus.WAITING]) + len(tasks[TaskStatus.RUNNING])
1102
+ self._start_pbar_timer()
1099
1103
  self.pbar.update(n_done)
1100
1104
 
1101
1105
  if self.max_time is not None:
@@ -1104,6 +1108,15 @@ class WorkerPool:
1104
1108
  except asyncio.CancelledError:
1105
1109
  pass
1106
1110
 
1111
+ def _start_pbar_timer(self):
1112
+ """Time the pool from the first task start, without the wait for the Slurm jobs."""
1113
+ if self.pbar_timed:
1114
+ return
1115
+ starts = [t.start_time for t in self.tasks if t.start_time is not None]
1116
+ if starts:
1117
+ self.pbar.start_time = datetime.datetime.fromtimestamp(min(starts))
1118
+ self.pbar_timed = True
1119
+
1107
1120
  async def _enforce_max_time(self):
1108
1121
  now = time.time()
1109
1122
  for worker in self.workers:
@@ -1150,6 +1163,7 @@ class WorkerPool:
1150
1163
  self.tasks.sort(key=lambda task: not task.run_on_host)
1151
1164
 
1152
1165
  self.pbar.start(max_value=len(self.tasks))
1166
+ self.pbar_timed = False
1153
1167
 
1154
1168
  # An allocation no larger than the number of tasks
1155
1169
  for client in {w.client for w in self.workers}:
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "libpipe"
7
- version = "0.9"
7
+ version = "0.9.1"
8
8
  description = "Pipeline orchestration and node management utilities"
9
9
  readme = "README.md"
10
10
  license = "GPL-3.0-or-later"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes