Overview
Warnings
  • Concerto is currently still under development, so the interface may change in future and the current performance may sometimes be poor or absent.

You have already run BRAHMS in Solo mode, which takes advantage of multiple cores or processors available within a single shared-memory space. To deploy on multi-processing hardware, use Concerto mode. Concerto will use some communications layer (e.g. TCP/IP) to deploy your system across the distributed hardware.

Step 1 - The Babble

A BRAHMS system can be executed all in one process (Solo), or broken up and distributed across multiple processes (voices) that exchange data. To start with, all these voices can be run in the same environment. This will gain nothing in terms of performance (in fact, since Concerto comms is slower than Solo comms, this will tend to degrade performance) but is a useful test; it is referred to as a Babble.

Procedure

  • Set the number of voices to more than one.
  • Call brahms to execute the system.

Example

Script

This example, along with the others in this section, can be found in the script developing_systems.m in the support/tutorial/system/matlab folder.

M Source Code (against 995)
% section header disp([10 '=== Using Concerto (1) ===' 10]) % instruct BRAHMS to use three voices, all local exe.addresses = {'sockets' 3}; % view the execution exe % execute the system out = brahms(psys, exe); % view the system outputs out

Expected Output

Note that, on Windows, you may see additional messages when using Concerto.

Matlab Console
=== Using Concerto (1) === -------------------------------- BRAHMS execution object -------------------------------- Name: (not set) Title: (not set) Precision: 6 Window: (not set) Encapsulate All: false Log All: true Seed: (not set) Addresses: 127.0.0.1, 127.0.0.1, 127.0.0.1 Affinity: (not set) Execution Stop: 1 Working Directory: (not set) Launch Line: each brahms ((EXECFILE)) --voice-((VOICE)) ((ARGS)) ((LOG)) System File (In): unnamed-sys.xml System File (Out): (not set) Execution File: unnamed-exe.xml -------------------------------- out = sys: [1x1 struct] resamp: [1x1 struct]

Step 2 - Distributing

Once you have a Babble running successfully, distribution is fairly straightforward. First, you must set the addresses to the IP addresses of the machines you want to deploy on. Then you will need to construct a Launch Line that will invoke your processes on these machines. Retrieve exe.launch to see the default launch line, which may be adequate.

The Launch Line used in the example below works on our development environment to launch the voices on the machines specified by IP in exe.addresses.

Procedure

Example

Script

This example, along with the others in this section, can be found in the script developing_systems.m in the support/tutorial/system/matlab folder.

M Source Code (against 995)
% section header disp([10 '=== Using Concerto (2) ===' 10]) % instruct BRAHMS to use three voices, distributed exe.addresses = {'192.168.101.1' '192.168.101.2' '192.168.101.3'}; % review the default launch line exe.launch % instruct BRAHMS how to launch each voice exe.launch = [ ... 'each ssh -XC ((ADDR)) "brahms ((EXECFILE))' ... ' --voice-((VOICE)) ((ARGS)) ((LOG))"' ... ]; % view the execution exe % execute the system out = brahms(psys, exe); % view the system outputs out

Expected Output

Matlab Console
=== Using Concerto (2) === ans = each brahms ((EXECFILE)) --voice-((VOICE)) ((ARGS)) ((LOG)) -------------------------------- BRAHMS execution object -------------------------------- Name: (not set) Title: (not set) Precision: 6 Window: (not set) Encapsulate All: false Log All: true Seed: (not set) Addresses: 192.168.101.1, 192.168.101.2, 192.168.101.3 Affinity: (not set) Execution Stop: 1 Working Directory: (not set) Launch Line: each ssh -XC ((ADDR)) "brahms ((EXECFILE)) --voice-((VOICE)) ((ARGS)) ((LOG))" System File (In): unnamed-sys.xml System File (Out): (not set) Execution File: unnamed-exe.xml -------------------------------- out = sys: [1x1 struct] resamp: [1x1 struct]
Notes
  • The Launch Line is a flexible way to invoke multiple BRAHMS voices on remote machines in an uncertain environment (e.g. through SSH, or some other technology, as suits you). If required, you can launch a multi-processing execution manually, by invoking each voice manually on each machine, but check out the full flexibility of the Launch Line before you resort to this.
  • See the syntax inv = brahms('prep', ...) (try help brahms in Matlab) to see what the invocation command would be, but not execute it.

Using MPI

Above, we describe how to deploy using TCP/IP. To deploy using MPI, simply use

Script

M Source Code (against 995)
% instruct BRAHMS to use MPI to invoke and connect 3 voices exe.addresses = {'mpi' 3}; % check what the default launch line looks like exe.launch

Expected Output

Matlab Console
ans = mpiexec -n ((VOICES)) brahms ((EXECFILE)) --voice-mpi ((ARGS))
Notes
  • The default MPI launch line invokes brahms; we have had some trouble with this on Windows, for unknown reasons - try launching brahms-execute directly if you have problems.