Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-27 Thread Mark Adams
On Mon, Jun 27, 2022 at 2:16 PM Matthew Martineau wrote: > Theoretically the access patterns can be worse, but our sparse operations > output matrices with unordered columns, so the fine matrix being sorted > shouldn’t impact the overall performance. > And this "unsorted" is really two _sorted_

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-27 Thread Matthew Martineau via petsc-dev
of the development version of PETSc Subject: Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs External email: Use caution opening links or attachments On Jun 25, 2022, at 9:44 AM, Matthew Martineau mailto:mmartin...@nvidia.com>> wrote: Thanks - AmgX will accept unordered column indices.

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-27 Thread Mark Adams
It looks like the problem is with a commit: ** | | | | | e24d7920346 - Fixing issue with PCReset_AMGX (5 days ago) * (see at end of log below) Somehow this got on a different "branch". I manually merged this commit and the rest of the rebase went well. * 3d182f284fb - (HEAD -> adams/pcamgx,

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-26 Thread Mark Adams
On Sat, Jun 25, 2022 at 9:39 AM Barry Smith wrote: > > Does AMGX require sorted column indices? (Python indentation notation > below) > > If not > just use MatMPIAIJGetLocalMatMerge instead of MatMPIAIJGetLocalMat. > > Ugh, I worked on this this AM without rebasing over main and lost my

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-25 Thread Barry Smith
> > From: Barry Smith > Sent: Saturday, 25 June 2022, 14:39 > To: Mark Adams > Cc: Matthew Martineau ; For users of the development > version of PETSc > Subject: Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs > > External email: Use caution opening links

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-25 Thread Matthew Martineau via petsc-dev
Thanks - AmgX will accept unordered column indices. From: Barry Smith Sent: Saturday, 25 June 2022, 14:39 To: Mark Adams Cc: Matthew Martineau ; For users of the development version of PETSc Subject: Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-25 Thread Barry Smith
;>>> errors (presumably because of the type mismatch). >>>> >>>> If we call MatSeqAIJGetArrayRead on localA and then pass the `values` to >>>> AmgX it seems to detect that the pointer is a device mapped pointer but >>>> that it is inval

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-25 Thread Mark Adams
GetArrayRead on localA and then pass the `values` >>>> to AmgX it seems to detect that the pointer is a device mapped pointer but >>>> that it is invalid. >>>> >>>> PetscCall(MatMPIAIJGetLocalMat(Pmat, MAT_REUSE_MATRIX, >localA)); >>>&

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-24 Thread Barry Smith
eems to >>> return invalid pointer, but I’ll investigate more >>> >>> This doesn’t reproduce if we call: >>> >>> PetscCall(MatMPIAIJGetLocalMat(Pmat, MAT_INITIAL_MATRIX, >localA)); >>> PetscCall(MatSeqAIJGetArrayRead(amgx->localA, >valu

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-24 Thread Mark Adams
tArrayRead(amgx->localA, >values)); // Seems >>> to return invalid pointer, but I’ll investigate more >>> >>> This doesn’t reproduce if we call: >>> >>> PetscCall(MatMPIAIJGetLocalMat(Pmat, MAT_INITIAL_MATRIX, >localA)); >>> PetscCall(MatSeqAIJGe

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-24 Thread Barry Smith
t of A and the device pointer to the matrix values from that >> structure so that we can pass to AmgX. Preferring whichever API calls are >> the most efficient. >> >> >> From: Stefano Zampini > <mailto:stefano.zamp...@gmail.com>> >> Sent: 23 June

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-24 Thread Mark Adams
tch >> the local part of A and the device pointer to the matrix values from that >> structure so that we can pass to AmgX. Preferring whichever API calls are >> the most efficient. >> >> >> *From:* Stefano Zampini >> *Sent:* 23 June 2022 20:55 >> *To:* Mark Adam

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-24 Thread Mark Adams
achieve is that when we are parallel, we fetch > the local part of A and the device pointer to the matrix values from that > structure so that we can pass to AmgX. Preferring whichever API calls are > the most efficient. > > > *From:* Stefano Zampini > *Sent:* 23 June 2022 20:5

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Matthew Martineau via petsc-dev
r users of the development version of PETSc ; Matthew Martineau Subject: Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs External email: Use caution opening links or attachments The logic is wrong. It should check for MATSEQAIJCUSPARSE. On Thu, Jun 23, 2022, 21:36 Mark Adams mailto:mfad...

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Barry Smith
t efficient. > > > From: Stefano Zampini <mailto:stefano.zamp...@gmail.com>> > Sent: 23 June 2022 20:55 > To: Mark Adams mailto:mfad...@lbl.gov>> > Cc: Barry Smith mailto:bsm...@petsc.dev>>; For users of > the development version of PETSc <mailto

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Stefano Zampini
The logic is wrong. It should check for MATSEQAIJCUSPARSE. On Thu, Jun 23, 2022, 21:36 Mark Adams wrote: > > > On Thu, Jun 23, 2022 at 3:02 PM Barry Smith wrote: > >> >> It looks like the current code copies the nonzero values to the CPU >> from the MPI matrix (with the calls >>

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Mark Adams
On Thu, Jun 23, 2022 at 3:02 PM Barry Smith wrote: > > It looks like the current code copies the nonzero values to the CPU from > the MPI matrix (with the calls > PetscCall(MatSeqAIJGetArrayRead(mpimat->A,)); > PetscCall(MatSeqAIJGetArrayRead(mpimat->B,));, then copies them into > the CPU

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Barry Smith
It looks like the current code copies the nonzero values to the CPU from the MPI matrix (with the calls PetscCall(MatSeqAIJGetArrayRead(mpimat->A,)); PetscCall(MatSeqAIJGetArrayRead(mpimat->B,));, then copies them into the CPU memory of the Seq matrix. When the matrix entries are next

Re: [petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Stefano Zampini
How do you use amgx->localA after it is created? On Thu, Jun 23, 2022, 20:25 Mark Adams wrote: > We have a bug in the AMGx test snes_tests-ex13_amgx in parallel. > Matt Martineau found that MatMPIAIJGetLocalMat worked in the first pass in > the code below, where the local matrix is created

[petsc-dev] MatMPIAIJGetLocalMat problem with GPUs

2022-06-23 Thread Mark Adams
We have a bug in the AMGx test snes_tests-ex13_amgx in parallel. Matt Martineau found that MatMPIAIJGetLocalMat worked in the first pass in the code below, where the local matrix is created (INITIAL), but in the next pass, when "REUSE" is used, he sees an invalid pointer. Matt found that it does