Hi Jed,

I thought that they would be similar to VecGetArrayF90, but evidently they are not...

Strangely, valgrind reports a problem in VecSetValues, but not in VecGetValues. There are a few occurrences of a XXXGetYYY without a matching XXXRestoreYYY (but I can’t think of any at the moment), typically when the Get does not allocate any memory but just returns a pointer. I would indeed prefer if all Get were matched with a Restore, even if the Restore does nothing. 

Regards,
Blaise


On Jun 26, 2022, at 1:20 AM, Jed Brown <[email protected]> wrote:

Sorry about our late reply. Isn't VecGetValues similar? Note that VecGetValuesSection currently leaks a mutable pointer and really shouldn't exist like this without a matching VecRestoreValuesSection.

 PetscCall(VecGetArray(v, &baseArray));
 *values = &baseArray[s->atlasOff[p]];
 PetscCall(VecRestoreArray(v, &baseArray));


Can you make a draft MR with what you've tried thus far?

Blaise Bourdin <[email protected]> writes:

Hi,

I’ve been trying to add a fortran90 binding for VecGetValuesSection, without success, and could not find any function with a similar prototype to learn from. Can anybody help?

Regards,
Blaise

--
Professor, Department of Mathematics & Statistics
Hamilton Hall room 409A, McMaster University
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada
https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243

-- 
Professor, Department of Mathematics & Statistics
Hamilton Hall room 409A, McMaster University
1280 Main Street West, Hamilton, Ontario L8S 4K1, Canada 
https://www.math.mcmaster.ca/bourdin | +1 (905) 525 9140 ext. 27243

Reply via email to