Direct parallel search mapper#

mapper is an algorithm to search for the minimum value by computing \(f(x)\) on all the candidate points in the parameter space prepared in advance. In the case of MPI execution, the set of candidate points is divided into equal parts and automatically assigned to each process to perform trivial parallel computation.

Preparation#

For MPI parallelism, you need to install mpi4py.

$ python3 -m pip install mpi4py

Input parameters#

[algorithm] section#

  • colormap

    Format: String (default: “ColorMap.txt”)

    Description: Name of the file to which the search results (the coordinates and the objective function values of the mesh points) are written.

[algorithm.param] section#

In this section, the search parameter space is defined.

If mesh_path is defined, it is read from a mesh file. In the mesh file, one line defines one point in the parameter space, the first column is the data number, and the second and subsequent columns are the coordinates of each dimension.

If mesh_path is not defined, candidate points are automatically generated from the search space defined by min_list, max_list, and num_list: num_list points are sampled evenly for each parameter.

  • mesh_path

    Format: String

    Description: Path to the mesh definition file.

  • comments

    Format: String (default: “#”)

    Description: Character(s) that indicate the beginning of a comment line when reading the mesh definition file.

  • delimiter

    Format: String (default: whitespace)

    Description: Column delimiter of the mesh definition file. Specify "," to read a CSV file.

  • skiprows

    Format: Integer (default: 0)

    Description: Number of lines to skip at the beginning of the mesh definition file. Use it to skip header lines.

  • min_list

    Format: List of float. The length should match the value of dimension.

    Description: The minimum value the parameter can take.

  • max_list

    Format: List of float. The length should match the value of dimension.

    Description: The maximum value the parameter can take.

  • num_list

    Format: List of integer. The length should match the value of dimension.

    Description: The number of grids the parameter can take at each dimension.

Reference file#

Mesh definition file#

Define the grid space to be explored in this file. 1 + dimension columns are required. The first column is the index of the mesh, and the second and subsequent columns are the values of the parameters. Lines starting with # are ignored as comments.

A sample file for two dimensions is shown below.

1 6.000000 6.000000
2 6.000000 5.750000
3 6.000000 5.500000
4 6.000000 5.250000
5 6.000000 5.000000
6 6.000000 4.750000
7 6.000000 4.500000
8 6.000000 4.250000
9 6.000000 4.000000
...

Output file#

ColorMap.txt#

This file contains the candidate parameters for each mesh and the corresponding function value. The file name can be changed by the colormap parameter in the [algorithm] section. The mesh data is listed in the order of the variables defined by label_list in the [algorithm] section of the input file (x1, x2, … by default), and the function value is listed last.

An example of the output is shown below.

6.000000 6.000000 0.047852
6.000000 5.750000 0.055011
6.000000 5.500000 0.053190
6.000000 5.250000 0.038905
6.000000 5.000000 0.047674
6.000000 4.750000 0.065919
6.000000 4.500000 0.053675
6.000000 4.250000 0.061261
6.000000 4.000000 0.069351
6.000000 3.750000 0.071868
...

Restart#

The execution mode is specified by the run_mode parameter to the constructor. The operation of each mode is described as follows. The parameter values correspond to --init, --resume, and --cont options of odatse command, respectively.

  • "initial" (default)

    The program is started from the initial state. If the checkpointing is enabled, the intermediate states will be stored on the following occasions:

    1. the specified number of grid points has been evaluated, or the specified period of time has passed.

    2. at the end of the execution.

  • "resume"

    The program execution is resumed from the latest checkpoint. The conditions such as the number of MPI processes should be kept the same. Changing the number of search points is an error, because resuming continues the run the checkpoint was written for. To change the number of search points, use --init to start a new calculation (mapper does not support the continue mode).

  • "continue"

    The continue mode is not supported.