[petsc-dev] VecNestSetSubVec for VecNest.

Vijay S. Mahadevan vijay.m at gmail.com
Sat Oct 15 10:12:19 CDT 2011


Find attached the bundle with the changes for
VecNestSetSubVec/VecNestSetSubVecs. The test file and the outputs are
also included in the bundle. Feel free to modify the documentation if
need be.

The only thing that I think needs a better implementation is the
SetSubVecs where I've just looped over the indices and recursively
called the single SetSubVec. This was hard to optimize since
accommodating variable vectors involves traversing the IS one by one
and I couldn't figure out a way to implement this concurrently.
Anyway, if you can think of something better, let me know.

Vijay

On Thu, Oct 13, 2011 at 9:06 AM, Vijay S. Mahadevan <vijay.m at gmail.com> wrote:
> I will certainly look at the guidelines and make a patch with documentation
> by tomorrow.
>
> Vijay
>
> On Oct 13, 2011 8:15 AM, "Jed Brown" <jedbrown at mcs.anl.gov> wrote:
>>
>> On Thu, Oct 13, 2011 at 00:55, Vijay S. Mahadevan <vijay.m at gmail.com>
>> wrote:
>>>
>>> Attached is a test file with a routine VecNestSetSubVec to modify a
>>> block of a Nest vector after initial creation. This functionality does
>>> not exist as of now and this is my first crack at it. The test_vec_ops
>>> also has several variations of tests and all of them pass currently.
>>> The function VecSize_Nest_Recursive_duplicate, as the name suggests is
>>> a duplicate of "VecSize_Nest_Recursive" private routine in vecnest.c
>>>
>>> If you find something wrong, do let me know. Feel free to
>>> modify/optimize the routine as necessary as I feel it could use some
>>> level of recursion but I can't see it as of now. If the functionality
>>> is acceptable, perhaps the routine could be added to VecNest
>>> implementation.
>>
>> Thanks. Would you be willing to put this routine into vecnest.c with
>> dynamic dispatch and a manual page (search for VecNestSetSubVec() and follow
>> the pattern)? You can put your test code in src/vec/vec/examples/tests/ with
>> output so that it gets run in the nightlies. Please follow the indenting and
>> code formatting guidelines, commit the patch, and send with hg bundle or hg
>> export.
>> Let me know if you don't have time or don't think you will ever contribute
>> to PETSc. But if you think you'll have other patches (ISNest ;-)), this
>> would be a good one to familiarize yourself with the process.
>>
>> Barry, note that this implementation allows resizing by setting nested
>> blocks of a different size.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vecnest-setsubvecs.hg
Type: application/octet-stream
Size: 4301 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111015/c2c5b7ca/attachment.obj>


More information about the petsc-dev mailing list