dimanche 19 avril 2015

Why isnt my 2d array being allocated at all processes on my university cluster?

I am running multiplication matrix code on my cluster and i am certain it works just fine. i even used the Scatterv and it scatters flawlessly... but i dynamically allocated my result matrix on every Process with size sendcount[world_rank] rows and z columns, i checked and these numbers are correct to the dot... only one Process allocated the array and the rest just prints an address or something.


My code does the matrix multiplication here:



count = 0;
while(count < z){

for (i = 0; i < sendcount[world_rank]; i++){

for(j = 0; j < y; j++){
//printf("matrix1[%d][%d] * matrix2[%d][%d] = ", i, j, j, count);
resultmatrix[i][count] += matrix1[i][j] * matrix2[j][count];
//printf("%d ", resultmatrix[i][count]);

}
//printf("rank: %d, i: %d count: %d resultmatrix: %d\n", world_rank, i, count, resultmatrix[i][count]);

}
count++;
//printf("\n");
}


When i go to print the resultmatrix at each process for testing, only my root process prints actual values... could this be a problem from my cluster or am i missing something?


Aucun commentaire:

Enregistrer un commentaire