Sensors 2022, 22, 2389 4 of 19
quality of the solution. However, it is clear from the overviews of the various models that
models with migration generally perform better than those without it.
Different topologies are optimal for different optimization problems. In the Coarse-
Grained model, some studies even suggested that the topology shape is not very important
if the topology is densely interconnected and not too large, which would cause insufficient
“mixing” among individuals. Generally, however, smaller topologies converge faster, but
at the risk of lower-quality solutions. Finding the right size is thus an essential step of
the implementation.
The parallelization of evolutionary processes is more related to the real processes
of evolution that can be observed in nature. Maximum utilization of parallelization is
conditioned by its implementation on parallelized hardware. Although implementing the
Fine-Grained or Coarse-Grained models on sequential computing units does not bring
much acceleration, it is recommended to use it instead of ordinary GA.
The design of a parallel calculation includes, among other things, sending tasks
to workstations and also sending the results of calculations back to the source station.
However, parallel GA models require communication during the calculation. This includes
sending individuals for migration for the Coarse-Grained model and exchanging data for
selection, mutation, and crossing within the neighborhood for the Fine-Grained model.
Each model contains several nodes interconnected in a certain way, defined by the model’s
topology. Each node can also be represented as one role, so it is necessary to design a
system that will implement the communication topology of the given model.
A frequently used module for parallel processing of tasks and the creation of com-
munication topologies is mpi4py [
9
]. This module has been successfully tested in the
described research, but it is challenging to perform distributed tasks on multiple worksta-
tions. Perhaps the only instruction for distributed processing, that in [10] is very complex.
For example, it assumes the creation of shared directories via the Network File System
(NFS). Due to its complexity, this module was not selected for the communication design.
Another option when designing the communication is to use some of the Advanced
Message Queuing Protocol (AMQP). RabbitMQ already was chosen [
9
] from several options.
According to the official website [
11
], it is the most widely used “message broker” system
with more than 35,000 applications worldwide. The described research was used in the
design of the parallel computation and the design of the communication topology.
3. Python Modules and Proposal of the Communication Design Using RabbitMQ
Python modules for implementing GA parallelization within Python and their detailed
comparison were given in [
4
]. For clarity, the following is a brief summary of the selected
modules. Four selected modules were chosen based on [
9
,
12
]. These modules were Scalable
Concurrent Operations in Python (SCOOP), Celery [
13
], RabbitMQ, and Postgresql. We
also tested other modules for implementing GA parallelization within Python described
in [4], and these were Multiprocessing [14], PyCSP, Pyro4, Dispy, Rpyc, and Disco.
The Celery module provides an asynchronous queue to insert jobs by sending mes-
sages. Celery supports RabbitMQ (recommended), Redis, and Amazon Simple Queue
Service (SQS) and focuses on real-time operations, and it also supports task scheduling.
SCOOP [
15
] primarily focuses on scientific computing [
9
] and provides task paral-
lelization on heterogeneous nodes. The module provides a futures class. This class provides
the map, map_as_completed, and mapReduce functions. All three mentioned functions
are parallel versions of the map function, which is part of the Python standard library. The
SCOOP module [
15
] is widely used for evolutionary algorithms, Monte Carlo simulations,
data mining, and graph traversal problems, for example.
The test scenario for module evaluation contained two workstations running two
Python programs inspired by the tutorial [
16
] and was extended to execute the task on
two workstations. The test scenario for the Celery module was inspired by [
9
,
17
], and
processing by worker units on multiple workstations in the network was added using the
message broker RabbitMQ and the backend Postgresql. The Python module pika [
18
] was