[petsc-users] fixing code w.r.t. new block size argument in VecCreateMPIWithArray

Barry Smith bsmith at mcs.anl.gov
Sun Aug 12 12:01:04 CDT 2012


On Aug 12, 2012, at 10:01 AM, Kenneth Hoste <kenneth.hoste at ugent.be> wrote:

> Hello PETSc users,
> 
> I am trying to build the latest stable release of Trilinos (v10.12.2), with PETSc 3.3-p2 as one of the dependencies.
> 
> This fails, because Trilinos v10.12.2 doesn't yet cope with some of the changes made in PETSc v3.3, in particular the extra block size argument that was added to the VecCreateMPIWithArray function (as reported on http://www.mcs.anl.gov/petsc/documentation/changes/33.html).
> 
> My question is simple (I think): how should code that is using the VecCreateMPIWithArray function before the block size argument was introduced be changed such that it compiles and works correctly?
> 
> Frankly, I have no idea what the code does (I'm not an end-user), I'm just trying to get it to build. 
> 
> My gut feeling says that I should just add the block size argument as '1', which seems a reasonable default is no block size was being used before.
> So, I would change the current code
> 
> VecCreateMPIWithArray(comm->USR_comm,inlen,PETSC_DECIDE,x2,&petscX);
> 
> to something like
> 
> VecCreateMPIWithArray(comm->USR_comm, 1, inlen,PETSC_DECIDE,x2,&petscX);
> 
> 
> Is that correct, or is there another way to fix this?

   Yes, start with this and it will hopefully resolve all the problems.

    Barry


> 
> 
> 
> regards,
> 
> Kenneth



More information about the petsc-users mailing list