Commit 65619e8d authored by S. Lackner's avatar S. Lackner

[fix] adapt to changes in hpst/lcst handling in Batsim

parent be0ecca0
......@@ -449,6 +449,11 @@ class Batsim(object):
assert not self.running_simulation, "A simulation is already running (is more than one instance of Batsim active?!)"
self.running_simulation = True
self.nb_res = event_data["nb_resources"]
self.nb_cres = event_data["nb_compute_resources"]
self.nb_sres = event_data["nb_storage_resources"]
self.cres = event_data["compute_resources"]
self.sres = event_data["storage_resources"]
self.machines = {"compute": self.cres, "storage": self.sres}
self.batconf = event_data["config"]
self.time_sharing = event_data["allow_time_sharing"]
self.dynamic_job_submission_enabled = self.batconf["job_submission"]["from_scheduler"]["enabled"]
......@@ -479,8 +484,6 @@ class Batsim(object):
self.workloads = event_data["workloads"]
self.hpst = event_data.get("hpst_host", None)
self.lcst = event_data.get("lcst_host", None)
self.scheduler.onSimulationBegins()
elif event_type == "SIMULATION_ENDS":
......
......@@ -296,39 +296,30 @@ class Profiles(metaclass=ABCMeta):
class ParallelPFS(Profile):
"""Implementation of the MsgParallelHomogeneousPFSMultipleTiers profile."""
type = "msg_par_hg_pfs_tiers"
type = "msg_par_hg_pfs"
class Direction(Enum):
TO_STORAGE = 1
FROM_STORAGE = 2
class Host(Enum):
HPST = 1
LCST = 2
def __init__(self, size,
direction=Direction.TO_STORAGE,
host=Host.LCST,
def __init__(self, size_read, size_write,
storage="pfs",
**kwargs):
super().__init__(**kwargs)
self.size = size
self.direction = direction
self.host = host
self.size_read = size_read
self.size_write = size_write
self.storage = storage
@classmethod
def from_dict(cls, dct, name=None):
return cls(size=dct["size"],
direction=cls.Direction[dct["direction"].upper()],
host=cls.Host[dct["host"].upper()],
return cls(size_read=dct["bytes_to_read"],
size_write=dct["bytes_to_write"],
storage=dct["storage"],
ret=dct.get("ret", 0),
name=name)
def to_dict(self, embed_references=False):
return {
"type": self.type,
"size": self.size,
"direction": self.direction.name.lower(),
"host": self.host.name,
"bytes_to_read": self.size_read,
"bytes_to_write_write": self.size_write,
"storage": self.storage,
"ret": self.ret,
}
......
......@@ -270,28 +270,16 @@ class Scheduler(metaclass=ABCMeta):
"""The events happened in the scheduler."""
return self._events
@property
def machines(self):
"""The registered machines in Batsim."""
return self._machines
@property
def dynamic_workload(self):
"""The workload of dynamic job submissions of this scheduler."""
return self._dynamic_workload
@property
def hpst(self):
"""The hpst (high-performance storage tier) host managed by Batsim."""
return self._hpst
@property
def lcst(self):
"""The lcst (large-capacity storage tier) host managed by Batsim."""
return self._lcst
@property
def pfs(self):
"""The pfs (parallel file system) host managed by Batsim. This is an alias
to the host of the large-capacity storage tier.
"""
return self.lcst
@property
def options(self):
"""The options given to the launcher."""
......@@ -459,8 +447,7 @@ class Scheduler(metaclass=ABCMeta):
self.resources),
type="resources_registered")
self._hpst = DictWrapper(self._batsim.hpst)
self._lcst = DictWrapper(self._batsim.lcst)
self._machines = DictWrapper(self._batsim.machines)
def on_init(self):
"""The init method called during the start-up phase of the scheduler."""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment