---
name: "mpdlib"
section: "1"
platform: "linux"
package: "mpich2"
version: "1.2.1.1-5"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/mpdlib"
---

# mpdlib(1)

## NAME

**mpdlib**

## FILE

**/Users/goodell/svn/mpich2-1.2.1p1-tmp/src/pm/mpd/mpdlib.py**

## DESCRIPTION

- **#**

  **(C) 2001 by Argonne National Laboratory.**

- **#**

  **See COPYRIGHT in top-level directory.** **#**

## CLASSES

**\_\_builtin\_\_.dict(\_\_builtin\_\_.object)** **MPDParmDB** **\_\_builtin\_\_.object** **MPDRing** **MPDSock** **MPDConClientSock** **MPDListenSock** **MPDConListenSock** **MPDStreamHandler** **MPDTest**

**class MPDConClientSock(MPDSock)**

- **\|**

  **Method resolution order:**

- **\|**

  **MPDConClientSock**

- **\|**

  **MPDSock**

- **\|**

  **\_\_builtin\_\_.object**

- **\|**

  - **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self, name='console\_to\_mpd', mpdroot='', secretword='', \*\*kargs)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Methods inherited from MPDSock:**

- **\|**

  - **\|**

  **accept(self, name='accepter')**

- **\|**

  - **\|**

  **close(self)**

- **\|**

  - **\|**

  **connect(self, \*args)**

- **\|**

  - **\|**

  **fileno(self)**

- **\|**

  - **\|**

  **getsockname(self)**

- **\|**

  - **\|**

  **recv(self, nbytes)**

- **\|**

  - **\|**

  **recv\_char\_msg(self)**

- **\|**

  - **\|**

  **recv\_dict\_msg(self, timeout=None)**

- **\|**

  - **\|**

  **recv\_one\_line(self)**

- **\|**

  - **\|**

  **send\_char\_msg(self, msg, errprint=1)**

- **\|**

  - **\|**

  **send\_dict\_msg(self, msg, errprint=1)**

- **\|**

  **# The default behavior on an error needs to be to handle and/or report**

- **\|**

  **# it.  Otherwise, we all waste time trying to figure out why**

- **\|**

  **# the code is silently failing.  I've set the default for errprint**

- **\|**

  **# to YES rather than NO.**

- **\|**

  - **\|**

  **sendall(self, data)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors inherited from MPDSock:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

**class MPDConListenSock(MPDListenSock)**

- **\|**

  **Method resolution order:**

- **\|**

  **MPDConListenSock**

- **\|**

  **MPDListenSock**

- **\|**

  **MPDSock**

- **\|**

  **\_\_builtin\_\_.object**

- **\|**

  - **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self, name='console\_listen', secretword='', \*\*kargs)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Methods inherited from MPDSock:**

- **\|**

  - **\|**

  **accept(self, name='accepter')**

- **\|**

  - **\|**

  **close(self)**

- **\|**

  - **\|**

  **connect(self, \*args)**

- **\|**

  - **\|**

  **fileno(self)**

- **\|**

  - **\|**

  **getsockname(self)**

- **\|**

  - **\|**

  **recv(self, nbytes)**

- **\|**

  - **\|**

  **recv\_char\_msg(self)**

- **\|**

  - **\|**

  **recv\_dict\_msg(self, timeout=None)**

- **\|**

  - **\|**

  **recv\_one\_line(self)**

- **\|**

  - **\|**

  **send\_char\_msg(self, msg, errprint=1)**

- **\|**

  - **\|**

  **send\_dict\_msg(self, msg, errprint=1)**

- **\|**

  **# The default behavior on an error needs to be to handle and/or report**

- **\|**

  **# it.  Otherwise, we all waste time trying to figure out why**

- **\|**

  **# the code is silently failing.  I've set the default for errprint**

- **\|**

  **# to YES rather than NO.**

- **\|**

  - **\|**

  **sendall(self, data)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors inherited from MPDSock:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

**class MPDListenSock(MPDSock)**

- **\|**

  **Method resolution order:**

- **\|**

  **MPDListenSock**

- **\|**

  **MPDSock**

- **\|**

  **\_\_builtin\_\_.object**

- **\|**

  - **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self, host='', port=0, filename='', listen=5, name='listener', \*\*kargs)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Methods inherited from MPDSock:**

- **\|**

  - **\|**

  **accept(self, name='accepter')**

- **\|**

  - **\|**

  **close(self)**

- **\|**

  - **\|**

  **connect(self, \*args)**

- **\|**

  - **\|**

  **fileno(self)**

- **\|**

  - **\|**

  **getsockname(self)**

- **\|**

  - **\|**

  **recv(self, nbytes)**

- **\|**

  - **\|**

  **recv\_char\_msg(self)**

- **\|**

  - **\|**

  **recv\_dict\_msg(self, timeout=None)**

- **\|**

  - **\|**

  **recv\_one\_line(self)**

- **\|**

  - **\|**

  **send\_char\_msg(self, msg, errprint=1)**

- **\|**

  - **\|**

  **send\_dict\_msg(self, msg, errprint=1)**

- **\|**

  **# The default behavior on an error needs to be to handle and/or report**

- **\|**

  **# it.  Otherwise, we all waste time trying to figure out why**

- **\|**

  **# the code is silently failing.  I've set the default for errprint**

- **\|**

  **# to YES rather than NO.**

- **\|**

  - **\|**

  **sendall(self, data)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors inherited from MPDSock:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

**class MPDParmDB(\_\_builtin\_\_.dict)**

- **\|**

  **Method resolution order:**

- **\|**

  **MPDParmDB**

- **\|**

  **\_\_builtin\_\_.dict**

- **\|**

  **\_\_builtin\_\_.object**

- **\|**

  - **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_getitem\_\_(self, key)**

- **\|**

  - **\|**

  **\_\_init\_\_(self, orderedSources=\[\])**

- **\|**

  - **\|**

  **\_\_setitem\_\_(self, sk\_tup, val)**

- **\|**

  - **\|**

  **get\_parms\_from\_env(self, parmsToOverride)**

- **\|**

  - **\|**

  **get\_parms\_from\_rcfile(self, parmsToOverride, errIfMissingFile=0)**

- **\|**

  - **\|**

  **has\_key(self, key)**

- **\|**

  - **\|**

  **printall(self)**

- **\|**

  - **\|**

  **printdef(self)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors defined here:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Methods inherited from \_\_builtin\_\_.dict:**

- **\|**

  - **\|**

  **\_\_cmp\_\_(...)**

- **\|**

  **x.\_\_cmp\_\_(y) \<==\> cmp(x,y)**

- **\|**

  - **\|**

  **\_\_contains\_\_(...)**

- **\|**

  **D.\_\_contains\_\_(k) -\> True if D has a key k, else False**

- **\|**

  - **\|**

  **\_\_delitem\_\_(...)**

- **\|**

  **x.\_\_delitem\_\_(y) \<==\> del x\[y\]**

- **\|**

  - **\|**

  **\_\_eq\_\_(...)**

- **\|**

  **x.\_\_eq\_\_(y) \<==\> x==y**

- **\|**

  - **\|**

  **\_\_ge\_\_(...)**

- **\|**

  **x.\_\_ge\_\_(y) \<==\> x\>=y**

- **\|**

  - **\|**

  **\_\_getattribute\_\_(...)**

- **\|**

  **x.\_\_getattribute\_\_('name') \<==\> x.name**

- **\|**

  - **\|**

  **\_\_gt\_\_(...)**

- **\|**

  **x.\_\_gt\_\_(y) \<==\> x\>y**

- **\|**

  - **\|**

  **\_\_hash\_\_(...)**

- **\|**

  **x.\_\_hash\_\_() \<==\> hash(x)**

- **\|**

  - **\|**

  **\_\_iter\_\_(...)**

- **\|**

  **x.\_\_iter\_\_() \<==\> iter(x)**

- **\|**

  - **\|**

  **\_\_le\_\_(...)**

- **\|**

  **x.\_\_le\_\_(y) \<==\> x\<=y**

- **\|**

  - **\|**

  **\_\_len\_\_(...)**

- **\|**

  **x.\_\_len\_\_() \<==\> len(x)**

- **\|**

  - **\|**

  **\_\_lt\_\_(...)**

- **\|**

  **x.\_\_lt\_\_(y) \<==\> x\<y**

- **\|**

  - **\|**

  **\_\_ne\_\_(...)**

- **\|**

  **x.\_\_ne\_\_(y) \<==\> x!=y**

- **\|**

  - **\|**

  **\_\_repr\_\_(...)**

- **\|**

  **x.\_\_repr\_\_() \<==\> repr(x)**

- **\|**

  - **\|**

  **clear(...)**

- **\|**

  **D.clear() -\> None.  Remove all items from D.**

- **\|**

  - **\|**

  **copy(...)**

- **\|**

  **D.copy() -\> a shallow copy of D**

- **\|**

  - **\|**

  **get(...)**

- **\|**

  **D.get(k\[,d\]) -\> D\[k\] if k in D, else d.  d defaults to None.**

- **\|**

  - **\|**

  **items(...)**

- **\|**

  **D.items() -\> list of D's (key, value) pairs, as 2-tuples**

- **\|**

  - **\|**

  **iteritems(...)**

- **\|**

  **D.iteritems() -\> an iterator over the (key, value) items of D**

- **\|**

  - **\|**

  **iterkeys(...)**

- **\|**

  **D.iterkeys() -\> an iterator over the keys of D**

- **\|**

  - **\|**

  **itervalues(...)**

- **\|**

  **D.itervalues() -\> an iterator over the values of D**

- **\|**

  - **\|**

  **keys(...)**

- **\|**

  **D.keys() -\> list of D's keys**

- **\|**

  - **\|**

  **pop(...)**

- **\|**

  **D.pop(k\[,d\]) -\> v, remove specified key and return the corresponding value**

- **\|**

  **If key is not found, d is returned if given, otherwise KeyError is raised**

- **\|**

  - **\|**

  **popitem(...)**

- **\|**

  **D.popitem() -\> (k, v), remove and return some (key, value) pair as a**

- **\|**

  **2-tuple; but raise KeyError if D is empty**

- **\|**

  - **\|**

  **setdefault(...)**

- **\|**

  **D.setdefault(k\[,d\]) -\> D.get(k,d), also set D\[k\]=d if k not in D**

- **\|**

  - **\|**

  **update(...)**

- **\|**

  **D.update(E, \*\*F) -\> None.  Update D from E and F: for k in E: D\[k\] = E\[k\]**

- **\|**

  **(if E has keys else: for (k, v) in E: D\[k\] = v) then: for k in F: D\[k\] = F\[k\]**

- **\|**

  - **\|**

  **values(...)**

- **\|**

  **D.values() -\> list of D's values**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data and other attributes inherited from \_\_builtin\_\_.dict:**

- **\|**

  - **\|**

  **\_\_new\_\_ = \<built-in method \_\_new\_\_ of type object at 0x1eeec0\>**

- **\|**

  **T.\_\_new\_\_(S, ...) -\> a new object with type S, a subtype of T**

- **\|**

  - **\|**

  **fromkeys = \<built-in method fromkeys of type object at 0x339390\>**

- **\|**

  **dict.fromkeys(S\[,v\]) -\> New dict with keys from S and values equal to v.**

- **\|**

  **v defaults to None.**

**class MPDRing(\_\_builtin\_\_.object)**

- **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self, listenSock=None, streamHandler=None, secretword='', myIfhn='', entryIfhn='', entryPort=0, zcMyLevel=0)**

- **\|**

  - **\|**

  **accept\_lhs(self, lhsHandler=None)**

- **\|**

  - **\|**

  **accept\_rhs(self, rhsHandler=None)**

- **\|**

  - **\|**

  **connect\_lhs(self, lhsIfhn='', lhsPort=0, lhsHandler=None, numTries=1)**

- **\|**

  - **\|**

  **connect\_rhs(self, rhsIfhn='', rhsPort=0, rhsHandler=None, numTries=1)**

- **\|**

  - **\|**

  **create\_single\_mem\_ring(self, ifhn='', port=0, lhsHandler=None, rhsHandler=None)**

- **\|**

  - **\|**

  **enter\_ring(self, entryIfhn='', entryPort=0, lhsHandler='', rhsHandler='', ntries=1)**

- **\|**

  - **\|**

  **handle\_lhs\_challenge\_response(self, sock)**

- **\|**

  - **\|**

  **handle\_rhs\_challenge\_response(self, sock)**

- **\|**

  - **\|**

  **handle\_ring\_listener\_connection(self, sock)**

- **\|**

  - **\|**

  **reenter\_ring(self, entryIfhn='', entryPort=0, lhsHandler='', rhsHandler='', ntries=5)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors defined here:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

**class MPDSock(\_\_builtin\_\_.object)**

- **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self, family=2, socktype=1, proto=0, sock=None, name='')**

- **\|**

  - **\|**

  **accept(self, name='accepter')**

- **\|**

  - **\|**

  **close(self)**

- **\|**

  - **\|**

  **connect(self, \*args)**

- **\|**

  - **\|**

  **fileno(self)**

- **\|**

  - **\|**

  **getsockname(self)**

- **\|**

  - **\|**

  **recv(self, nbytes)**

- **\|**

  - **\|**

  **recv\_char\_msg(self)**

- **\|**

  - **\|**

  **recv\_dict\_msg(self, timeout=None)**

- **\|**

  - **\|**

  **recv\_one\_line(self)**

- **\|**

  - **\|**

  **send\_char\_msg(self, msg, errprint=1)**

- **\|**

  - **\|**

  **send\_dict\_msg(self, msg, errprint=1)**

- **\|**

  **# The default behavior on an error needs to be to handle and/or report**

- **\|**

  **# it.  Otherwise, we all waste time trying to figure out why**

- **\|**

  **# the code is silently failing.  I've set the default for errprint**

- **\|**

  **# to YES rather than NO.**

- **\|**

  - **\|**

  **sendall(self, data)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors defined here:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

**class MPDStreamHandler(\_\_builtin\_\_.object)**

- **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self)**

- **\|**

  - **\|**

  **close\_all\_active\_streams(self)**

- **\|**

  - **\|**

  **del\_handler(self, stream)**

- **\|**

  - **\|**

  **handle\_active\_streams(self, streams=None, timeout=0.10000000000000001)**

- **\|**

  - **\|**

  **set\_handler(self, stream, handler, args=())**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors defined here:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

**class MPDTest(\_\_builtin\_\_.object)**

- **\|**

  **Methods defined here:**

- **\|**

  - **\|**

  **\_\_init\_\_(self)**

- **\|**

  - **\|**

  **run(self, cmd='', expIn='', chkEC=0, expEC=0, chkOut=0, expOut='', ordOut=0, grepOut=0, exitOnFail=1)**

- **\|**

  - **\|**

  **----------------------------------------------------------------------**

- **\|**

  **Data descriptors defined here:**

- **\|**

  - **\|**

  **\_\_dict\_\_**

- **\|**

  **dictionary for instance variables (if defined)**

- **\|**

  - **\|**

  **\_\_weakref\_\_**

- **\|**

  **list of weak references to the object (if defined)**

## FUNCTIONS

**dumps(...)** **dumps(obj, protocol=0) -- Return a string containing an object in pickle format.**

**See the Pickler docstring for the meaning of optional argument proto.**

**loads(...)** **loads(string) -- Load a pickle from the given string**

**md5new = openssl\_md5(...)** **Returns a md5 hash object; optionally initialized with a string**

**mpd\_check\_python\_version()**

**mpd\_close\_zc()**

**mpd\_find\_zc\_peer(peer\_level)**

**mpd\_get\_groups\_for\_username(username)**

**mpd\_get\_my\_id()**

**mpd\_get\_my\_username()**

**mpd\_get\_ranks\_in\_binary\_tree(myRank, nprocs)**

**mpd\_handle\_signal(signum, frame)**

**mpd\_init\_zc(ifhn, my\_level)** **#### experimental code for zeroconf**

**mpd\_print(\*args)**

**mpd\_print\_tb(\*args)**

**mpd\_read\_nbytes(fd, nbytes)**

**mpd\_register\_zc(ifhn, level)**

**mpd\_same\_ips(host1, host2)**

**mpd\_set\_cli\_app(app)**

**mpd\_set\_dbg\_level(flag)**

**mpd\_set\_my\_id(myid='')**

**mpd\_set\_procedures\_to\_trace(procs)**

**mpd\_set\_tmpdir(tmpdir)**

**mpd\_sockpair()**

**mpd\_trace\_calls(frame, event, args)**

**mpd\_trace\_returns(frame, event, args)**

**mpd\_uncaught\_except\_tb(arg1, arg2, arg3)**

**mpd\_version()**

**mpd\_which(execName, user\_path=None)**

**random(...)** **random() -\> x in the interval \[0, 1).**

**sleep(...)** **sleep(seconds)**

- **Delay execution for a given number of seconds.**

  **The argument may be** **a floating point number for subsecond precision.**

## DATA

**ECONNREFUSED = 61** **ECONNRESET = 54** **EINTR = 4** **EISCONN = 56** **EPIPE = 32** **grp\_module\_available = 1** **mpd\_cli\_app = ''** **mpd\_dbg\_level = 0** **mpd\_my\_hostname = ''** **mpd\_my\_id = ''** **mpd\_procedures\_to\_trace = \[\]** **mpd\_signum = 0** **mpd\_tmpdir = '/tmp'** **mpd\_zc = 0** **pwd\_module\_available = 1** **subprocess\_module\_available = 1** **syslog\_module\_available = 1**
