[petsc-users] Is there a corresponding function in petsc4py to VecMPISetFhost

Aron Ahmadia aron.ahmadia at kaust.edu.sa
Mon Jul 2 08:38:57 CDT 2012


Unless you have modified your PYTHONPATH variable or your site-packages
settings, this command:

python setup.py install --user

will not actually install petsc4py in a location visible to your Python
installation.  Unfortunately, the Python procedures and documentation for
"user-local" installations are fairly poor in comparison to the rest of
Python's friendliness.  I rely on virtualenv to set up an environment that
I can just "pip install" into.  I recommend using virtualenv, as properly
using it can save you a lot of headaches when developing in Python.  See
this answer on StackExchange to understand how to get set up with


Once you have created a virtualenv, you can then cd into the directory of
code you'd like to use and type:

pip install -e .

This allows you to modify the code and have those changes reflected when
you reload the virtual environment's Python interpreter.

If you just need to install once, you can just do:

pip install .


python setup.py install

And the package will be installed into the virtual environment, though you
will need to re-install if you make any changes.

Hope this helps,

On Mon, Jul 2, 2012 at 4:25 PM, Xin Zhao <sean.null at gmail.com> wrote:

> Hi Jed,
> I've add the code to petsc4py and then
> I typed in terminal:
> python setup.py build
> python setup.py install --user
> But I still can not find the method Vec.setMPIGhost().
> I know the question is stupid, but I really need your help.
> Regards,
> Xin
> On Mon, Jul 2, 2012 at 10:42 AM, Din Zhao <sean.null at gmail.com> wrote:
>> Thank you all.
>> On Jul 2, 2012, at 2:55 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
>> No, but you can use Vec.createGhost()
>> On Sun, Jul 1, 2012 at 5:22 PM, Din Zhao <sean.null at gmail.com> wrote:
>>> And in general, does any function in petsc have a counterpart in
>>> petsc4py?
>> Most do, but the projects are maintained somewhat separately so not every
>> one make it into petsc4py. Also, sometimes a more "pythonic" interface is
>> adopted by petsc4py, so the calls don't line up exactly.


This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing 
this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120702/1aed647d/attachment.html>

More information about the petsc-users mailing list