8 #ifndef cf3_common_PE_debug_HPP
9 #define cf3_common_PE_debug_HPP
15 #include <boost/thread/thread.hpp>
36 #define PERank "["<<::cf3::common::PE::Comm::instance().rank() << "] "
43 #define PEProcessSortedExecute(irank,expression) { \
45 int _process_sorted_execute_i_; \
46 int _process_sorted_execute_n_=(int)(::cf3::common::PE::Comm::instance().size()); \
47 int _process_sorted_execute_r_=(int)(::cf3::common::PE::Comm::instance().rank()); \
48 ::cf3::common::PE::Comm::instance().barrier(); \
49 std::cout << std::flush; \
50 ::cf3::common::PE::Comm::instance().barrier(); \
51 for(_process_sorted_execute_i_=0; _process_sorted_execute_i_<_process_sorted_execute_n_; _process_sorted_execute_i_++){ \
52 ::cf3::common::PE::Comm::instance().barrier(); \
53 if(_process_sorted_execute_i_ == _process_sorted_execute_r_){ \
55 std::cout << std::flush; \
56 ::cf3::common::PE::Comm::instance().barrier(); \
59 ::cf3::common::PE::Comm::instance().barrier(); \
60 std::cout << std::flush; \
61 ::cf3::common::PE::Comm::instance().barrier(); \
62 } else if (irank==(int)(::cf3::common::PE::Comm::instance().rank())){ \
75 #define PECheckPoint(msec,msg) { \
76 ::cf3::common::PE::Comm::instance().barrier(); \
77 std::cout << std::flush; \
78 boost::this_thread::sleep(boost::posix_time::milliseconds(msec)); \
79 ::cf3::common::PE::Comm::instance().barrier(); \
80 PEProcessSortedExecute(-1, \
81 std::cout << std::flush; \
82 std::cout << "["<<::cf3::common::PE::Comm::instance().rank() << ":" << __FILE__ << ":" << __LINE__ << "] " << msg << "\n"; \
83 std::cout << std::flush; \
85 ::cf3::common::PE::Comm::instance().barrier(); \
86 std::cout << std::flush; \
87 boost::this_thread::sleep(boost::posix_time::milliseconds(msec)); \
88 ::cf3::common::PE::Comm::instance().barrier(); \
93 #define PECheckArrivePoint(msec,msg) { \
94 std::cout << std::flush; \
95 std::cout << "["<<::cf3::common::PE::Comm::instance().rank() << "] " << msg << "\n"; \
96 std::cout << std::flush; \
97 ::cf3::common::PE::Comm::instance().barrier(); \
98 boost::this_thread::sleep(boost::posix_time::milliseconds(msec)); \
107 #define PEDebugVector(v,length) { \
108 std::cout << ::cf3::common::PE::Comm::instance().rank() << "/" << ::cf3::common::PE::Comm::instance().size() << ": " << #v << " " << length << " ( " << std::flush; \
109 for(int _tmp_i_=0; _tmp_i_<length; _tmp_i_++) std::cout << v[_tmp_i_] << " "; \
110 std::cout << " )\n" << std::flush; \
119 #define PEDebugVectorMember(v,length,member) { \
120 std::cout << ::cf3::common::PE::Comm::instance().rank() << "/" << ::cf3::common::PE::Comm::instance().size() << ": " << #v#member << " " << length << " ( " << std::flush; \
121 for(int _tmp_i_=0; _tmp_i_<length; _tmp_i_++) std::cout << v[_tmp_i_]member << " "; \
122 std::cout << " )\n" << std::flush; \
140 #endif // cf3_common_PE_debug_HPP
Top-level namespace for coolfluid.
void wait_for_debugger(const int rank)