UseCaseEnvironment.hpp

00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef stk_util_use_cases_UseCaseEnvironement_hpp
00010 #define stk_util_use_cases_UseCaseEnvironement_hpp
00011 
00012 #include <boost/program_options.hpp>
00013 
00014 #include <stk_util/parallel/Parallel.hpp>
00015 #include <stk_util/parallel/BroadcastArg.hpp>
00016 #include <stk_util/diag/Writer_fwd.hpp>
00017 #include <stk_util/diag/Timer.hpp>
00018 #include <stk_util/environment/OutputLog.hpp>
00019 #include <stk_util/environment/ProgramOptions.hpp>
00020 #include <stk_util/environment/ReportHandler.hpp>
00021 #include <stk_util/environment/RuntimeWarning.hpp>
00022 #include <stk_util/environment/RuntimeDoomed.hpp>
00023 
00024 #include <iosfwd>
00025 
00026 namespace use_case {
00027 
00028 enum LogMask {
00029   LOG_ALWAYS    = stk::LOG_ALWAYS,
00030   LOG_TRACE   = stk::LOG_TRACE,
00031   LOG_TRACE_STATS = stk::LOG_TRACE_STATS,
00032   LOG_TRACE_SUB_CALLS = stk::LOG_TRACE_SUB_CALLS,
00033   LOG_MEMBERS   = stk::LOG_MEMBERS,
00034 
00035   LOG_SEARCH            = 0x0000010,
00036   LOG_TRANSFER          = 0x0000020,
00037   LOG_TIMER             = 0x0000040
00038 };
00039 
00044 enum message_type {
00045   MSG_WARNING = stk::MSG_WARNING,
00046   MSG_FATAL = stk::MSG_DOOMED,
00047   MSG_INFORMATION,
00048   MSG_EXCEPTION,
00049   MSG_PARALLEL_EXCEPTION
00050 };
00051 
00052 
00057 enum message_throttle_type {
00058   MSG_APPLICATION = stk::MSG_APPLICATION,
00059   MSG_TIME_STEP
00060 };
00061 
00062 enum TimerSetMask {
00063   TIMER_MESH    = 0x00000001,   
00064   TIMER_MESH_IO   = 0x00000002,   
00065   TIMER_SEARCH    = 0x00000004,   
00066   TIMER_TRANSFER  = 0x00000008,   
00067   TIMER_ALL   = 0xFFFFFFFF,   
00068   
00069   TIMER_FORCE   = 0x00000000    
00070 };
00071 
00072 std::ostream &out();                
00073 std::ostream &dout();               
00074 std::ostream &pout();               
00075 std::ostream &tout();               
00076 
00077 std::ostream &dwout();              
00078 
00079 stk::diag::Writer &dw();
00080 
00081 stk::diag::TimerSet &timerSet();
00082 
00083 stk::diag::Timer &timer();
00084 
00085 void my_report_handler(const char *message, int type);
00086 
00087 struct UseCaseEnvironment
00088 {
00089   UseCaseEnvironment(int *argc, char ***argv);
00090 
00091   ~UseCaseEnvironment();
00092 
00093   const stk::ParallelMachine    m_comm;
00094   std::string                   m_workingDirectory;
00095 };
00096 
00097 } // namespace use_case
00098 
00099 #endif // stk_util_use_cases_UseCaseEnvironement_hpp
Generated on Wed Apr 13 10:05:49 2011 for Sierra Toolkit by  doxygen 1.6.3