40 #include "ac/sys_sysinfo.h"
46 unsigned long lRTPeriod,
47 unsigned long RTStackSize,
54 RTStackSize(RTStackSize),
55 bRTAllowNonRoot(bRTAllowNonRoot),
91 unsigned long& lRTPeriod,
92 unsigned long& RTStackSize,
93 bool& bRTAllowNonRoot,
110 silent_cerr(
"RTSolver: unknown realtime mode "
120 silent_cerr(
"RTSolver: unknown realtime mode; "
129 long long p = HP.
GetInt();
132 silent_cerr(
"RTSolver: illegal time step "
142 silent_cerr(
"RTSolver: need a time step for real time "
165 silent_cerr(
"RTSolver: illegal stack size "
166 << size <<
" at line "
175 bRTAllowNonRoot =
false;
177 bRTAllowNonRoot =
true;
182 #ifndef HAVE_SCHED_SETAFFINITY
183 silent_cerr(
"warning: \"cpu map\" unsupported (ignored)" << std::endl);
184 #endif // ! HAVE_SCHED_SETAFFINITY
189 int newcpumap = (2 << (ncpu - 1)) - 1;
193 if (newcpumap < 1 || newcpumap > 0xFF) {
195 snprintf(buf,
sizeof(buf),
"0x%02X", (
unsigned)cpumap);
196 silent_cerr(
"RTSolver: illegal cpu map " << buf
201 RTCpuMap = newcpumap;
214 pedantic_cerr(
"ReadRTSolver: missing real-time model; "
223 silent_cerr(
"ReadRTSolver: need to configure --with-rtai "
224 "to use RTAI real-time solver "
228 silent_cerr(
"ReadRTSolver: need to configure --with-rtai "
229 "to use default RTAI real-time solver "
RTSolverBase * ReadRTSolver(Solver *pS, MBDynParser &HP)
RTSolverBase * ReadRTPOSIXSolver(Solver *pS, MBDynParser &HP)
#define MBDYN_EXCEPT_ARGS
virtual integer GetInt(integer iDefval=0)
unsigned long RTStackSize
RTSolverBase * ReadRTAISolver(Solver *pS, MBDynParser &HP)
virtual ~RTSolverBase(void)
int mbdyn_reserve_stack(unsigned long size)
virtual bool IsKeyWord(const char *sKeyWord)
virtual bool IsStopCommanded(void)
#define ASSERT(expression)
void ReadRTParams(Solver *pS, MBDynParser &HP, RTSolverBase::RTMode &eRTMode, unsigned long &lRTPeriod, unsigned long &RTStackSize, bool &bRTAllowNonRoot, int &RTCpuMap)
RTSolverBase(Solver *pS, RTMode eRTMode, unsigned long lRTPeriod, unsigned long RTStackSize, bool bRTAllowNonRoot, int RTCpuMap, bool bNoOutput=true)
static doublereal buf[BUFSIZE]
virtual HighParser::ErrOut GetLineData(void) const