[petsc-users] Global variables

Jed Brown jed at 59A2.org
Sun May 8 11:59:00 CDT 2011


On Sun, May 8, 2011 at 18:54, Bartłomiej W <bartlomiej.wach at yahoo.pl> wrote:

> Hello,
>
> In my application, process of rank 0 reads an integer from a file, can I
> broadcast it without using a Vec?
>

Sure,

int myint;
if (!rank) {
  myint = from_file(...);
}
MPI_Bcast(&myint,1,MPI_INT,0,PETSC_COMM_WORLD);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110508/8a7e12d4/attachment.htm>


More information about the petsc-users mailing list