Code structuring - Communicator

Amit.Itagi at seagate.com Amit.Itagi at seagate.com
Fri May 9 12:46:59 CDT 2008


Hi,

I have a question about the Petsc communicator. I have a petsc program
"foo" which essentially runs in parallel and gives me y=f(x1,x2,...), where
y is an output parameter and xi's are input parameters. Suppose, I want to
run a parallel optimizer for the input parameters. I am looking at the
following functionality. I submit the optimizer job on 16 processors (using
"mpiexec -np 16 progName"). The optimizer should then submit 4 runs of
"foo", each running parallely on 4 processors. "foo" will be written as a
function and not as a main program in this case. How can I get this
functionality using Petsc ? Should PetscInitialize be called in the
optimizer, or in each foo run ? If PetscInitialize is called in the
optimizer, is there a way to make the foo function run only on a subset of
the 16 processors ?

May be, I haven't done a good job of explaining my problem. Let me know if
you need any clarifications.

Thanks

Rgds,
Amit




More information about the petsc-users mailing list