petsc-3.7.1 2016-05-15
Report Typos and Errors

# PetscSequentialPhaseBegin

Begins a sequential section of code.

### Synopsis

    #include "petscsys.h"
    PetscErrorCode  PetscSequentialPhaseBegin(MPI_Comm comm,int ng)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - Communicator to sequentialize. Many br
| ng | - Number in processor group. This many processes are allowed to execute Many brat the same time (usually 1) Many br

Many br

### Notes

PetscSequentialPhaseBegin() and PetscSequentialPhaseEnd() provide a Many brway to force a section of code to be executed by the processes in Many brrank order. Typically, this is done with Many br

          PetscSequentialPhaseBegin(comm, 1);
          <code to be executed sequentially>
          PetscSequentialPhaseEnd(comm, 1);

Many br

Often, the sequential code contains output statements (e.g., printf) to Many brbe executed. Note that you may need to flush the I/O buffers before Many brcalling PetscSequentialPhaseEnd(). Also, note that some systems do Many brnot propagate I/O in any order to the controling terminal (in other words, Many breven if you flush the output, you may not get the data in the order Many brthat you want). Many br

### See Also

PetscSequentialPhaseEnd()

Level:intermediate
Location:src/sys/utils/mpiu.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages