Skip to content

Commit

Permalink
prefix def with test
Browse files Browse the repository at this point in the history
  • Loading branch information
fancaiyu authored Jan 6, 2025
1 parent 02792ff commit 177e723
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MCintegration/mc_multicpu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 177e723

Please sign in to comment.