HALLO,
I would like to send a whole column of a dynamicly allocated array (in
C language).
When i use derived datatypes(for example MPI_Type_vector) i can send a
column ONLY if i have static array but when i use dynamic allocation i
have problem!
Please tell me one way to send a column of a dynamc allocated array.
For example :
����� MPI_Datatype columntype;
�� �� MPI_Type_vector(10, 1, 10, MPI_INT, &columntype);
�� �� MPI_Type_commit(&columntype);
�if(rank==0){
�������������������� dyn_array=(int **) calloc(10,sizeof(int *));
��� ���������������� for(i = 0; i < 10; i++){
��� ��� �������������������� dyn_array[i] =(int *)
calloc(10,sizeof(int));
� � � � � � � � � �� }
��� �� � � � � � � � for(i=0;i<10;i++){ for(j=0;j<10;j++)
dyn_array[i][j]=9;}
����������������� MPI_Send(&dyn_array[0][0], 1, columntype, dest,
tag,MPI_COMM_WORLD);
�}
if(rank==1){
��� MPI_Recv(&other_dyn_array[0][0], 1, columntype, 0, tag,
MPI_COMM_WORLD, &Stat);
}
the values of the receive are not correct!!
|