Client.pm Show Source

The Client package provides the basic client-side functionality for client/server communication during parallel execution. It is inherited by ReXClient.pm and JobClient.pm.

new(clientid,serverrec)
creates a new Client object for connecting to a server from Server.pm. Required arguments are a unique client ID and a reference to a data structure with the following elements: name -> server host name, port -> server TCP/IP port, and id -> server ID.
ret = initialize(hostid,maxcpus)
registers the client with the server. A host ID and maximum number of CPUs on the given host are required as arguments for client scheduling by the server. The method returns data sent back from the server that may be used for restarting a previous simulation
 
establishConnection()
establishes a persistent socket connection with the server. initialize needs to be called first before this method can be used.
 
$ret = nextJob(data,filelist)
sends data and files to the server and waits for information about the next job to be run by the client. The return value is undefined if no more jobs are available. This method requires that a persistent socket connection with the server is established with establishConnection.
 
terminateServer()
sends the KILLIT command to terminate the server Under normal circumstances the server should terminate on its own and close client connections once all jobs are done. This function is intended to handle client-side exceptions that might leave the server running indefinitely.
 
finish()
closes the persistent socket connection with the server
 
getFile(remotefile[, localfile])
retrieves a file from the server. The file names for the remote and local files are expected as arguments.
 
$ret = getInfo(name)
obtains status information from the server according to the given argument.
GenUtil.pm
Michael Feig, Brooks group, TSRI