简体   繁体   中英

MPI Dynamic Receive

I am new to MPI and I am developing a program that lists the divisors of a number. The algorithm is simple. I split the numbers from 2 to the square root of the number in threads and give them to the other processes. Then I take the results and merge them in one. A problem I have is that if I go over a big number range, it would take time for some of the nodes to process that, while others would do it faster. Then I need to process the responses of the faster ones and to give them new tasks.

In brief, I need something like a receive listener. Can you tell me such thing, or give a place from where I can read about it?

Thank you in advance!!!

I think it is possible by blocking and non-blocking receives. This is better explained in other posts on stackoverflow like MPI Task Scheduling and Dynamic pool of workers with MPI for large array C++ . I think both the questions wanted something similar to what you are looking for. Hope this helps you look in the right direction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM