COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
debug.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 
8 #ifndef cf3_common_PE_debug_HPP
9 #define cf3_common_PE_debug_HPP
10 
12 
13 #include <iostream>
14 #include <boost/thread/thread.hpp>
15 
16 #include "common/PE/debug.hpp"
17 #include "common/PE/Comm.hpp"
18 
19 namespace cf3 {
20 namespace common {
21 namespace PE {
22 
23 void wait_for_debugger(const int rank)
24 {
25  const Uint irank = Comm::instance().rank();
26  if(rank >= 0 && rank != irank)
27  return;
28 
29  int stopped = 1;
30  int i = 0;
31  std::cout << "Rank " << irank << " with PID " << getpid() << " is waiting for debugger attach" << std::endl;
32  while (0 != stopped && i++ < 80)
33  boost::this_thread::sleep(boost::posix_time::milliseconds(250));
34 }
35 
36 
37 } // PE
38 } // common
39 } // cf3
40 
42 
43 #endif // cf3_common_PE_debug_HPP
Uint rank() const
Return rank, additionally, if is_init==0.
Definition: Comm.cpp:135
Top-level namespace for coolfluid.
Definition: Action.cpp:18
void wait_for_debugger(const int rank)
Definition: debug.cpp:23
unsigned int Uint
typedef for unsigned int
Definition: CF.hpp:90
static Comm & instance()
Return a reference to the current PE.
Definition: Comm.cpp:44
Send comments to:
COOLFluiD Web Admin