Skip to content

Commit

Permalink
Merge pull request #467 from NREL/os380_apptainer_mount_fix
Browse files Browse the repository at this point in the history
Apptainer mount fix for ResStock and OpenStudio 3.8
  • Loading branch information
nmerket authored Oct 10, 2024
2 parents fe1ba37 + 6161a17 commit 5d24803
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 2 additions & 6 deletions buildstockbatch/hpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,19 +356,15 @@ def run_building(cls, output_dir, cfg, n_datapoints, i, upgrade_idx=None):
cls.local_buildstock_dir / "measures",
cls.local_weather_dir,
]
if (resources_dir := cls.local_buildstock_dir / "resources").exists():
dirs_to_mount.append(resources_dir)

for src in dirs_to_mount:
container_mount = "/" + src.name
args.extend(["-B", "{}:{}:ro".format(src, container_mount)])
container_symlink = pathlib.Path("/var/simdata/openstudio", src.name)
runscript.append("ln -s {} {}".format(*map(shlex.quote, (container_mount, str(container_symlink)))))

if (cls.local_buildstock_dir / "resources" / "hpxml-measures").exists():
runscript.append("ln -s /resources /var/simdata/openstudio/resources")
src = cls.local_buildstock_dir / "resources" / "hpxml-measures"
container_mount = "/resources/hpxml-measures"
args.extend(["-B", f"{src}:{container_mount}:ro"])

# Build the openstudio command that will be issued within the
# apptainer container If custom gems are to be used in the
# apptainer container add extra bundle arguments to the cli
Expand Down
8 changes: 8 additions & 0 deletions docs/changelog/changelog_dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,11 @@ Development Changelog

Stop creating dask _metadata files for the timeseries parquet files since it crashes the
postprocessing.

.. change::
:tags: bugfix, hpc
:pullreq: 467

Updates the bind mount for apptainer to include the whole resources
directory instead of just the hpxml-measures directory. Makes it work
with newer versions of ResStock.

0 comments on commit 5d24803

Please sign in to comment.