Package schrodinger :: Package job :: Module jserver_client
[hide private]
[frames] | no frames]

Module jserver_client

Functions [hide private]
 
die(message='')
Print the error message and exit with a non-zero exit code.
 
get_jobdb()
Determine the jobdb pathname to use.
 
read_pidfile(filename)
Read a jserver pidfile and return the data it contains.
 
send_message(host, port, message)
Open a socket connection to the given port on host, and send the given message.
 
parse_reply(message, response)
Parse the response to a standard single-line message.
Variables [hide private]
  __package__ = 'schrodinger.job'
Function Details [hide private]

get_jobdb()

 

Determine the jobdb pathname to use.

If not explicitly specified using SCHRODINGER_JOBDB2, try to use the current directory. If it's not a jobdb, fall back to the Linux default location.

read_pidfile(filename)

 

Read a jserver pidfile and return the data it contains.

The return value is a tuple, (pid, port, stamp, refresh), containing the pid and port for the server process, plus the time the pidfile was written (sec), and the frequency with which it should be refreshed (sec).

send_message(host, port, message)

 

Open a socket connection to the given port on host, and send the given message.

The parsed response to the message is returned, as the tuple (success, reply_val, reply_text). Here, reply_val is the value (if any) returned on the first line of the response. Any following lines are returned as the reply_text.

parse_reply(message, response)

 

Parse the response to a standard single-line message.

Return the tuple (success, reply_val, reply_text). Here, reply_val is the value (if any) returned on the first line of the response. Any following lines are returned as the reply_text.