[Next][Prev] [Right] [Left] [Up] [Index] [Root]

Distributed Computation

The term textsl{distributed computation} refers to a computation which is performed on a number of nodes connected by a network. Magma uses the textsl{manager/worker} model for its distributed computations. In this model, one of the nodes performing such a computation, the textsl{manager}, breaks the computation up into small chunks, each of which it sends to one of the other nodes for execution. The later nodes are referred to as textsl{workers}.

Suppose that the manager is a machine called node1 and the worker nodes are node2, node3, ... . The setting-up procedure involves first choosing a port number PORT which is not already used on the network (for example a number in the range 4000 to 6000 is typically free). The input to each worker consists of the following statements:

NUM_THREADS := 32;       // number of threads to run on worker
PORT := 4000;            // chosen port number
SetNthreads(NUM_THREADS);
Worker("node1", PORT);

Alternatively, for each worker, this information can be provided on the Magma command line (with no input file needed):

magma -m node1:4000 -t 32
The worker jobs can be started up both before and after the manager is started. The manager can successively run multiple kinds of distributed jobs and each worker will contribute to each job and then wait for another job until the manager job finally exits. Also, for the currently supported code and lattice enumeration cases, killing and restarting worker nodes should be robust; that is, if a worker job is deliberately killed or accidentally exits then the manager will notice and the worker's task will be reassigned to another worker (and thus completed at some point). Further, a new worker job with the same port can be started to connect to the same manager job and undertake new work on the same job.

The input for the manager job only needs to set the port number when commencing work:

SetWorkerPort(PORT);

where PORT is the same port number chosen for the worker jobs. After this, for the code and lattice enumeration algorithms, the input to the master job is simply what one would do for a normal enumeration job (see sections Integral Lattices and Linear Codes below for details).


Example Par_SetWorkerPort (H5E1)

For determining the minimum weight of a linear code C, a typical manager input might be:

PORT := 4000;           // or other free port number (matching worker)
SetWorkerPort(PORT);
SetVerbose("Code", 1);  // for verbose information
time MinimumWeight(C);

The distributed computation can be augmented with the use of threads in the manager process, simply by using intrinsic{SetNthreads} prior to the start of the computation. For instance, for determining the theta series of a lattice L, a typical manager input might be:

NUM_THREADS := 32;      // number of threads to run on manager
PORT := 4000;           // or other free port number (matching worker)
SetNthreads(NUM_THREADS);
SetWorkerPort(PORT);
SetVerbose("Enum", 1);   // for verbose information
time ThetaSeries(L, bound);

 [Next][Prev] [Right] [Left] [Up] [Index] [Root]

Version: V2.26 of Tue May 18 12:02:10 AEST 2021