Skip to content

Commit

Permalink
Merge pull request #2394 from InstituteforDiseaseModeling/fix_get_dir…
Browse files Browse the repository at this point in the history
…ectory

Fix parent issue in get_directory for File/Container/Process Platform
  • Loading branch information
shchen-idmod authored Nov 14, 2024
2 parents e32bb73 + 598ed1d commit ccfeb89
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions idmtools_platform_general/idmtools_platform_file/file_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class FilePlatform(IPlatform):
# Default retries for jobs
retries: int = field(default=1, metadata=dict(help="Number of retries for failed jobs"))
# number of MPI processes
ntasks: int = field(default=1, metadata=dict(help="Number of MPI processes. If greater than 1, it triggers mpirun."))
ntasks: int = field(default=1,
metadata=dict(help="Number of MPI processes. If greater than 1, it triggers mpirun."))
# modules to be load
modules: list = field(default_factory=list, metadata=dict(help="Modules to load"))
# extra packages to install
Expand Down Expand Up @@ -98,7 +99,14 @@ def get_directory(self, item: Union[Suite, Experiment, Simulation]) -> Path:
suite_id = item.parent_id or item.suite_id
if suite_id is None:
raise RuntimeError("Experiment missing parent!")
suite_dir = Path(self.job_directory, self.entity_display_name(item.parent))
suite = None
try:
suite = self.get_item(suite_id, ItemType.SUITE)
except RuntimeError:
pass
if suite is None:
suite = item.parent
suite_dir = Path(self.job_directory, self.entity_display_name(suite))
item_dir = Path(suite_dir, self.entity_display_name(item))
elif isinstance(item, Simulation):
exp = item.parent
Expand Down

0 comments on commit ccfeb89

Please sign in to comment.