Chombo + EB  3.2
parstream.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _PARSTREAM_H_
12 #define _PARSTREAM_H_
13 
14 #include <iostream>
15 #include <string>
16 #include "BaseNamespaceHeader.H"
17 
18 /// Use this in place of std::cout for program output.
19 /**
20  * Replaces std::cout in most of the Chombo code. In serial this just
21  * returns std::cout. In parallel, this creates a separate file for each
22  * proc called <basename>.n where n is the procID and <basename> defaults to
23  * "pout" but can be set by calling setPoutBaseName(). Output is then
24  * directed to these files. This keeps the output from different processors
25  * from getting all jumbled up.
26  If you want fewer files, you can do
27  setenv CH_OUTPUT_INTERVAL nproc
28  and it will only output every nproc processors pout.n files
29  (where n%nproc == 0).
30 */
31 std::ostream& pout();
32 
33 /// Changes the base part of the filename for pout() files.
34 /**
35  * When in parallel, changes the base name of the pout() files. If pout()
36  * has already been called, it closes the current output file and opens a
37  * new one (unless the name is the same, in which case it does nothing).
38  * In serial, ignores the argument and does nothing.
39 */
40 void setPoutBaseName(const std::string & a_Name);
41 
42 /// Accesses the filename for the local pout() file.
43 /**
44  * Returns the name used for the local pout() file. In parallel this is
45  * "<pout_basename>.<procID>", where <pout_basename> defaults to "pout" and
46  * can be modified by calling setPoutBaseName(), and <procID> is the local
47  * proc number. In serial, this always returns the string "cout". It is an
48  * error (exit code 111) to call this in parallel before MPI_Initialize().
49 */
50 const std::string & poutFileName();
51 
52 #include "BaseNamespaceFooter.H"
53 #endif // _PARSTREAM_H_
std::ostream & pout()
Use this in place of std::cout for program output.
const std::string & poutFileName()
Accesses the filename for the local pout() file.
void setPoutBaseName(const std::string &a_Name)
Changes the base part of the filename for pout() files.