[petsc-users] query on meaning of libmpiuni.*

2010-03-01 Thread Toby D. Young

Greetings,

I am very curious to understand why libmpiuni is there PETSc and how
he is implemented by PETSc and PETSc-based programs.

I understand that this library can be built as static or dynamic; right?
I also understand that this library is used when PETSc is compiled with
MPI, but the program is run without mpirun. (What about mpirun -np
1 ./program.x ?)

In short, in which casses should I make sure that libmpiuni exists?
Is there some documentation I have missed, but that I can read to dig a
little deeper to understand the usage of the libmp[iuni.* library?

Many thanks.

Best,
Toby


[petsc-users] query on meaning of libmpiuni.*

2010-03-01 Thread Jed Brown
On Mon, 1 Mar 2010 13:20:49 +0100, Toby D. Young tyoung at ippt.gov.pl 
wrote:
 
 Greetings,
 
 I am very curious to understand why libmpiuni is there PETSc and how
 he is implemented by PETSc and PETSc-based programs.
 
 I understand that this library can be built as static or dynamic; right?
 I also understand that this library is used when PETSc is compiled with
 MPI, but the program is run without mpirun. (What about mpirun -np
 1 ./program.x ?)

MPIUNI is only used if you have not built with a real MPI.  It's purpose
is to allow code to be written for the more complex (parallel) case
without littering the code with #ifdef PARALLEL statements.  It
implements trivial MPI functionality when there is only process (note
that one process is not the same as one processor or one core).

If a real MPI is available on your system, then you should use it even
if you only intend to run single-process jobs.  This will not reduce
serial performance, but it allows you to interoperate more easily with
other libraries that also use MPI, and it allows you to run with
multiple jobs (again, you do not need multiple cores for this to be
useful, it is convenient for testing algorithmic correctness and
scalability).

Jed


[petsc-users] query on meaning of libmpiuni.*

2010-03-01 Thread Toby D. Young

Thanks Jed, that more-or-less covers everything I wanted to know!

Best,
Toby

-

Toby D. Young
Assistant Professor
Philosophy-Physics
Polish Academy of Sciences
Warszawa, Polska

www:   http://www.ippt.gov.pl/~tyoung
skype: stenografia

On Mon, 1 Mar 2010, Jed Brown wrote:

 On Mon, 1 Mar 2010 13:20:49 +0100, Toby D. Young tyoung at ippt.gov.pl 
 wrote:
 
  Greetings,
 
  I am very curious to understand why libmpiuni is there PETSc and how
  he is implemented by PETSc and PETSc-based programs.
 
  I understand that this library can be built as static or dynamic; right?
  I also understand that this library is used when PETSc is compiled with
  MPI, but the program is run without mpirun. (What about mpirun -np
  1 ./program.x ?)

 MPIUNI is only used if you have not built with a real MPI.  It's purpose
 is to allow code to be written for the more complex (parallel) case
 without littering the code with #ifdef PARALLEL statements.  It
 implements trivial MPI functionality when there is only process (note
 that one process is not the same as one processor or one core).

 If a real MPI is available on your system, then you should use it even
 if you only intend to run single-process jobs.  This will not reduce
 serial performance, but it allows you to interoperate more easily with
 other libraries that also use MPI, and it allows you to run with
 multiple jobs (again, you do not need multiple cores for this to be
 useful, it is convenient for testing algorithmic correctness and
 scalability).

 Jed



[petsc-users] query on meaning of libmpiuni.*

2010-03-01 Thread Satish Balay
On Mon, 1 Mar 2010, Toby D. Young wrote:

 
 One final question please:
 
  I understand that this library can be built as static or dynamic; right?
 
 Then I look at my build, and only libmpiuni.a appears. Why is that? Can a
 libmpiuni.so exist? I build --with-shared=1.

Yes - is is the deficiency of the old build tools. libpetsc.so is
created by linking in all dependencies [and if libmpiuni.a is a
dependency - these symbols are added to libpetsc.so]

With petsc-dev both .a/.so versions of libmpiuni are merged into
-lpetsc [or -lpetcsys for --with-single-library=0]

Satish