From 177e72315ab148c371a2417aac576289318ae1a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=89=8D=E6=B8=9D?= Date: Mon, 6 Jan 2025 18:47:46 +0800 Subject: [PATCH] prefix def with test --- MCintegration/mc_multicpu_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MCintegration/mc_multicpu_test.py b/MCintegration/mc_multicpu_test.py index 6ab5034..53d785a 100644 --- a/MCintegration/mc_multicpu_test.py +++ b/MCintegration/mc_multicpu_test.py @@ -5,7 +5,7 @@ from integrators import MonteCarlo, MarkovChainMonteCarlo -def init_process(rank, world_size, fn, backend="gloo"): +def test_init_process(rank, world_size, fn, backend="gloo"): # Set MASTER_ADDR and MASTER_PORT appropriately # Assuming environment variables are set by the cluster's job scheduler master_addr = os.getenv("MASTER_ADDR", "localhost") @@ -18,7 +18,7 @@ def init_process(rank, world_size, fn, backend="gloo"): fn(rank, world_size) -def run_mcmc(rank, world_size): +def test_run_mcmc(rank, world_size): # Instantiate the MarkovChainMonteCarlo class bounds = [(-1, 1), (-1, 1)] n_eval = 8000000 @@ -55,4 +55,4 @@ def two_integrands(x, f): if __name__ == "__main__": world_size = 8 # Number of processes to launch - mp.spawn(init_process, args=(world_size, run_mcmc), nprocs=world_size, join=True) + mp.spawn(test_init_process, args=(world_size, test_run_mcmc), nprocs=world_size, join=True)