Grid[Server] - Maple Programming Help

Home : Support : Online Help : Toolboxes : Grid Computing : Grid/Server/StartServer

Grid[Server]

 StartServer
 start a hpc Server on a machine
 StopServer
 stop a hpc Server on a machine

Parameters

 p - integer, representing the base port. This setting must be consistent across servers and client n - integer, representing the number of servers running on this machine (usually one per CPU) broadcast - string, the broadcast mask bcport - integer, representing the broadcast port. This setting must be consistent across all servers logfile - string, filename of log file

Description

 • The StartServer and StopServer commands are part of a Server sub-module of the Grid package, and only apply when using "hpc" mode (see Setup).  Normally services or daemons are already running on machines in a distributed network, ready to receive Grid commands.  The StartServer command is for testing purposes, and will launch a server on your local machine.  StopServer will only stop the local instance of your server, not all of the processes on remote machines.
 • Launching a server using StartServer starts the server as child process of the Maple process.
 • The StartServer procedure returns an integer representing the process ID of server program or an error if the server could not be started.
 • These commands can be called using either positional arguments, or by specifying keyword, option=value pairs.  When using positional arguments order matters.
 • The port parameter defaults to 2000. If this port is already taken at your site, you must choose a different one. You must use the same setting on all servers and clients.
 • The numnodes parameter represents the number of individual servers to start on this machine. Usually you will start one per available CPU. Each server will show up as an individual node (and will be counted as a node for licensing purposes) in your grid.  The default is 4.
 • The mask parameter is a string representing the broadcast mask used for auto-discovery, i.e. in order for all the nodes in the grid to learn about the presence of each other. The default, "255.255.255.255" will broadcast to every reachable machine on your network. A different setting is likely to be more appropriate for your site. For example if your nodes are located at IP addresses on the 10.10.a.b network then you need to use a mask 10.10.255.255 to be able to broadcast to all machines on the 10.10.a.b subnet.
 • The broadcastport parameter is an integer representing the UDP port used for broadcasting. Setting this parameter to zero will disable auto-discovery. The default for this parameter is 4400. All servers must use the same broadcast port in order to discover each other when they startup.
 • The log parameter is a string representing the filename of the log file. The server will output informational messages to this log file. Multiple CPUs on one server will share the same log file but you cannot call StartServer on multiple machines pointing to the same log file on a shared drive. A relative path specified for the log file, e.g. logs/grid.log, will be taken relative to the location of the Grid Computing Toolbox installation directory. The default log is set to "grid.log".
 • On Windows, the easiest way to start and stop a server on a machine is to find the file named "gridserver.bat" in the bin directory of the Grid Computing Toolbox installation. Execute this batch file to start an independent process for running the server.  If you have the Grid toolbox installed, see the full description given in the Batch section of the toolbox documentation.
 • On Linux, the easiest way to start and stop a server on a machine is to find the file named "gridserver.sh" in the bin directory of the Grid Computing Toolbox installation. Execute this script to start an independent process for running the server. If you have the Grid toolbox installed, see the full description given in the Batch section of the toolbox documentation.

Examples

 > $\mathrm{with}\left(\mathrm{Grid}\right)$
 > $\mathrm{with}\left(\mathrm{Server}\right)$
 > $\mathrm{StartServer}\left(\mathrm{port}=2000,\mathrm{numnodes}=4\right)$
 > $\mathrm{Setup}\left("hpc",\mathrm{host}="localhost",\mathrm{port}=2000\right)$
 > $\mathrm{Launch}\left("print\left(hi\right);",\mathrm{numnodes}=4\right)$
 > $\mathrm{StopServer}\left(\mathrm{port}=2000,\mathrm{numnodes}=4\right)$

Compatibility

 • The Grid[Server][StartServer] and Grid[Server][StopServer] commands were introduced in Maple 15.