[petsc-users] Problem when using MatLoad
Matteo Aletti
matteo.aletti at inria.fr
Thu Apr 9 06:02:41 CDT 2015
Hello,
I was trying to use the function MatLoad to read an mpi dense (square)
matrix from a binary file.
I got an error related to a memory problem (in parallel).
I tried to locate the problem using gdb and I think it is in the
function /MatLoad_MPIDense_DenseInFile//.
/The master cannot execute the line /
/
/ ierr = PetscFree(vals);CHKERRQ(ierr);/
without an error. The other processors can.
For me, the error is in the allocation of the /vals/ array: each
processor allocates it with m*N number of elements, where N is the same
for all of the procs and m is the local number of rows, which in my case
is already given in the matrix.
The master uses the array vals to read its own data, but also the other
processors' data. The problem is that, in my case, one processor has a
higher number of rows than the master and therefore vals is too short to
store those values. For me the master should allocate it with size
m_max*N , where m_max is the maximum number of local rows between all procs.
Thanks,
Best,
Matteo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150409/56a2b85b/attachment.html>
More information about the petsc-users
mailing list