The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiMP.Parallel.SshSession Class Reference

Public Member Functions

 __init__ (self, hostname)
 __del__ (self)

Public Attributes

 host = hostname
 session = pyssh.Ssh(host=hostname)

Detailed Description

Definition at line 221 of file Parallel.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiMP.Parallel.SshSession.__init__ ( self,
hostname )

Definition at line 222 of file Parallel.py.

222 def __init__(self, hostname):
223 import pp
224 import pyssh
225
226 self.host = hostname
227 ppprefix = os.path.dirname(os.path.dirname(pp.__file__))
228 self.session = pyssh.Ssh(host=hostname)
229 self.session.open()
230 self.session.read_lazy()
231 self.session.write(f"cd {os.getcwd()}\n")
232 self.session.read_lazy()
233 self.session.write("setenv PYTHONPATH {}\n".format(os.environ["PYTHONPATH"]))
234 self.session.read_lazy()
235 self.session.write(
236 "setenv LD_LIBRARY_PATH {}\n".format(os.environ["LD_LIBRARY_PATH"])
237 )
238 self.session.read_lazy()
239 self.session.write("setenv ROOTSYS {}\n".format(os.environ["ROOTSYS"]))
240 self.session.read_lazy()
241 self.session.write(
242 f"{sys.executable} {ppprefix}/scripts-{sys.version.split()[0]}/ppserver.py \n"
243 )
244 self.session.read_lazy()
245 self.session.read_lazy()
246 print("started ppserver in ", hostname)
247
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition MsgStream.cpp:93

◆ __del__()

GaudiMP.Parallel.SshSession.__del__ ( self)

Definition at line 248 of file Parallel.py.

248 def __del__(self):
249 self.session.close()
250 print("killed ppserver in ", self.host)

Member Data Documentation

◆ host

GaudiMP.Parallel.SshSession.host = hostname

Definition at line 226 of file Parallel.py.

◆ session

GaudiMP.Parallel.SshSession.session = pyssh.Ssh(host=hostname)

Definition at line 228 of file Parallel.py.


The documentation for this class was generated from the following file: