Chombo + EB  3.0
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 
34 /// Changes the base part of the filename for pout() files.
35 /**
36  * When in parallel, changes the base name of the pout() files. If pout()
37  * has already been called, it closes the current output file and opens a
38  * new one (unless the name is the same, in which case it does nothing).
39  * In serial, ignores the argument and does nothing.
40 */
41 void setPoutBaseName(const std::string & a_Name);
42 
43 
44 /// Accesses the filename for the local pout() file.
45 /**
46  * Returns the name used for the local pout() file. In parallel this is
47  * "<pout_basename>.<procID>", where <pout_basename> defaults to "pout" and
48  * can be modified by calling setPoutBaseName(), and <procID> is the local
49  * proc number. In serial, this always returns the string "cout". It is an
50  * error (exit code 111) to call this in parallel before MPI_Initialize().
51 */
52 const std::string & poutFileName();
53 
54 #include "BaseNamespaceFooter.H"
55 #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.