c++ - Thread Building Block versus MPI, which one fits mt need better? -
Now I have a serial solver in C ++ to solve optimization problems and let me have my solver different parameters To make parallel with this can help to improve the performance of the solver. Now I am not sure I should use TBB or MPI. I read from a TBB book, I think TBB is more suitable for looping or punished code. Since I do not have much experience with TBB, I think it is difficult to split my code into smaller parts to realize parallelization. Apart from this, I think that many writers used MPI in parallel to many solars and supported it. I think the MPI fits my need more since I do not have much information on TBB or MPI. Can someone tell me if my feelings are correct? What MPI would be better? If so, what content is good for learning MPI start up, I have no experience with the MPI and I use Windows System and C ++ thanks a lot.
The basic thing you should keep in mind, shared memory and distributed memory. Share-memory occurs when you have more than one process (usually more than one thread in a process) that can reach a normal memory. It can be quite straightforward and it is normally simpler for customizing single-threaded programs for multiple threads. You will have to design this program in a manner that threads work in different parts of memory (taking advantage of data parallelism) and sharing part is protected from concurrent access using lock. Distributed-memory means that you have different processes that can be executed on one or more distributed computers, but these processes have a common goal together to share data through messaging (data communication) The need for a process from memory location and any other process does not require communication. This is a more general approach, but due to the communication requirements, this requires coarse grains. While TBB is a library support for thread-based shared-memory parallelism, while MPI is a library for distributed-memory parallelism (it has simple priorities for communication and a script for many processes in different node executions).
The most important thing is that you identify parallel inside your solver and then choose the best solution. Do you have data parity (separate threads / processes can work in different types of data without colliding in parallel or sharing of these data)? Work equality (separate threads / processes can perform a different step in your data processing or data processing in pipeline or graph fashion)?
Comments
Post a Comment