parallel processing - Computing usage of independent cores and binding a process to a core -
i working mpi, , have hierarchy of operations. particular value of parameter _param, launch 10 trials, each running specific process on distinct core. n values of _param, code runs in hierarchy as:
driver_file -> launches 1 process checks if available processes more 10. if more 10 available, launches instance of process specific _param value passed argument coupling_file
coupling_file -> elementary computation, , launches 10 processes using mpi_comm_spawn(), each corresponding trial_file while passing _trial argument
trial_file -> computes work, returns values coupling_file
i facing 2 dilemmas, namely:
how evaluate required condition cores in driver_file? in, how find out how many processes have been terminated, can correctly schedule processes on idle cores? thought maybe adding blocking
mpi_recv(), use pass variable tell me when process has been finished, i'm not sure if best solution.how ensure processes assigned different cores? had thought using
mpiexec --bind-to-core --bycore -n 1 coupling_filelaunch 1 coupling_file. followedmpiexec --bind-to-core --bycore -n 10 trial_filelaunched coupling_file. however, if binding processes core, don't want same core have two/more processes. in, don't want_trial_1of_coupling_1run on corex, launch process ofcoupling_2launches_trial_2gets bound corex.
any input appreciated. thanks!
if option you, i'd drop spawning processes thing altogether, , instead start processes @ once. can partition them chunks working on single task. translation of concept example be:
- use 1 master (rank 0)
- partition rest groups of 10 processes, maybe create new communicator each group if needed, each group has 1 leader process, known master.
in code can like:
if master: send specific _param each group leader (with non-blocking send) loop on different _params use mpi_waitany or mpi_waitsome find groups ready else if groupleader: loop endlessly mpi_recv _params master coupling_file mpi_bcast group process trial_file else loop endlessly mpi_bcast (get data groupleader) process trial file i think, following approach allow solve both issues. availability of process groups gets detected mpi_wait*, though might want change logic above, notify master @ end of task sends new data then, not during previous trial still running, , process group might faster. , pinning resolved have fixed number of processes, can pinned during usual startup.
Comments
Post a Comment