pythonoptimizationparallel-processingpygmo

Pygmo2: migration between islands in an archipelago during evolution


I'm trying to use the Python library Pygmo2 (https://esa.github.io/pagmo2/index.html) to parallelize an optimization problem.

To my understanding, parallelization can be achieved with an archipelago of islands (in this case, mp_island).

As a minimal working example, one of the tutorials from the official site can serve: https://esa.github.io/pagmo2/docs/python/tutorials/using_archipelago.html

I extracted the code:

class toy_problem:
    def __init__(self, dim):
        self.dim = dim

    def fitness(self, x):
        return [sum(x), 1 - sum(x*x), - sum(x)]

    def gradient(self, x):
        return pg.estimate_gradient(lambda x: self.fitness(x), x)

    def get_nec(self):
        return 1

    def get_nic(self):
        return 1

    def get_bounds(self):
        return ([-1] * self.dim, [1] * self.dim)

    def get_name(self):
        return "A toy problem"

    def get_extra_info(self):
        return "\tDimensions: " + str(self.dim)

import pygmo as pg
a_cstrs_sa = pg.algorithm(pg.cstrs_self_adaptive(iters=1000))
p_toy = pg.problem(toy_problem(50))
p_toy.c_tol = [1e-4, 1e-4]
archi = pg.archipelago(n=32,algo=a_cstrs_sa, prob=p_toy, pop_size=70)

print(archi)
archi.evolve()
print(archi)

Looking at the documentation of the old version of the library (http://esa.github.io/pygmo/documentation/migration.html), migration between islands seems to be an essential feature of the island parallelization model. Also, to my understanding, optimization algorithms like evolutionary algorithms could not work without it.

However, in the documentation of Pygmo2, I can nowhere find how to perform migration.

Is it happening automatically in an archipelago?

Does it depend on the selected algorithm?

Is it not yet implemented in Pygmo2?

Is the documentation on this yet missing or did I just not find it?

Can somebody enlighten me?


Solution

  • The migration framework has not been fully ported from pagmo1 to pagmo2 yet. There is a long-standing PR open here:

    https://github.com/esa/pagmo2/pull/102

    We will complete the implementation of the migration framework in the next few months, hopefully by the beginning of the summer.