Re: [petsc-dev] MatPinToCPU

2019-07-30 Thread Smith, Barry F. via petsc-dev
Sorry, I meant 24 CPU only > On Jul 30, 2019, at 9:19 AM, Mark Adams wrote: > > > > On Mon, Jul 29, 2019 at 11:27 PM Smith, Barry F. wrote: > > Thanks. Could you please send the 24 processors with the GPU? > > That is in out_cuda_24 > > >Note the final column of the

Re: [petsc-dev] MatPinToCPU

2019-07-30 Thread Mark Adams via petsc-dev
On Mon, Jul 29, 2019 at 11:27 PM Smith, Barry F. wrote: > > Thanks. Could you please send the 24 processors with the GPU? > That is in out_cuda_24 >Note the final column of the table gives you the percentage of flops > (not rates, actual operations) on the GPU. For you biggest

Re: [petsc-dev] MatPinToCPU

2019-07-29 Thread Smith, Barry F. via petsc-dev
Thanks. Could you please send the 24 processors with the GPU? Note the final column of the table gives you the percentage of flops (not rates, actual operations) on the GPU. For you biggest run it is For the MatMult it is 18 percent and for KSP solve it is 23 percent. I think this

Re: [petsc-dev] MatPinToCPU

2019-07-28 Thread Karl Rupp via petsc-dev
Hi Mark, feel free to submit a fresh pull request now. I looked at your latest commit in the repository in order to cherry-pick it, but it looked like it had a few other bits in it as well. Best regards, Karli On 7/28/19 6:27 PM, Mark Adams via petsc-dev wrote: This is looking good. I'm

Re: [petsc-dev] MatPinToCPU

2019-07-28 Thread Mark Adams via petsc-dev
This is looking good. I'm not seeing the numerical problems, but I've just hid them by avoiding the GPU on coarse grids. Should I submit a pull request now or test more or wait for Karl? On Sat, Jul 27, 2019 at 7:37 PM Mark Adams wrote: > Barry, I fixed CUDA to pin to CPUs correctly for GAMG

Re: [petsc-dev] MatPinToCPU

2019-07-27 Thread Mark Adams via petsc-dev
Barry, I fixed CUDA to pin to CPUs correctly for GAMG at least. There are some hacks here that we can work on. I will start testing it tomorrow, but I am pretty sure that I have not regressed. I am hoping that this will fix the numerical problems, which seem to be associated with empty

Re: [petsc-dev] MatPinToCPU

2019-07-27 Thread Smith, Barry F. via petsc-dev
> On Jul 27, 2019, at 11:53 AM, Mark Adams wrote: > > > On Sat, Jul 27, 2019 at 11:39 AM Smith, Barry F. wrote: > > Good catch. Thanks. Maybe the SeqCUDA has the same problem? > > THis is done (I may have done it). > > Now it seems to me that when you call VecPinToCPU you are setting

Re: [petsc-dev] MatPinToCPU

2019-07-27 Thread Smith, Barry F. via petsc-dev
Good catch. Thanks. Maybe the SeqCUDA has the same problem? > On Jul 27, 2019, at 10:40 AM, Mark Adams wrote: > > Yea, I just figured out the problem. VecDuplicate_MPICUDA did not call > PinToCPU or even copy pinnedtocpu. It just copied ops, so I added and am > testing: > > ierr =

Re: [petsc-dev] MatPinToCPU

2019-07-27 Thread Mark Adams via petsc-dev
Yea, I just figured out the problem. VecDuplicate_MPICUDA did not call PinToCPU or even copy pinnedtocpu. It just copied ops, so I added and am testing: ierr = VecCreate_MPICUDA_Private(*v,PETSC_TRUE,w->nghost,0);CHKERRQ(ierr); vw = (Vec_MPI*)(*v)->data; ierr =

Re: [petsc-dev] MatPinToCPU

2019-07-27 Thread Smith, Barry F. via petsc-dev
I don't understand the context. Once a vector is pinned to the CPU the flag should be PETSC_OFFLOAD_CPU permanently until the pin to cpu is turned off. Do you have a pinned vector that has the value PETSC_OFFLOAD_GPU? For example here it is set to PETSC_OFFLOAD_CPU PetscErrorCode

Re: [petsc-dev] MatPinToCPU

2019-07-27 Thread Mark Adams via petsc-dev
I'm not sure what to do here. The problem is that pinned-to-cpu vectors are calling *VecCUDACopyFromGPU* here. Should I set *x->valid_GPU_array *to something else, like PETSC_OFFLOAD_CPU, in PinToCPU so this block of code i s not executed? PetscErrorCode VecGetArray(Vec x,PetscScalar **a) {

Re: [petsc-dev] MatPinToCPU

2019-07-23 Thread Smith, Barry F. via petsc-dev
Yes, it needs to be able to switch back and forth between the CPU and GPU methods so you need to move into it the setting of the methods that is currently directly in the create method. See how MatConvert_SeqAIJ_SeqAIJViennaCL() calls ierr =

Re: [petsc-dev] MatPinToCPU

2019-07-23 Thread Mark Adams via petsc-dev
> > > What are the symptoms of it not working? Does it appear to be still > copying the matrices to the GPU? then running the functions on the GPU? > > The object is dispatching the CUDA mat-vec etc. I suspect the pinning is incompletely done for CUDA (and MPIOpenCL) > matrices. > > Yes, git

Re: [petsc-dev] MatPinToCPU

2019-07-23 Thread Smith, Barry F. via petsc-dev
> On Jul 23, 2019, at 9:12 AM, Mark Adams via petsc-dev > wrote: > > I've tried to add pining the matrix and prolongator to the CPU on coarse > grids in GAMG with this: > > /* pin reduced coase grid - could do something smarter */ > ierr =

[petsc-dev] MatPinToCPU

2019-07-23 Thread Mark Adams via petsc-dev
I've tried to add pining the matrix and prolongator to the CPU on coarse grids in GAMG with this: /* pin reduced coase grid - could do something smarter */ ierr = MatPinToCPU(*a_Amat_crs,PETSC_TRUE);CHKERRQ(ierr); ierr = MatPinToCPU(*a_P_inout,PETSC_TRUE);CHKERRQ(ierr); It does not