Quote:
Originally Posted by asadullah.ansari View Post
If you are user of Visual Studio (VC8) then you can easily use this

Code:
#include<omp.h>

omp_set_num_threads(2 or 4 or 6) // as depends on your loop
#pragma omp parallel for shared(mult, r1,c2) private(j,k) 
 for(i=0;i<r1;i++)
        {
            for(j=0;j<c2;j++)
            {
                mult[i][j]=0;
                for(k=0;k<r1;k++)
                {
                    mult[i][j]+=m1[i][k]*m2[k][j];
                    /*mult[0][0]=m1[0][0]*m2[0][0]+m1[0][1]*m2[1][0]+m1[0][2]*m2[2][0];*/
                }
               //printf("%d\t",mult[i][j]);
            }
            //printf("\n");
        }
By the use of OpenMP, parallel computing will be done. Today Google is using OpenMP, MPI, Grid Computing.
There is a bug in this code; the inner most for loop should be:

for(k=0;k<r2;k++) { ... }