Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Iker Martín Álvarez
MAM_BICGSTAB
Commits
76e52114
Commit
76e52114
authored
Apr 02, 2024
by
iker_martin
Browse files
Fixed memory error in mpi_derived datatype
parent
f732b56c
Changes
1
Hide whitespace changes
Inline
Side-by-side
BiCGStab_Iker/ToolsMPI.c
View file @
76e52114
...
...
@@ -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
[
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
[
3
]
=
MPI_UB
;
lblq
[
3
]
=
1
;
dspl
[
3
]
=
(
MPI_Aint
)
(
spr
.
vptr
+
size
+
1
);
for
(
k
=
3
;
k
>=
0
;
k
--
)
dspl
[
k
]
-=
dspl
[
0
];
//
type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (spr.vptr+size+1);
for
(
k
=
2
;
k
>=
0
;
k
--
)
dspl
[
k
]
-=
dspl
[
0
];
// 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
));
}
...
...
@@ -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
[
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
[
3
]
=
MPI_UB
;
lblq
[
3
]
=
1
;
dspl
[
3
]
=
(
MPI_Aint
)
(
vlen
+
dimL
+
dspL
);
for
(
k
=
3
;
k
>=
0
;
k
--
)
dspl
[
k
]
-=
dspl
[
0
];
//
type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (vlen+dimL+dspL);
for
(
k
=
2
;
k
>=
0
;
k
--
)
dspl
[
k
]
-=
dspl
[
0
];
// 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
));
}
...
...
@@ -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
[
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
[
3
]
=
MPI_UB
;
lblq
[
3
]
=
1
;
dspl
[
3
]
=
(
MPI_Aint
)
(
sprL
.
vptr
+
1
+
dimL
);
for
(
k
=
3
;
k
>=
0
;
k
--
)
dspl
[
k
]
-=
dspl
[
0
];
//
type[3] = MPI_UB ; lblq[3] = 1 ; dspl[3] = (MPI_Aint) (sprL.vptr+1+dimL);
for
(
k
=
2
;
k
>=
0
;
k
--
)
dspl
[
k
]
-=
dspl
[
0
];
// 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
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment