Grid[Server]
StartServer
start a hpc Server on a machine
StopServer
stop a hpc Server on a machine
Calling Sequence
Parameters
Description
Examples
Compatibility
Grid[Server][StartServer](p,n,broadcast,bcport,logfile)
Grid[Server][StartServer](port=p, numnodes=n, mask=broadcast, broadcastport=bcport, log=logfile)
Grid[Server][StopServer](p,n)
Grid[Server][StopServer](port=p, numnodes=n)
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
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.
with⁡Grid
with⁡Server
StartServer⁡port=2000,numnodes=4
Setup⁡hpc,host=localhost,port=2000
Launch⁡print(hi);,numnodes=4
StopServer⁡port=2000,numnodes=4
The Grid[Server][StartServer] and Grid[Server][StopServer] commands were introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
See Also
Grid
Grid[Setup]
Download Help Document