Source code for ramble.test.end_to_end.perf_tests.many_experiments

# Copyright 2022-2026 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.

import pytest

import ramble.workspace
from ramble.main import RambleCommand

# everything here uses the mock_workspace_path
pytestmark = pytest.mark.usefixtures(
    "mutable_config",
    "mutable_mock_workspace_path",
)

workspace = RambleCommand("workspace")


[docs] @pytest.mark.perf @pytest.mark.long def test_many_experiments(workspace_name, ramble_benchmark): ws = ramble.workspace.create(workspace_name) ws.write() global_args = ["-w", workspace_name] workspace( "manage", "experiments", "hostname", "--wf", "local", "-e", "test-{n_nodes}-{var1}-{var2}-{var3}", "-v", "n_ranks='{n_nodes}*{processes_per_node}'", "-v", "n_nodes=[1,2,4,8,16]", "-v", "var1=[1,2,3,4,5,6,7,8,9,10]", "-v", "var2=[1,2,3,4,5,6,7,8,9,10]", "-v", "var3=[1,2,3,4,5,6,7,8,9,10]", "-m", "n_nodes,var1,var2,var3", "--default-variable-value", "1", global_args=global_args, ) output = ramble_benchmark(workspace, "info", global_args=global_args) assert "Experiment 5000" in output