Skip to content

Commit

Permalink
Add support for tasks per device setting for openfoam
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-jt79 committed May 2, 2023
1 parent 0536e2a commit 0ea2830
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pyepic/applications/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class Distribution(Enum):
NODE = "node"
DEVICE = "device"


class Upload(Enum):
"""Should excluded files be uploaded? Yes, No or only when the job finishes in an error state."""

Expand Down Expand Up @@ -56,6 +55,7 @@ def __init__(self, execute_step=True):
self.execute = execute_step
self.partitions = 1
self.task_distribution = Distribution.CORE
self.tasks_per_device = 1
self.runtime = 1
self.run_if_previous_step_fails = True
self.hyperthreading = True
Expand All @@ -72,6 +72,7 @@ def get_task_spec(self):
runtime=self.runtime,
task_distribution=self.task_distribution.value,
hyperthreading=self.hyperthreading,
tasks_per_device=self.tasks_per_device
)
return spec

Expand Down
2 changes: 2 additions & 0 deletions pyepic/applications/openfoam.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def __init__(self, *args, **kwargs):
self.endTime = 0
self.startTime = 0
self.application = "simpleFoam"
self.solver_tasks_per_device = 1


class ReconstructParStep(JobStep):
Expand Down Expand Up @@ -147,6 +148,7 @@ def get_applications_options(self):
"reconstruct_time": self.reconstructPar.reconstruct_time,
"upload_excludes": self.sync_processor_directories.value,
"solver_tasks_per_node": self.solver.task_distribution.value,
"solver_tasks_per_device": self.solver.tasks_per_device
}

def get_job_create_spec(self, queue_code):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ classifiers =
packages = find:
include_package_data = True
install_requires =
epiccore>=0.0.25
epiccore>=0.0.27
boto3>=1.16.57

0 comments on commit 0ea2830

Please sign in to comment.