From e166a234914d1d4c85258ab82e701511ef57f865 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 11 Mar 2024 17:19:36 +0000 Subject: [PATCH 1/2] count monitor cores including ethernet ones --- mcmc/mcmc_framework.py | 7 +++- mcmc_integration_tests/test_scripts.py | 58 +++++++++++--------------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/mcmc/mcmc_framework.py b/mcmc/mcmc_framework.py index ba76e27..cc14f85 100644 --- a/mcmc/mcmc_framework.py +++ b/mcmc/mcmc_framework.py @@ -97,15 +97,18 @@ def run_mcmc( # Count the cores in the processor # (-1 if this chip also has a coordinator) n_cores = chip.n_user_processors + if chip.ip_address is None: + n_cores -= FecDataView.get_all_monitor_cores() + else: + n_cores -= FecDataView.get_ethernet_monitor_cores() if (chip.x, chip.y) in coordinators: - n_cores -= 3 # coordinator and extra_monitor_support (2) + n_cores -= 3 # coordinator if (model.root_finder): if (model.cholesky): n_cores = n_cores // 3 else: n_cores = n_cores // 2 else: - n_cores -= 1 # just extra_monitor_support if (model.root_finder): if (model.cholesky): n_cores = n_cores // 3 diff --git a/mcmc_integration_tests/test_scripts.py b/mcmc_integration_tests/test_scripts.py index dbf9e90..b441ce9 100644 --- a/mcmc_integration_tests/test_scripts.py +++ b/mcmc_integration_tests/test_scripts.py @@ -1,20 +1,18 @@ # Copyright (c) 2019 The University of Manchester # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# https://www.apache.org/licenses/LICENSE-2.0 # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from spinnaker_testbase import ScriptChecker -from unittest import SkipTest # pylint: disable=unused-import class TestScripts(ScriptChecker): @@ -29,32 +27,26 @@ class TestScripts(ScriptChecker): """ # flake8: noqa - def test_mcmc_examples_lighthouse_lighthouse_float_model(self): - raise SkipTest("Not a run script") - self.check_script("mcmc_examples/lighthouse/lighthouse_float_model.py") + def test_mcmc_examples_arma_arma(self): + self.check_script("mcmc_examples/arma/arma.py") - def test_mcmc_examples_lighthouse_lighthouse(self): - self.check_script("mcmc_examples/lighthouse/lighthouse.py") + # Not testing file due to: Not a run script + # mcmc_examples/arma/arma_float_model.py - def test_mcmc_examples_lighthouse_lighthouse_fixed_point_model(self): - raise SkipTest("Not a run script") - self.check_script("mcmc_examples/lighthouse/lighthouse_fixed_point_model.py") + # Not testing file due to: Not a run script + # mcmc_examples/arma/arma_model.py - def test_mcmc_examples_lighthouse_lighthouse_model(self): - raise SkipTest("Not a run script") - self.check_script("mcmc_examples/lighthouse/lighthouse_model.py") + # Not testing file due to: Not a run script + # mcmc_examples/arma/arma_fixed_point_model.py - def test_mcmc_examples_arma_arma(self): - self.check_script("mcmc_examples/arma/arma.py") + # Not testing file due to: Not a run script + # mcmc_examples/lighthouse/lighthouse_model.py - def test_mcmc_examples_arma_arma_float_model(self): - raise SkipTest("Not a run script") - self.check_script("mcmc_examples/arma/arma_float_model.py") + # Not testing file due to: Not a run script + # mcmc_examples/lighthouse/lighthouse_float_model.py - def test_mcmc_examples_arma_arma_fixed_point_model(self): - raise SkipTest("Not a run script") - self.check_script("mcmc_examples/arma/arma_fixed_point_model.py") + # Not testing file due to: Not a run script + # mcmc_examples/lighthouse/lighthouse_fixed_point_model.py - def test_mcmc_examples_arma_arma_model(self): - raise SkipTest("Not a run script") - self.check_script("mcmc_examples/arma/arma_model.py") + def test_mcmc_examples_lighthouse_lighthouse(self): + self.check_script("mcmc_examples/lighthouse/lighthouse.py") From 0a82eed1dadac81ed3b847862e49183364bcdabe Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 12 Mar 2024 10:49:44 +0000 Subject: [PATCH 2/2] 1 coordinator --- mcmc/mcmc_framework.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcmc/mcmc_framework.py b/mcmc/mcmc_framework.py index cc14f85..d1b6c10 100644 --- a/mcmc/mcmc_framework.py +++ b/mcmc/mcmc_framework.py @@ -102,7 +102,7 @@ def run_mcmc( else: n_cores -= FecDataView.get_ethernet_monitor_cores() if (chip.x, chip.y) in coordinators: - n_cores -= 3 # coordinator + n_cores -= 1 # coordinator if (model.root_finder): if (model.cholesky): n_cores = n_cores // 3