本文整理汇总了C++中TcpConnection::markPreExisting方法的典型用法代码示例。如果您正苦于以下问题:C++ TcpConnection::markPreExisting方法的具体用法?C++ TcpConnection::markPreExisting怎么用?C++ TcpConnection::markPreExisting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TcpConnection
的用法示例。
在下文中一共展示了TcpConnection::markPreExisting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scanForPreExisting
void SocketConnList::scanForPreExisting()
{
// FIXME: Detect stdin/out/err fds to detect duplicates.
vector<int> fds = jalib::Filesystem::ListOpenFds();
for (size_t i = 0; i < fds.size(); ++i) {
int fd = fds[i];
if (!Util::isValidFd(fd)) continue;
if (dmtcp_is_protected_fd(fd)) continue;
string device = jalib::Filesystem::GetDeviceName(fd);
JTRACE("scanning pre-existing device") (fd) (device);
if (device == jalib::Filesystem::GetControllingTerm()) {
} else if(dmtcp_is_bq_file && dmtcp_is_bq_file(device.c_str())) {
} else if( fd <= 2 ){
} else if (Util::strStartsWith(device, "/")) {
} else {
JNOTE("found pre-existing socket... will not be restored")
(fd) (device);
TcpConnection* con = new TcpConnection(0, 0, 0);
con->markPreExisting();
add(fd, con);
}
}
}
示例2: JTRACE
void
SocketConnList::scanForPreExisting()
{
// TODO: This is a hack when SLURM + MPI are used:
// when we use command
// srun/ibrun dmtcp_launch a.out
// inside the SLURM submission script, the MPI launching
// process will not run under the control of DMTCP. Instead,
// only the computing processes are. The launching process
// will create some sockets, and then create the computing
// processes. Hence the sockets are shared among the created
// processes at the time when dmtcp_launch is launched. DMTCP
// will treat these sockets as pre-existing sockets instead of
// shared sockets.
//
// In the future, we should generalize the processing of
// pre-existing fds. For example, at checkpoint time, determine
// which sockets are shared, regardless of whether they are
// pre-existing or not. This can be done by adding an extra round
// of leader election.
if (getenv("SLURM_JOBID") || (getenv("SLURM_JOB_ID"))) {
return;
}
// FIXME: Detect stdin/out/err fds to detect duplicates.
vector<int>fds = jalib::Filesystem::ListOpenFds();
for (size_t i = 0; i < fds.size(); ++i) {
int fd = fds[i];
if (!Util::isValidFd(fd)) {
continue;
}
if (dmtcp_is_protected_fd(fd)) {
continue;
}
string device = jalib::Filesystem::GetDeviceName(fd);
JTRACE("scanning pre-existing device") (fd) (device);
if (device ==
jalib::Filesystem::GetControllingTerm()) {} else if (dmtcp_is_bq_file &&
dmtcp_is_bq_file(
device.c_str()))
{} else if (fd <=
2)
{} else if (Util::strStartsWith(device.c_str(), "/")) {} else {
JNOTE("found pre-existing socket... will not be restored")
(fd) (device);
TcpConnection *con = new TcpConnection(0, 0, 0);
con->markPreExisting();
add(fd, con);
}
}
}