Dynare Reference Manual: Parallel Configuration

Next: Windows Step-by-Step Guide, Previous: Dynare Configuration, Up: The Configuration File [Contents][Index]

### 5.2 Parallel Configuration

This section explains how to configure Dynare for parallelizing some tasks which require very little inter-process communication.

The parallelization is done by running several MATLAB or Octave processes, either on local or on remote machines. Communication between master and slave processes are done through SMB on Windows and SSH on UNIX. Input and output data, and also some short status messages, are exchanged through network filesystems. Currently the system works only with homogenous grids: only Windows or only Unix machines.

The following routines are currently parallelized:

- the posterior sampling algorithms when using multiple chains;
- the Metropolis-Hastings diagnostics;
- the posterior IRFs;
- the prior and posterior statistics;
- some plotting routines.

Note that creating the configuration file is not enough in order to trigger parallelization of the computations: you also need to specify the `parallel` option to the `dynare` command. For more details, and for other options related to the parallelization engine, see Dynare invocation.

You also need to verify that the following requirements are met by your cluster (which is composed of a master and of one or more slaves):

For a Windows grid
  - a standard Windows network (SMB) must be in place;
  - PsTools must be installed in the path of the master Windows machine;
  - the Windows user on the master machine has to be user of any other slave machine in the cluster, and that user will be used for the remote computations.
  - Detailed step-by-step setup instructions can be found in See Windows Step-by-Step Guide.
For a UNIX grid
  - SSH must be installed on the master and on the slave machines;
  - SSH keys must be installed so that the SSH connection from the master to the slaves can be done without passwords, or using an SSH agent

We now turn to the description of the configuration directives. Note that comments in the configuration file can be provided by separate lines starting with a hashtag (#).

Configuration block: [cluster]

  Description

  When working in parallel, `[cluster]` is required to specify the group of computers that will be used. It is required even if you are only invoking multiple processes on one computer.

  Options

  `Name = CLUSTER_NAME`

    The reference name of this cluster.

  `Members = NODE_NAME[(WEIGHT)] NODE_NAME[(WEIGHT)] …`

    A list of nodes that comprise the cluster with an optional computing weight specified for that node. The computing weight indicates how much more powerful one node is with respect to the others (e.g. `n1(2) n2(1) n3(3)`, means that `n1` is two times more powerful than `n2` whereas `n3` is three times more powerful than `n2`). Each node is separated by at least one space and the weights are in parenthesis with no spaces separating them from their node.

  Example

      [cluster]
      Name = c1
      Members = n1 n2 n3

      [cluster]
      Name = c2
      Members = n1(4) n2 n3

Configuration block: [node]

  Description

  When working in parallel, `[node]` is required for every computer that will be used. The options that are required differ, depending on the underlying operating system and whether you are working locally or remotely.

  Options

  `Name = NODE_NAME`

    The reference name of this node.

  `CPUnbr = INTEGER | [INTEGER:INTEGER]`

    If just one integer is passed, the number of processors to use. If a range of integers is passed, the specific processors to use (processor counting is defined to begin at one as opposed to zero). Note that using specific processors is only possible under Windows; under Linux and macOS, if a range is passed the same number of processors will be used but the range will be adjusted to begin at one.

  `ComputerName = COMPUTER_NAME`

    The name or IP address of the node. If you want to run locally, use `localhost` (case-sensitive).

  `Port = INTEGER`

    The port number to connect to on the node. The default is empty, meaning that the connection will be made to the default SSH port (22).

  `UserName = USER_NAME`

    The username used to log into a remote system. Required for remote runs on all platforms.

  `Password = PASSWORD`

    The password used to log into the remote system. Required for remote runs originating from Windows.

  `RemoteDrive = DRIVE_NAME`

    The drive to be used for remote computation. Required for remote runs originating from Windows.

  `RemoteDirectory = PATH`

    The directory to be used for remote computation. Required for remote runs on all platforms.

  `DynarePath = PATH`

    The path to the `matlab` subdirectory within the Dynare installation directory. The default is the empty string.

  `MatlabOctavePath = PATH_AND_FILE`

    The path to the MATLAB or Octave executable. The default value is `matlab`.

  `NumberOfThreadsPerJob = INTEGER`

    For Windows nodes, sets the number of threads assigned to each remote MATLAB/Octave run. The default value is `1`.

  `SingleCompThread = BOOLEAN`

    Whether or not to disable MATLAB’s native multithreading. The default value is `false`. Option meaningless under Octave.

  `OperatingSystem = OPERATING_SYSTEM`

    The operating system associated with a node. Only necessary when creating a cluster with nodes from different operating systems. Possible values are `unix` or `windows`. There is no default value.

  Example

      [node]
      Name = n1
      ComputerName = localhost
      CPUnbr = 1

      [node]
      Name = n2
      ComputerName = dynserv.cepremap.org
      CPUnbr = 5
      UserName = usern
      RemoteDirectory = /home/usern/Remote
      DynarePath = /home/usern/dynare/matlab
      MatlabOctavePath = matlab

      [node]
      Name = n3
      ComputerName = dynserv.dynare.org
      Port = 3333
      CPUnbr = [2:4]
      UserName = usern
      RemoteDirectory = /home/usern/Remote
      DynarePath = /home/usern/dynare/matlab
      MatlabOctavePath = matlab

Next: Windows Step-by-Step Guide, Previous: Dynare Configuration, Up: The Configuration File [Contents][Index]