2

I am using pdpotrf() in order to perform the Cholesky decomposition. Then I want to call pdpotri(), in order to invert the matrix. The function is called from every process, just after pdpotrf(). Should I put a barrier there, so that I am sure that all the processes are done with the Cholesky factorization, and then move on to the inversion part, or it's not needed?

I wrote some examples with tiny inputs, which show that it's not needed, but I want to be sure that I am not just (un)lucky and face a problem with larger inputs.

Note that by a barrier I mean this: MPI_Barrier(MPI_COMM_WORLD);


EDIT

I just worry that inverting may start, before some other process has terminated the Cholesky decomposition. Does pdpotri() take care of this? I mean, it checks and waits if needed. Or does pdpotri() work only in the submatrix of its calling process? If so, then no barrier is needed.

gsamaras
  • 71,951
  • 46
  • 188
  • 305
  • Because pdpotri() must always come after pdpotrf(), if a barrier is needed, it would make the most sense for ScaLapack to have implemented it implicitly in the beginning of the function call for pdpotri(). I'm pretty sure that no explicit barrier is needed. – NoseKnowsAll Jul 16 '15 at 13:58
  • Explicit barrier synchronisation is almost never needed in **correct** MPI applications that perform pure message passing as the synchronisation occurs naturally through the data dependency between the send and receive calls. Barriers are usually needed in order to synchronise with the completion of external events, e.g. concurrent data I/O, or when benchmarking in order to get the processes in sync. – Hristo Iliev Jul 17 '15 at 09:10
  • I see @HristoIliev, thanks for your comment. – gsamaras Jul 17 '15 at 10:56

1 Answers1

2

While I have not looked into the details of pdpotri() and pdpotrf(), I see two cases:

1) There needs to be a barrier between the two functions. In this case, however, because pdpotri() must always come after pdpotrf(), it would make the most sense for there to be an implicit boundary built-in to the beginning of pdpotri().

2) There does not need to be a barrier between the two functions.

In either case, it should not be necessary for you to write your own explicit barrier using MPI_Barrier().

NoseKnowsAll
  • 4,593
  • 2
  • 23
  • 44