|
def | __missing__ (self, key) |
|
def | fname (self, i) |
|
def | fds (self, fname) |
|
def | has_name (self, fname) |
|
def | add (self, i, fname, iomode, flags) |
|
def | iomode (self, i) |
|
def | get_output_fds (self) |
|
def | get_input_fds (self) |
|
def | get_fds_in_dir (self, dir="") |
|
def | create_symlinks (self, wkdir="") |
|
def | extract_fds (self, dir="") |
|
Definition at line 22 of file FdsRegistry.py.
◆ __missing__()
def GaudiMP.FdsRegistry.FdsDict.__missing__ |
( |
|
self, |
|
|
|
key |
|
) |
| |
◆ add()
def GaudiMP.FdsRegistry.FdsDict.add |
( |
|
self, |
|
|
|
i, |
|
|
|
fname, |
|
|
|
iomode, |
|
|
|
flags |
|
) |
| |
Definition at line 47 of file FdsRegistry.py.
47 def add(self, i, fname, iomode, flags):
48 self[i] = (fname, iomode, flags)
◆ create_symlinks()
def GaudiMP.FdsRegistry.FdsDict.create_symlinks |
( |
|
self, |
|
|
|
wkdir = "" |
|
) |
| |
create necessary symlinks in worker's dir if the fd is <INPUT>
otherwise copy <OUTPUT> file
Definition at line 74 of file FdsRegistry.py.
74 def create_symlinks(self, wkdir=""):
76 create necessary symlinks in worker's dir if the fd is <INPUT>
77 otherwise copy <OUTPUT> file
82 msg.info(
"create_symlinks: %s" % self.get_fds_in_dir())
84 for fd
in self.get_fds_in_dir():
87 dst = os.path.join(wkdir, os.path.basename(src))
88 if iomode ==
"<INPUT>":
89 if os.path.exists(dst):
92 "fds_dict.create_symlink:update_io_registry took care of src=%s"
98 "fds_dict.create_symlink:(symlink) src=%s, iomode=%s"
103 msg.debug(
"fds_dict.create_symlink: (copy) src=%s, dst=%s" % (src, dst))
104 shutil.copy(src, dst)
◆ extract_fds()
def GaudiMP.FdsRegistry.FdsDict.extract_fds |
( |
|
self, |
|
|
|
dir = "" |
|
) |
| |
parse the fds of the processs -> build fds_dict
Definition at line 108 of file FdsRegistry.py.
108 def extract_fds(self, dir=""):
109 """parse the fds of the processs -> build fds_dict"""
113 msg.info(
"extract_fds: making snapshot of parent process file descriptors")
114 self.curdir = os.path.abspath(os.curdir)
117 procfd =
"/proc/self/fd"
118 fds = os.listdir(procfd)
121 if fd == 1
or fd == 2:
129 realname = os.path.realpath(os.path.join(procfd, i))
130 except (OSError, IOError, TypeError):
133 msg.debug(
"failed to resolve: %s ... skipping", os.path.join(procfd, i))
136 if os.path.exists(realname):
138 flags = fcntl.fcntl(fd, fcntl.F_GETFL)
139 if (flags & _O_ACCMODE) == 0:
144 self.add(fd, realname, iomode, flags)
145 except (OSError, IOError):
148 msg.debug(
"failed access to: %s ... skipping", realname)
156 msg.debug(
"extract_fds.fds_dict=%s" % self)
◆ fds()
def GaudiMP.FdsRegistry.FdsDict.fds |
( |
|
self, |
|
|
|
fname |
|
) |
| |
Definition at line 37 of file FdsRegistry.py.
38 return [i
for i, v
in self.iteritems()
if v[0] == fname]
◆ fname()
def GaudiMP.FdsRegistry.FdsDict.fname |
( |
|
self, |
|
|
|
i |
|
) |
| |
Definition at line 30 of file FdsRegistry.py.
34 msg.warning(
"fds_dict:fname: No Key %s" % i)
◆ get_fds_in_dir()
def GaudiMP.FdsRegistry.FdsDict.get_fds_in_dir |
( |
|
self, |
|
|
|
dir = "" |
|
) |
| |
Definition at line 64 of file FdsRegistry.py.
64 def get_fds_in_dir(self, dir=""):
67 if dir ==
"" and self.curdir
is not None:
69 msg.debug(
"get_fds_in_dir(%s)" % dir)
71 i
for i
in self.keys()
if os.path.samefile(os.path.dirname(self[i][0]), dir)
◆ get_input_fds()
def GaudiMP.FdsRegistry.FdsDict.get_input_fds |
( |
|
self | ) |
|
Definition at line 61 of file FdsRegistry.py.
61 def get_input_fds(self):
62 return [i
for i
in self.keys()
if self[i][1] ==
"<INPUT>"]
◆ get_output_fds()
def GaudiMP.FdsRegistry.FdsDict.get_output_fds |
( |
|
self | ) |
|
Definition at line 58 of file FdsRegistry.py.
58 def get_output_fds(self):
59 return [i
for i
in self.keys()
if self[i][1] ==
"<OUTPUT>"]
◆ has_name()
def GaudiMP.FdsRegistry.FdsDict.has_name |
( |
|
self, |
|
|
|
fname |
|
) |
| |
Definition at line 40 of file FdsRegistry.py.
40 def has_name(self, fname):
41 for v
in self.values():
◆ iomode()
def GaudiMP.FdsRegistry.FdsDict.iomode |
( |
|
self, |
|
|
|
i |
|
) |
| |
Definition at line 51 of file FdsRegistry.py.
55 msg.warning(
"fds_dict:iomode: No Key %s" % i)
◆ curdir
GaudiMP.FdsRegistry.FdsDict.curdir |
|
static |
◆ name
GaudiMP.FdsRegistry.FdsDict.name |
|
static |
The documentation for this class was generated from the following file: