17 lines
561 B
Python
17 lines
561 B
Python
from dataclasses import dataclass
|
|
from typing import Tuple
|
|
|
|
@dataclass
|
|
class Configuration:
|
|
nodes: int
|
|
tasks: int
|
|
gpus_per_node: int
|
|
blockcount: Tuple[int, int, int]
|
|
blocksize: Tuple[int, int, int]
|
|
|
|
def get_domain_size(self) -> int:
|
|
return self.blockcount[0] * self.blocksize[0] * self.blockcount[1] * self.blocksize[1] * self.blockcount[2] * self.blocksize[2]
|
|
|
|
def get_label(self) -> str:
|
|
return f"t{self.tasks:04}n{self.nodes:03}g{self.gpus_per_node}x{self.blockcount[0]}y{self.blockcount[1]}z{self.blockcount[2]}"
|