how to initialize a parallel vector from one process?

Tonellot, Thierry-Laurent D thierrylaurent.tonellot at aramco.com
Sun Jul 6 03:22:34 CDT 2008


Hi,

At the very beginning of my application I need to read data in a database to initialize a 3D vector distributed over several processes.
The database I'm using can only be accessed by one process (for instance the process 0). Moreover, due to performance issues, we need to limit the request to the database. Therefore the data need to be read by slices, for instance (z,x) slices.
A typical initialization would then consist in the following pseudo code:

Loop over y
            If (rank=0)
                        Read slice y
                        Send to each process the appropriate part of the data slice
Else
            Receive data
Endif
End loop

This process is quite heavy and its performances will probably depend on the way it is implemented.

I'm wondering if there is any way to perform this initialization efficiently using Petsc?

I'm also considering other packages to handle distributed arrays and I'm wondering how a package like global arrays compares with petsc/DA?

For instance global arrays seem to have a feature which is partly solving my problem above using the function "ga_fill_patch" which fills only a region of the parallel vector and can be called by any process...

Thank you in advance,

Thierry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080706/935b6376/attachment.htm>


More information about the petsc-users mailing list