[petsc-dev] Segmentation faults in MatMatMult & MatTransposeMatMult
Pierre Jolivet
pierre.jolivet at enseeiht.fr
Mon Jan 14 23:54:48 CST 2019
> On 15 Jan 2019, at 6:26 AM, Jed Brown <jed at jedbrown.org> wrote:
>
> We should repair the MPI matrix implementations so that this works on communicators of size 1
Great, I was worried that I missed somewhere that it is explicitly stated that you should not use MPI types on communicators of size 1.
> but why can't you use MatXAIJSetPreallocation().
OK, replace my if then else by if(comm_size == 1) VecCreateSeqWithArray else VecCreateMPIWithArray
There is also no MatXBAIJSetPreallocationCSR or MatXDenseSetPreallocation, so that's other if then elses.
Or am I missing something?
Thanks,
Pierre
> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatXAIJSetPreallocation.html <https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatXAIJSetPreallocation.html>
>
> Pierre Jolivet via petsc-dev <petsc-dev at mcs.anl.gov <mailto:petsc-dev at mcs.anl.gov>> writes:
>
>> Cf. the end of my sentence: "(I know, I could switch to SeqAIJ_SeqDense, but that is not an option I have right now)”
>> All my Mat are of type MATMPIX. Switching to MATX here as you suggested would mean that I need to add a bunch of if(comm_size == 1) MatSeqXSetPreallocation else MatMPIXSetPreallocation in the rest of my code, which is something I would rather avoid.
>>
>> Thanks,
>> Pierre
>>
>>> On 14 Jan 2019, at 10:30 PM, Zhang, Hong <hzhang at mcs.anl.gov> wrote:
>>>
>>> Replace
>>> ierr = MatSetType(A, MATMPIAIJ);CHKERRQ(ierr);
>>> to
>>> ierr = MatSetType(A, MATAIJ);CHKERRQ(ierr);
>>>
>>> Replace
>>> ierr = MatSetType(B, MATMPIDENSE)i;CHKERRQ(ierr);
>>> to
>>> ierr = MatSetType(B, MATDENSE)i;CHKERRQ(ierr);
>>>
>>> Then add
>>> MatSeqAIJSetPreallocation()
>>> MatSeqDenseSetPreallocation()
>>>
>>> Hong
>>>
>>> On Mon, Jan 14, 2019 at 2:51 PM Pierre Jolivet via petsc-dev <petsc-dev at mcs.anl.gov <mailto:petsc-dev at mcs.anl.gov> <mailto:petsc-dev at mcs.anl.gov <mailto:petsc-dev at mcs.anl.gov>>> wrote:
>>> Hello,
>>> Is there any chance to get MatMatMult_MPIAIJ_MPIDense and MatTransposeMatMult_MPIAIJ_MPIDense fixed so that the attached program could run _with a single_ process? (I know, I could switch to SeqAIJ_SeqDense, but that is not an option I have right now)
>>>
>>> Thanks in advance,
>>> Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20190115/fc89759b/attachment-0001.html>
More information about the petsc-dev
mailing list