Skip to content

Commit 3680c86

Browse files
committedMar 12, 2025··
#591: update PhaseSpecification with all params
1 parent a9efa89 commit 3680c86

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed
 

‎src/lbaf/Execution/lbsPhaseSpecification.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,18 @@
5151
class TaskSpecification(TypedDict):
5252
# The task time
5353
time: float
54-
# The optional collection id
55-
collection_id: NotRequired[int]
56-
57-
# Additional parameters
54+
# The task's sequential ID
5855
seq_id: int
56+
# Whether the task is migratable or not
5957
migratable: bool
58+
# The task's home rank
6059
home: int
60+
# The task's current node
6161
node: int
62-
user_defined: dict
62+
# The collection id
63+
collection_id: NotRequired[int]
64+
# User-defined parameters
65+
user_defined: NotRequired[dict]
6366

6467

6568
class SharedBlockSpecification(TypedDict):
@@ -182,15 +185,21 @@ def dict_merge(a, b):
182185
data.get("tasks", []),
183186
lambda t: TaskSpecification(dict_merge(
184187
{ "time": t.get("time", 0.0) },
185-
{ "collection_id": t.get("collection_id", None)} if "collection_id" in t else {}
188+
{ "seq_id": t.get("seq_id", None)} if "seq_id" in t else {},
189+
{ "migratable": t.get("migratable", True)} if "migratable" in t else {},
190+
{ "home": t.get("home", 0)} if "home" in t else {},
191+
{ "node": t.get("node", 0)} if "node" in t else {},
192+
{ "collection_id": t.get("collection_id", None)} if "collection_id" in t else {},
193+
{ "user_defined": t.get("user_defined", {})} if "user_defined" in t else {}
186194
))
187195
),
188196
"shared_blocks": self.__normalize_member(
189197
data.get("shared_blocks", []),
190198
lambda b: SharedBlockSpecification({
191199
"size": b.get("size", 0.0),
192200
"tasks": set(b.get("tasks", {})),
193-
"home_rank": b.get("home_rank")
201+
"home_rank": b.get("home_rank"),
202+
"shared_id": b.get("shared_id")
194203
})
195204
),
196205
"communications": self.__normalize_member(
@@ -200,7 +209,9 @@ def dict_merge(a, b):
200209
"ranks": self.__normalize_member(
201210
data.get("ranks", []),
202211
lambda r: RankSpecification({
203-
"tasks": set(r.get("tasks", []))
212+
"tasks": set(r.get("tasks", [])),
213+
"id": set(r.get("id", None)),
214+
"user_defined": set(r.get("user_defined", {}) if "user_defined" in r else {})
204215
})
205216
)
206217
})

0 commit comments

Comments
 (0)
Please sign in to comment.