OpenPSO is an efficient, modular and multicore-aware framework for experimenting with different PSO approaches. The package is implemented in C99, and transparently parallelized with OpenMP. OpenPSO is composed of three modules:
- A PSO algorithm library, with the capability of performing parallel function evaluations.
- A library of benchmarking functions.
- A command-line tool for directly experimenting with the different PSO algorithms and benchmarking functions.
The library components can be interfaced with other programs and programming languages, making OpenPSO a flexible and adaptable framework for PSO research.
OpenPSO has been tested with GCC and Clang on Windows and Linux. OpenMP support depends on the compiler version, but OpenPSO will work regardless (albeit slower without OpenMP support).
OpenPSO uses the CMake build system, which is able to generate projects for different targets, e.g. regular Makefiles, XCode or Eclipse.
A Dev-C++ project file is included for convenience. This project will only generate the command-line tool. It will not generate the library components for interfacing with third-party applications. Unfortunately, due to a bug in Dev-C++, the editor crashes when opening the project. To avoid this, disable "Enable code completion" in Tools=>Editor Options=>Completion before opening the project.
The openpsocli
tool uses the following syntax:
openpsocli [INPUT_FILE [SEED]]
If no input file is given, the tool defaults to input.ini
. The input file
defines the PSO parameters and number of runs to perform. An example input file
is available here.
By default, the number of threads used is the same as the number of available
processors. However, this default can be overridden by setting the
OMP_NUM_THREADS
environment to a specific value.
If you use this software please cite the following reference:
- Fernandes CM, Fachada N, Merelo J, Rosa AC. (2019). Steady state particle swarm. PeerJ Computer Science 5:e202 https://doi.org/10.7717/peerj-cs.202