00001 #ifdef CH_LANG_CC 00002 /* 00003 * _______ __ 00004 * / ___/ / ___ __ _ / / ___ 00005 * / /__/ _ \/ _ \/ V \/ _ \/ _ \ 00006 * \___/_//_/\___/_/_/_/_.__/\___/ 00007 * Please refer to Copyright.txt, in Chombo's root directory. 00008 */ 00009 #endif 00010 00011 #ifndef _PARSTREAM_H_ 00012 #define _PARSTREAM_H_ 00013 00014 #include <iostream> 00015 #include <string> 00016 #include "BaseNamespaceHeader.H" 00017 00018 /// Use this in place of std::cout for program output. 00019 /** 00020 * Replaces std::cout in most of the Chombo code. In serial this just 00021 * returns std::cout. In parallel, this creates a separate file for each 00022 * proc called <basename>.n where n is the procID and <basename> defaults to 00023 * "pout" but can be set by calling setPoutBaseName(). Output is then 00024 * directed to these files. This keeps the output from different processors 00025 * from getting all jumbled up. 00026 If you want fewer files, you can do 00027 setenv CH_OUTPUT_INTERVAL nproc 00028 and it will only output every nproc processors pout.n files 00029 (where n%nproc == 0). 00030 */ 00031 std::ostream& pout(); 00032 00033 /// Changes the base part of the filename for pout() files. 00034 /** 00035 * When in parallel, changes the base name of the pout() files. If pout() 00036 * has already been called, it closes the current output file and opens a 00037 * new one (unless the name is the same, in which case it does nothing). 00038 * In serial, ignores the argument and does nothing. 00039 */ 00040 void setPoutBaseName(const std::string & a_Name); 00041 00042 /// Accesses the filename for the local pout() file. 00043 /** 00044 * Returns the name used for the local pout() file. In parallel this is 00045 * "<pout_basename>.<procID>", where <pout_basename> defaults to "pout" and 00046 * can be modified by calling setPoutBaseName(), and <procID> is the local 00047 * proc number. In serial, this always returns the string "cout". It is an 00048 * error (exit code 111) to call this in parallel before MPI_Initialize(). 00049 */ 00050 const std::string & poutFileName(); 00051 00052 #include "BaseNamespaceFooter.H" 00053 #endif // _PARSTREAM_H_