Search code examples
c++distributed-computing

How to change code so that it worked for distributed computing


I have a following problem. I am a physicist. For my current work I have to numerical investigate some problem.

I calculate some 7D integrals using monte carlo method. I use OpenMP for parallel computing but my program work slowly at one computers. At work, man from IT department, says that he can make virtual machine, and I can calculate using distributed computing.

I use C++ and OpenMP(for parallel computing). My question is the following:

Will my program work at virtual machine with distributed computing? How I should modify my code for distributed computing(if it necessary)?

My code for parallel computing is very simple

omp_set_dynamic(0);
omp_set_num_threads(Npot);
#pragma omp parallel for shared(result, errors) private(i)`
for (i = 0; i < Npot; i++){
..... 
}

Solution

  • OpenMP is to distribute the code over the cores of one processor. If you want to use multiple processors, like your pc and the VM, you will have to look into MPI. How you to connect the two together, I don't know. But now you have a starting point.

    You could also use CUDA to run your code on your graphics card.