|
| 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 |
| |
| def | create_symlinks |
| |
| def | extract_fds |
| |
| 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 |
| |
| def | create_symlinks |
| |
| def | extract_fds |
| |
Definition at line 10 of file FdsRegistry.py.
| def GaudiMP.FdsRegistry.FdsDict.__missing__ |
( |
|
self, |
|
|
|
key |
|
) |
| |
| def GaudiMP.FdsRegistry.FdsDict.__missing__ |
( |
|
self, |
|
|
|
key |
|
) |
| |
| def GaudiMP.FdsRegistry.FdsDict.add |
( |
|
self, |
|
|
|
i, |
|
|
|
fname, |
|
|
|
iomode, |
|
|
|
flags |
|
) |
| |
Definition at line 35 of file FdsRegistry.py.
35 def add(self, i, fname, iomode, flags):
36 self[i] = (fname, iomode, flags)
def add(self, i, fname, iomode, flags)
| def GaudiMP.FdsRegistry.FdsDict.add |
( |
|
self, |
|
|
|
i, |
|
|
|
fname, |
|
|
|
iomode, |
|
|
|
flags |
|
) |
| |
Definition at line 35 of file FdsRegistry.py.
35 def add(self, i, fname, iomode, flags):
36 self[i] = (fname, iomode, flags)
def add(self, i, fname, iomode, flags)
| 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 60 of file FdsRegistry.py.
62 create necessary symlinks in worker's dir if the fd is <INPUT>
63 otherwise copy <OUTPUT> file
71 dst = os.path.join(wkdir, os.path.basename(src))
72 if iomode ==
"<INPUT>":
73 if os.path.exists(dst):
75 msg.debug(
"fds_dict.create_symlink:update_io_registry took care of src=%s" % src)
78 msg.debug(
"fds_dict.create_symlink:(symlink) src=%s, iomode=%s" % (src,iomode))
81 msg.debug(
"fds_dict.create_symlink: (copy) src=%s, dst=%s" % (src, dst))
| 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 60 of file FdsRegistry.py.
62 create necessary symlinks in worker's dir if the fd is <INPUT>
63 otherwise copy <OUTPUT> file
71 dst = os.path.join(wkdir, os.path.basename(src))
72 if iomode ==
"<INPUT>":
73 if os.path.exists(dst):
75 msg.debug(
"fds_dict.create_symlink:update_io_registry took care of src=%s" % src)
78 msg.debug(
"fds_dict.create_symlink:(symlink) src=%s, iomode=%s" % (src,iomode))
81 msg.debug(
"fds_dict.create_symlink: (copy) src=%s, dst=%s" % (src, dst))
| def GaudiMP.FdsRegistry.FdsDict.extract_fds |
( |
|
self, |
|
|
|
dir = "" |
|
) |
| |
parse the fds of the processs -> build fds_dict
Definition at line 86 of file FdsRegistry.py.
87 """parse the fds of the processs -> build fds_dict
90 msg.info(
"extract_fds: making snapshot of parent process file descriptors")
91 self.
curdir = os.path.abspath(os.curdir)
94 procfd =
'/proc/self/fd'
95 fds = os.listdir(procfd)
106 realname = os.path.realpath(os.path.join(procfd,i))
107 except (OSError, IOError, TypeError):
110 msg.debug(
"failed to resolve: %s ... skipping", os.path.join(procfd,i) )
113 if os.path.exists(realname):
115 flags = fcntl.fcntl(fd, fcntl.F_GETFL)
116 if (flags & _O_ACCMODE) == 0:
121 self.
add(fd, realname, iomode, flags)
122 except (OSError, IOError):
125 msg.debug(
"failed access to: %s ... skipping", realname )
133 msg.debug(
"extract_fds.fds_dict=%s" % self)
def add(self, i, fname, iomode, flags)
| def GaudiMP.FdsRegistry.FdsDict.extract_fds |
( |
|
self, |
|
|
|
dir = "" |
|
) |
| |
parse the fds of the processs -> build fds_dict
Definition at line 86 of file FdsRegistry.py.
87 """parse the fds of the processs -> build fds_dict
90 msg.info(
"extract_fds: making snapshot of parent process file descriptors")
91 self.
curdir = os.path.abspath(os.curdir)
94 procfd =
'/proc/self/fd'
95 fds = os.listdir(procfd)
106 realname = os.path.realpath(os.path.join(procfd,i))
107 except (OSError, IOError, TypeError):
110 msg.debug(
"failed to resolve: %s ... skipping", os.path.join(procfd,i) )
113 if os.path.exists(realname):
115 flags = fcntl.fcntl(fd, fcntl.F_GETFL)
116 if (flags & _O_ACCMODE) == 0:
121 self.
add(fd, realname, iomode, flags)
122 except (OSError, IOError):
125 msg.debug(
"failed access to: %s ... skipping", realname )
133 msg.debug(
"extract_fds.fds_dict=%s" % self)
def add(self, i, fname, iomode, flags)
| def GaudiMP.FdsRegistry.FdsDict.fds |
( |
|
self, |
|
|
|
fname |
|
) |
| |
Definition at line 25 of file FdsRegistry.py.
26 return [i
for i, v
in self.iteritems()
if v[0]==fname]
| def GaudiMP.FdsRegistry.FdsDict.fds |
( |
|
self, |
|
|
|
fname |
|
) |
| |
Definition at line 25 of file FdsRegistry.py.
26 return [i
for i, v
in self.iteritems()
if v[0]==fname]
| def GaudiMP.FdsRegistry.FdsDict.fname |
( |
|
self, |
|
|
|
i |
|
) |
| |
Definition at line 18 of file FdsRegistry.py.
22 msg.warning (
"fds_dict:fname: No Key %s" % i)
| def GaudiMP.FdsRegistry.FdsDict.fname |
( |
|
self, |
|
|
|
i |
|
) |
| |
Definition at line 18 of file FdsRegistry.py.
22 msg.warning (
"fds_dict:fname: No Key %s" % i)
| def GaudiMP.FdsRegistry.FdsDict.get_fds_in_dir |
( |
|
self, |
|
|
|
dir = "" |
|
) |
| |
Definition at line 52 of file FdsRegistry.py.
54 if dir ==
"" and self.
curdir is not None:
56 msg.debug(
"get_fds_in_dir(%s)" % dir)
57 return [i
for i
in self.keys()
58 if os.path.samefile(os.path.dirname(self[i][0]), dir) ]
| def GaudiMP.FdsRegistry.FdsDict.get_fds_in_dir |
( |
|
self, |
|
|
|
dir = "" |
|
) |
| |
Definition at line 52 of file FdsRegistry.py.
54 if dir ==
"" and self.
curdir is not None:
56 msg.debug(
"get_fds_in_dir(%s)" % dir)
57 return [i
for i
in self.keys()
58 if os.path.samefile(os.path.dirname(self[i][0]), dir) ]
| def GaudiMP.FdsRegistry.FdsDict.get_input_fds |
( |
|
self | ) |
|
Definition at line 49 of file FdsRegistry.py.
50 return [i
for i
in self.keys()
if self[i][1]==
'<INPUT>']
| def GaudiMP.FdsRegistry.FdsDict.get_input_fds |
( |
|
self | ) |
|
Definition at line 49 of file FdsRegistry.py.
50 return [i
for i
in self.keys()
if self[i][1]==
'<INPUT>']
| def GaudiMP.FdsRegistry.FdsDict.get_output_fds |
( |
|
self | ) |
|
Definition at line 46 of file FdsRegistry.py.
47 return [i
for i
in self.keys()
if self[i][1]==
'<OUTPUT>']
| def GaudiMP.FdsRegistry.FdsDict.get_output_fds |
( |
|
self | ) |
|
Definition at line 46 of file FdsRegistry.py.
47 return [i
for i
in self.keys()
if self[i][1]==
'<OUTPUT>']
| def GaudiMP.FdsRegistry.FdsDict.has_name |
( |
|
self, |
|
|
|
fname |
|
) |
| |
Definition at line 28 of file FdsRegistry.py.
29 for v
in self.values():
def has_name(self, fname)
| def GaudiMP.FdsRegistry.FdsDict.has_name |
( |
|
self, |
|
|
|
fname |
|
) |
| |
Definition at line 28 of file FdsRegistry.py.
29 for v
in self.values():
def has_name(self, fname)
| def GaudiMP.FdsRegistry.FdsDict.iomode |
( |
|
self, |
|
|
|
i |
|
) |
| |
Definition at line 39 of file FdsRegistry.py.
43 msg.warning (
"fds_dict:iomode: No Key %s" % i)
| def GaudiMP.FdsRegistry.FdsDict.iomode |
( |
|
self, |
|
|
|
i |
|
) |
| |
Definition at line 39 of file FdsRegistry.py.
43 msg.warning (
"fds_dict:iomode: No Key %s" % i)
| GaudiMP.FdsRegistry.FdsDict.curdir = None |
|
static |
| string GaudiMP.FdsRegistry.FdsDict.name = "fds_dict" |
|
static |
The documentation for this class was generated from the following file: