Mostafa-wael / Parallism-in-C

Some code samples showing how to parallize your code in c or C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parallism in C

  • In this repository we will show the parallel versions of the two given code snippets using pthreads, openMP, MPI and both MPI & openMP.

image


Code I:

i=0;
while(i <= n)
{
    A[i] += f(i);  
    i++;
}

Code II:

for(int i = 0; i < n; i++)
    for(int j = 0; j < n; j++)
        A[i] += g(j,i);

About

Some code samples showing how to parallize your code in c or C++


Languages

Language:C 100.0%