55from integrators import MonteCarlo , MarkovChainMonteCarlo
66
77
8- def init_process (rank , world_size , fn , backend = "gloo" ):
8+ def test_init_process (rank , world_size , fn , backend = "gloo" ):
99 # Set MASTER_ADDR and MASTER_PORT appropriately
1010 # Assuming environment variables are set by the cluster's job scheduler
1111 master_addr = os .getenv ("MASTER_ADDR" , "localhost" )
@@ -18,7 +18,7 @@ def init_process(rank, world_size, fn, backend="gloo"):
1818 fn (rank , world_size )
1919
2020
21- def run_mcmc (rank , world_size ):
21+ def test_run_mcmc (rank , world_size ):
2222 # Instantiate the MarkovChainMonteCarlo class
2323 bounds = [(- 1 , 1 ), (- 1 , 1 )]
2424 n_eval = 8000000
@@ -55,4 +55,4 @@ def two_integrands(x, f):
5555
5656if __name__ == "__main__" :
5757 world_size = 8 # Number of processes to launch
58- mp .spawn (init_process , args = (world_size , run_mcmc ), nprocs = world_size , join = True )
58+ mp .spawn (test_init_process , args = (world_size , test_run_mcmc ), nprocs = world_size , join = True )
0 commit comments