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

Remove tests for OMP_NUM_THREADS #9850

Merged
merged 1 commit into from
Jan 23, 2025
Merged
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
55 changes: 0 additions & 55 deletions tests/ert/ui_tests/cli/test_run_flow_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,6 @@ def test_user_can_specify_threads_and_mpi_processes_and_oversubscribe_compute_no
assert re.search(r"Threads per MPI process:\s+2", flow_stdout)


@pytest.mark.usefixtures("eightcells")
@pytest.mark.skipif(not shutil.which("flowrun"), reason="flowrun not available")
def test_setenv_can_be_used_to_set_threads():
Path("flow.ert").write_text(
dedent("""
NUM_REALIZATIONS 1
ECLBASE EIGHTCELLS
DATA_FILE EIGHTCELLS.DATA
RUNPATH realization-<IENS>
SETENV OMP_NUM_THREADS 2
NUM_CPU 1
FORWARD_MODEL FLOW()
""").strip(),
encoding="utf-8",
)

run_cli(TEST_RUN_MODE, "--disable-monitoring", "flow.ert")
flow_stdout = Path("realization-0/FLOW.stdout.0").read_text(encoding="utf-8")
assert re.search(r"Number of MPI processes:\s+1", flow_stdout)
assert re.search(r"Threads per MPI process:\s+2", flow_stdout)


@pytest.mark.usefixtures("eightcells")
@pytest.mark.skipif(not shutil.which("flowrun"), reason="flowrun not available")
def test_ert_will_fetch_parallel_keyword_and_set_mpi_processes():
Expand All @@ -128,39 +106,6 @@ def test_ert_will_fetch_parallel_keyword_and_set_mpi_processes():
assert re.search(r"Threads per MPI process:\s+1", flow_stdout)


@pytest.mark.usefixtures("eightcells")
@pytest.mark.skipif(not shutil.which("flowrun"), reason="flowrun not available")
@pytest.mark.parametrize("num_cpu", [1, 2])
def test_flow_will_always_obey_omp_num_threads_also_when_mpi_is_active(num_cpu):
"""This part of flow Ert cannot control, and this scenario should thus be
avoided. However, if the users use SETENV manually it will happen.
SETENV takes precedence over plugin env configuration so configuriation of
the FLOW forward model through plugins will not help either."""
deck = Path("EIGHTCELLS.DATA").read_text(encoding="utf-8")
assert "PARALLEL" not in deck
Path("flow.ert").write_text(
dedent(f"""
NUM_REALIZATIONS 1
ECLBASE EIGHTCELLS
NUM_CPU {num_cpu}
DATA_FILE EIGHTCELLS.DATA
SETENV OMP_NUM_THREADS 2
RUNPATH realization-<IENS>
FORWARD_MODEL FLOW()
""").strip(),
encoding="utf-8",
)

run_cli(TEST_RUN_MODE, "--disable-monitoring", "flow.ert")
flow_stdout = Path("realization-0/FLOW.stdout.0").read_text(encoding="utf-8")
assert (
"Warning: Environment variable OMP_NUM_THREADS takes precedence over the --threads-per-process"
in flow_stdout
)
assert re.search(rf"Number of MPI processes:\s+{num_cpu}", flow_stdout)
assert re.search(r"Threads per MPI process:\s+2", flow_stdout)


@pytest.mark.usefixtures("eightcells")
@pytest.mark.skipif(not shutil.which("flowrun"), reason="flowrun not available")
def test_num_cpu_wins_over_parallel_in_deck():
Expand Down
Loading