Closed shantanu9847 closed 1 year ago
Something like this should work under any mpi environmpent
I.e. mpirun -np X ... or srun
from schwimmbad import MPIPool
import numpy as np
import sys
import dynesty
def ptform(x):
return 10 * x - 5
def func(x):
return -0.5 * np.sum(x**2)
if __name__ == '__main__':
pool = MPIPool()
if not pool.is_master():
pool.wait()
sys.exit(0)
dns = dynesty.DynamicNestedSampler(
func,
ptform,
10,
pool=pool,
)
dns.run_nested()
Thank you, will try this.
I've added the code snipped to FAQ. I'm closing the issue.
This is a general question. Does anyone have a working example of running multithread dynesty across nodes ( on muliple nodes on a cluster using PBS or slurm or SGE), where the multiple nodes work in cohesion . note that I have successfully used dynesty to run intra-node parallel processing (using multiprocessing and multiprocess module but not inter-node). Does dynesty support this and what is needed to run dynesty in this way? (would mpi for example support this?) Sorry if this is already documented somewhere and I missed it. Thanks