0
votes

I've been studying the efficiency of parallelizing Dijkstra Algorithm using both OpenMPI and OpenMP. In fact, when I use OpenMP, the execution time appears to be higher than using OpenMPI which is a bit strange to me since as far as I know threads are supposed to be faster than processes. OpenMPI creates a process for each execution while OpenMP creates threads under each process execution. My question is: Is my finding implementation dependent? In other word, can we always say parallelizing with OpenMP cannot be always faster than OpenMPI since it is an implementation dependent?

Thank you.

1
You have one data point in a vast multi-dimensional universe of possible data points. Hardware, algorithm, program efficiency, RAM, bus speed, hyper threading, GPUs, caches, compilation efficiency, data access patterns, garbage collection, operating systems, networking, ... Draw whatever conclusions you like but don't stake your mortgage on any of them. - High Performance Mark
Please, don't confuse OpenMPI with MPI. OpenMPI is an implementation of the MPI standard. - Harald
Your question makes little sense without the context. How do you measure execution time? Do you bind your OpenMP threads and MPI processes? Is your computer a NUMA architecture? Did you check for cases of false sharing? Did you run your OpenMP program through a performance analysis tool such as Intel VTune? Is the MPI version running on a single node or is it utilising more than one node? And those are just a small subset of the questions that come to my mind... - Hristo Iliev

1 Answers

0
votes

As always, it all depends on your current circumstances. OpenMP works only on your local CPU, whereas OpenMPI connects to several nodes over a network. As long as you can only split your work over as many threads as your have local CPU cores, OpenMP should be faster, because there is less messaging overhead. In lager scaling appliances, OpenMPI is superior, because it can be distributed across several systems, which also may have a better individual computation speed.