Skip to content
Discussion options

You must be logged in to vote

There is no imposed ordering between the different processes when you print, so data can come out in any order. In particular, when running in parallel there is often some buffering that occurs such that some processes may appear to print after others.

You can sometimes avoid this by saying print(..., flush=True), but even then, output can be mixed up.

The parallel printing demo shows one way to print using PETSc facilities: the prints are now collective on a communicator and only rank 0 on that communicator prints.

If you really want everyone to print and you want deterministic ordering, then use PETSc.Sys.syncPrint. This buffers up (in rank order over a communicator) the prints from eac…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Hasupama
Comment options

@wence-
Comment options

Answer selected by dham
@Hasupama
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants