[petsc-users] PETSc and AMPI
Barry Smith
bsmith at mcs.anl.gov
Sun Feb 1 21:59:56 CST 2015
> On Feb 1, 2015, at 9:33 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> Barry Smith <bsmith at mcs.anl.gov> writes:
>> We could possibly "cheat" with AMPI to essentially have
>> PetscInitialize()/Finalize() run through most their code only on
>> thread 0 (assuming we have a way of determining thread 0)
>
> Just guard it with a lock.
Not sure what you mean here. We want that code to be only run through once, we don't want or need it to be run by each thread. It makes no sense for each thread to call TSInitializePackage() for example.
>
>> to create the "global" data structures (this is registering of
>> objects, classids etc) and only call MPI_Init() and whatever else
>> needs to be called by all of them. May not be too ugly, but yet
>> another "special case" leading to more complexity of the code base.
>
> What about debugging and profiling?
This is the same issue for "thread safety"* as well as AMPI. I don't think AMPI introduces any particular additional hitches.
Barry
* in the sense that it is currently implemented meaning each thread works on each own objects so doesn't need to lock "MatSetValues" etc. This other "thread safety" has its own can of worms.
More information about the petsc-users
mailing list