Either one is fine. The only thing mandated by the MPI Standard is that you can't use any other MPI functions before you call MPI_INIT
or after you call MPI_FINALIZE
. You can do other things before and after those calls, but you can't use MPI.
There's an entire section about this in the MPI Standard (Section 8.7, older HTML version available here).