Loading raps/metasched/metascheduler.py +3 −3 Original line number Diff line number Diff line from multiprocessing import Process, Queue from typing import Dict, List from .types import AmSCJob from .types import FedJob from .site_worker import site_worker_main class MetaScheduler: Loading Loading @@ -42,7 +42,7 @@ class MetaScheduler: p.join(timeout=5) # ---- policies ---- def choose_site(self, job: AmSCJob) -> str: def choose_site(self, job: FedJob) -> str: """ Simplest policy: choose the site with the shortest inbound queue length. Queue.qsize() is approximate on some platforms, but adequate for a first pass. Loading @@ -60,7 +60,7 @@ class MetaScheduler: self._rr += 1 return site def submit(self, job: AmSCJob) -> str: def submit(self, job: FedJob) -> str: site = self.choose_site(job) if site is None: raise RuntimeError(f"choose_site() returned None; _site_list={getattr(self,'_site_list',None)}") Loading raps/metasched/types.py +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import time import uuid @dataclass class AmSCJob: class FedJob: nodes_required: int wall_time_s: int submit_time_s: int = field(default_factory=lambda: int(time.time())) Loading scripts/run_federation.py +5 −5 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ import time from raps.metasched.metascheduler import MetaScheduler from raps.metasched.types import AmSCJob from raps.metasched.types import FedJob def main(): sites = { "frontier": "configs/frontier/sim.yaml", "aurora": "configs/aurora/sim.yaml", "perlmutter": "configs/perlmutter/sim.yaml", "frontier": "config/frontier.yaml", "aurora": "config/aurora.yaml", "perlmutter": "config/perlmutter.yaml", } ms = MetaScheduler(sites) Loading @@ -19,7 +19,7 @@ def main(): # Submit a few jobs (arrival stream) for i in range(10): job = AmSCJob(nodes_required=64, wall_time_s=3600, name=f"fed-{i}") job = FedJob(nodes_required=64, wall_time_s=3600, name=f"fed-{i}") site = ms.submit(job) print(f"submitted {job.job_id} -> {site}") time.sleep(0.2) Loading Loading
raps/metasched/metascheduler.py +3 −3 Original line number Diff line number Diff line from multiprocessing import Process, Queue from typing import Dict, List from .types import AmSCJob from .types import FedJob from .site_worker import site_worker_main class MetaScheduler: Loading Loading @@ -42,7 +42,7 @@ class MetaScheduler: p.join(timeout=5) # ---- policies ---- def choose_site(self, job: AmSCJob) -> str: def choose_site(self, job: FedJob) -> str: """ Simplest policy: choose the site with the shortest inbound queue length. Queue.qsize() is approximate on some platforms, but adequate for a first pass. Loading @@ -60,7 +60,7 @@ class MetaScheduler: self._rr += 1 return site def submit(self, job: AmSCJob) -> str: def submit(self, job: FedJob) -> str: site = self.choose_site(job) if site is None: raise RuntimeError(f"choose_site() returned None; _site_list={getattr(self,'_site_list',None)}") Loading
raps/metasched/types.py +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ import time import uuid @dataclass class AmSCJob: class FedJob: nodes_required: int wall_time_s: int submit_time_s: int = field(default_factory=lambda: int(time.time())) Loading
scripts/run_federation.py +5 −5 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ import time from raps.metasched.metascheduler import MetaScheduler from raps.metasched.types import AmSCJob from raps.metasched.types import FedJob def main(): sites = { "frontier": "configs/frontier/sim.yaml", "aurora": "configs/aurora/sim.yaml", "perlmutter": "configs/perlmutter/sim.yaml", "frontier": "config/frontier.yaml", "aurora": "config/aurora.yaml", "perlmutter": "config/perlmutter.yaml", } ms = MetaScheduler(sites) Loading @@ -19,7 +19,7 @@ def main(): # Submit a few jobs (arrival stream) for i in range(10): job = AmSCJob(nodes_required=64, wall_time_s=3600, name=f"fed-{i}") job = FedJob(nodes_required=64, wall_time_s=3600, name=f"fed-{i}") site = ms.submit(job) print(f"submitted {job.job_id} -> {site}") time.sleep(0.2) Loading