bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
117 stars 24 forks source link

Question about parallelization #138

Open AmirShahbazi90 opened 1 year ago

AmirShahbazi90 commented 1 year ago

Is it possible to use NOMAD in parallelization both for python and matlab?

jan-provaznik commented 1 year ago

Current release of PyNOMAD is compiled without OpenMP support. The same goes for MATLAB interface.

You can bring your own parallelism by setting BB_MAX_BLOCK_SIZE and evaluating blocks in parallel with, for example, mpi4py.futures.MPIPoolExecutor or concurrent.futures.ProcessPoolExecutor and a pool of (remote) processes.

TianningGao commented 1 year ago

Is it possible to run PSD-MADS in NOMAD4 just like in NOMAD3? For example, if I set BB_EXE "$python3 my_func.py" and PSD_MADS_OPTIMIZATION TRUE in "param.txt", will it call PSD-MADS if I simply run $NOMAD_HOME/bin/nomad param.txt ? Or do I have to use mpirun to call $NOMAD_HOME/bin/nomad?

ctribes commented 1 year ago

PSD-Mads in Nomad 4 is based upon OpenMP. In Nomad 3 it uses mpi. The algo is essentially the same in the two Nomad versions. In Nomad 4, the activation of PSD-Mads algorithm requires building Nomad with OpenMP (if it is available it is enabled by default, and you will see a "-- Test OpenMP for parallel functionalities -- found" during cmake setup) and the PSD_MADS_OPTIMIZATION parameter set to True.

TianningGao commented 1 year ago

@ctribes Got it, thanks.