Commit 76e52114 authored by iker_martin's avatar iker_martin
Browse files

Fixed memory error in mpi_derived datatype

parent f732b56c
...@@ -94,10 +94,10 @@ void MakeSprMatrixPacket (SparseMatrix spr, int size, int weight, ptr_PacketNode ...@@ -94,10 +94,10 @@ void MakeSprMatrixPacket (SparseMatrix spr, int size, int weight, ptr_PacketNode
type[0] = MPI_INT ; lblq[0] = size+1; dspl[0] = (MPI_Aint) spr.vptr; type[0] = MPI_INT ; lblq[0] = size+1; dspl[0] = (MPI_Aint) spr.vptr;
type[1] = MPI_INT ; lblq[1] = weight; dspl[1] = (MPI_Aint) spr.vpos; type[1] = MPI_INT ; lblq[1] = weight; dspl[1] = (MPI_Aint) spr.vpos;
type[2] = MPI_DOUBLE; lblq[2] = weight; dspl[2] = (MPI_Aint) spr.vval; type[2] = MPI_DOUBLE; lblq[2] = weight; dspl[2] = (MPI_Aint) spr.vval;
type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (spr.vptr+size+1); //type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (spr.vptr+size+1);
for (k=3; k>=0; k--) dspl[k] -= dspl[0]; for (k=2; k>=0; k--) dspl[k] -= dspl[0];
// Creation of the packet // Creation of the packet
MPI_Type_create_struct (4, lblq, dspl, type, &(pcknode->pack)); MPI_Type_create_struct (3, lblq, dspl, type, &(pcknode->pack));
MPI_Type_commit(&(pcknode->pack)); MPI_Type_commit(&(pcknode->pack));
} }
...@@ -119,10 +119,10 @@ void MakeSprMatrixSendPacket (SparseMatrix spr, int *vlen, int dimL, int dspL, ...@@ -119,10 +119,10 @@ void MakeSprMatrixSendPacket (SparseMatrix spr, int *vlen, int dimL, int dspL,
type[0] = MPI_INT ; lblq[0] = dimL ; dspl[0] = (MPI_Aint) (vlen+dspL ); type[0] = MPI_INT ; lblq[0] = dimL ; dspl[0] = (MPI_Aint) (vlen+dspL );
type[1] = MPI_INT ; lblq[1] = weight; dspl[1] = (MPI_Aint) (spr.vpos+dspZ ); type[1] = MPI_INT ; lblq[1] = weight; dspl[1] = (MPI_Aint) (spr.vpos+dspZ );
type[2] = MPI_DOUBLE; lblq[2] = weight; dspl[2] = (MPI_Aint) (spr.vval+dspZ ); type[2] = MPI_DOUBLE; lblq[2] = weight; dspl[2] = (MPI_Aint) (spr.vval+dspZ );
type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (vlen+dimL+dspL); // type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (vlen+dimL+dspL);
for (k=3; k>=0; k--) dspl[k] -= dspl[0]; for (k=2; k>=0; k--) dspl[k] -= dspl[0];
// Creation of the packet // Creation of the packet
MPI_Type_create_struct (4, lblq, dspl, type, &(pcknode->pack)); MPI_Type_create_struct (3, lblq, dspl, type, &(pcknode->pack));
MPI_Type_commit(&(pcknode->pack)); MPI_Type_commit(&(pcknode->pack));
} }
...@@ -139,10 +139,10 @@ void MakeSprMatrixRecvPacket (SparseMatrix sprL, int nnzL, ptr_PacketNode pcknod ...@@ -139,10 +139,10 @@ void MakeSprMatrixRecvPacket (SparseMatrix sprL, int nnzL, ptr_PacketNode pcknod
type[0] = MPI_INT ; lblq[0] = dimL; dspl[0] = (MPI_Aint) (sprL.vptr+1); type[0] = MPI_INT ; lblq[0] = dimL; dspl[0] = (MPI_Aint) (sprL.vptr+1);
type[1] = MPI_INT ; lblq[1] = nnzL; dspl[1] = (MPI_Aint) sprL.vpos; type[1] = MPI_INT ; lblq[1] = nnzL; dspl[1] = (MPI_Aint) sprL.vpos;
type[2] = MPI_DOUBLE; lblq[2] = nnzL; dspl[2] = (MPI_Aint) sprL.vval; type[2] = MPI_DOUBLE; lblq[2] = nnzL; dspl[2] = (MPI_Aint) sprL.vval;
type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (sprL.vptr+1+dimL); // type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (sprL.vptr+1+dimL);
for (k=3; k>=0; k--) dspl[k] -= dspl[0]; for (k=2; k>=0; k--) dspl[k] -= dspl[0];
// Creation of the packet // Creation of the packet
MPI_Type_create_struct (4, lblq, dspl, type, &(pcknode->pack)); MPI_Type_create_struct (3, lblq, dspl, type, &(pcknode->pack));
MPI_Type_commit(&(pcknode->pack)); MPI_Type_commit(&(pcknode->pack));
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment