Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option for simulation duration #76

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions buildstockbatch/gcp/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,9 @@ def start_batch_job(self, batch_info):
boot_disk_mib=job_env_cfg.get("boot_disk_mib", None),
)

# Give three minutes per simulation, plus ten minutes for job overhead
task_duration_secs = 60 * (10 + batch_info.n_sims_per_job * 3)
# Use specified time per simulation, plus ten minutes for job overhead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mainly for ComStock, right?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it in the next section, so yes!

minutes_per_sim = job_env_cfg.get("minutes_per_sim", 3)
task_duration_secs = 60 * (10 + batch_info.n_sims_per_job * minutes_per_sim)
task = batch_v1.TaskSpec(
runnables=[bsb_runnable],
compute_resource=resources,
Expand Down
1 change: 1 addition & 0 deletions buildstockbatch/schemas/v0.3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ gcp-job-environment-spec:
boot_disk_mib: int(required=False)
machine_type: str(required=False)
use_spot: bool(required=False)
minutes_per_sim: num(min=0.05, max=480, required=False)

gcp-postprocessing_environment-spec:
# Limits documented at
Expand Down
2 changes: 2 additions & 0 deletions docs/project_defn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ using `GCP Batch <https://cloud.google.com/batch>`_ and `Cloud Run <https://clou
this is a type from the `E2 series`_. Usually safe to leave unset.
* ``use_spot``: Optional. Whether to use `Spot VMs <https://cloud.google.com/spot-vms>`_
for data simulations, which can reduce costs by up to 91%. Default: false
* ``minutes_per_sim``: Optional. Maximum time per simulation. Default works well for ResStock,
but this should be increased for ComStock. Default: 3 minutes
* ``postprocessing_environment``: Optional. Specifies the Cloud Run computing environment for
postprocessing.

Expand Down
Loading