From 994dd13a41925b3867b78af37492a1d159a041fd Mon Sep 17 00:00:00 2001 From: Maximilian Dinkel Date: Thu, 19 Dec 2024 08:52:14 +0100 Subject: [PATCH] fix: --use-hwthread-cpus --- .github/workflows/.github-ci.yml | 3 ++- queens/drivers/fourc_driver.py | 2 +- tests/integration_tests/fourc/conftest.py | 23 +++++++++++++++++++ .../integration_tests/fourc/test_fourc_mc.py | 15 ++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/.github-ci.yml b/.github/workflows/.github-ci.yml index c04455836..1b088ecd8 100644 --- a/.github/workflows/.github-ci.yml +++ b/.github/workflows/.github-ci.yml @@ -51,4 +51,5 @@ jobs: - name: tests run: | $PYTHON_PACKAGE_MANAGER activate queens - pytest -v -m "unit_tests or integration_tests or integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes --junitxml=test_junit.xml + # pytest -v -m "unit_tests or integration_tests or integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes --junitxml=test_junit.xml + pytest -v -m "integration_tests_fourc" --cov --cov-report=term --cov-report=html:html_coverage_report --cov-report=xml:xml_coverage_report.xml $TEST_TIMING_OPTION --color=yes --junitxml=test_junit.xml diff --git a/queens/drivers/fourc_driver.py b/queens/drivers/fourc_driver.py index 3606b9fcc..42a152e28 100644 --- a/queens/drivers/fourc_driver.py +++ b/queens/drivers/fourc_driver.py @@ -26,7 +26,7 @@ def __init__( gradient_data_processor=None, post_processor=None, post_options="", - mpi_cmd="/usr/bin/mpirun --bind-to none", + mpi_cmd="/usr/bin/mpirun --bind-to none --use-hwthread-cpus", ): """Initialize FourcDriver object. diff --git a/tests/integration_tests/fourc/conftest.py b/tests/integration_tests/fourc/conftest.py index 6ebf3798e..aa160677a 100644 --- a/tests/integration_tests/fourc/conftest.py +++ b/tests/integration_tests/fourc/conftest.py @@ -1 +1,24 @@ """Pytest configuration for 4C integration tests.""" + +import pytest + + +@pytest.fixture(name="setup_symbolic_links_fourc", autouse=True) +def fixture_setup_symbolic_links_fourc(fourc_link_paths): + """Set-up of 4C symbolic links. + + Args: + fourc_link_paths (Path): destination for symbolic links to executables + """ + dst_fourc = fourc_link_paths[0] + + # create link to default 4C executable location if no link is available + if not dst_fourc.is_symlink(): + raise FileNotFoundError("Failed to create link to default 4C location.") + + # check if existing link to fourc works and points to a valid file + if not dst_fourc.resolve().exists(): + raise FileNotFoundError( + f"The following link seems to be dead: {dst_fourc}\n" + f"It points to (non-existing): {dst_fourc.resolve()}\n" + ) diff --git a/tests/integration_tests/fourc/test_fourc_mc.py b/tests/integration_tests/fourc/test_fourc_mc.py index a8834ca60..09fd16f17 100644 --- a/tests/integration_tests/fourc/test_fourc_mc.py +++ b/tests/integration_tests/fourc/test_fourc_mc.py @@ -59,6 +59,21 @@ def test_fourc_mc( # Actual analysis run_iterator(iterator, global_settings=global_settings) + from pathlib import Path + + from queens.utils.config_directories import experiment_directory + + experiment_dir = experiment_directory(global_settings.experiment_name) + job_dir = experiment_dir / "1" + import logging + + _logger = logging.getLogger(__name__) + _logger.info(list(job_dir.iterdir())) + output_dir = job_dir / "output" + _logger.info(list(output_dir.iterdir())) + print(list(job_dir.iterdir())) + print(list(output_dir.iterdir())) + # Load results results = load_result(global_settings.result_file(".pickle"))