EASEA command line

De
Aller à la navigation Aller à la recherche

Command Line Parameters To Control Parallelism

Controlling the number of CPU threads

$ OMP_NUM_THREADS=1 ./weierstrass

will launch the weierstrass program on only 1 CPU thread (useful to evaluate the impact of CPU parallelization

Controlling which CUDA card is visible to EASEA

$ CUDA_VISIBLE_DEVICES = 1,3

makes cards 1 and 3 only visible to EASEA (useful if your computer hosts different NVIDIA graphics cards, or if the chipset of the motherboard is from NVIDIA: if you run EASEA on all NVIDIA devices, EASEA will dispatch the population on all cards, and slow cards (or the motherboard chipset) will be the bottleneck).

This is also controllable from the parameters section of the .ez file

EASENA Compiler Parameters

Out of the same .ez file, EASEA can create different source codes, depending on whether you want to use an NVIDIA GPU card or not, or whether you want to evolve structures (genetic programming) or optimise parameters (evolutionary strategies, genetic algorithms). It is also possible to create Covariance Matrix Adaptation Evolutionary Strategy (CMA-ES) code.

No option (default)

By default, EASEA parallelizes the evaluation of the individuals on the cores of a multi-core CPU using OpenMP. To try this out, cd to the the examples/weierstrass directory and run:

$ easena weierstrass.ez
$ make
$ ./weierstrass


If you want to see the obtained acceleration, compare the parallel evaluation execution time with evaluation using a single thread. For this, run:

$ OMP_NUM_THREADS=1 ./weierstrass

This should be slower.

-cuda option

EASEA can also automatically parallelize the evaluation function on the many cores of an NVIDIA card. If you want / need to clean up the directory, run:

$ make easeaclean

The -cuda command line option makes EASEA create .cu files to exploit the massive parallelism of GPU cards rather than .cpp files, that exploit the parallelism of CPU cores. The created Makefile is also different.

In order to try this out, still in the weierstrass directory, run:

$ easena weierstrass.ez -cuda
$ make
$ ./weierstrass

If your computer is equipped with an NVIDIA GPU card, you should experiment a nice acceleration. To evaluate the gain obtained by parallelizing on a GPU card, do as above: compare the execution time on the GPU with the time obtained on one thread of the CPU.

-gp option

This makes EASEA create individuals that store equations as trees, in order to model some data.
Try this out in the regression directory with:

$ easena regression.ez -gp
$ make
$ ./regression

To see the acceleration obtained by parallelizing on OpenMP, run with:
$ OMP_NUM_THREADS=1 ./regression

You can simplify the expression that has been found thanks to online symbolic tools such as: https://www.symbolab.com/solver/simplify-calculator

-cuda_gp option

As above, but parallelized on an NVIDIA GPU card.

$ easena regression.ez -cuda_gp
$ make
$./regression

Compare the execution time to a single thread CPU execution to evaluate the obtained GPU acceleration.

-nsgaii option

This option for Multi-Objective Problems (MOPs). It makes EASENA to use a template of Nondominated Sorting genetic algorithm II (tpl/NSGAII.tpl). NSGA-II is a very popular Multi-Objective Evolutionary Algorithm (MOEA) in multi-objective optimization area. This algorithm makes offspring by using chosen crossover and mutation operators and selects individuals for a new generation by nondominated-sorting (NDS) and by crowding distance (CD) comparator. In order to compile your .ez file, for example dtlz1.ez (see folder examples/dtlz/dtlz1), following steps have to be done:

$ easena -nsgaii dtlz1.ez
If you have successfully compiled you .ez file you can find .cpp, .h, Makefile and .prm files in the current folder. And now, you can compile obtained .cpp files by using Makefile:

$ make

And if an executable file is built seccessfully, you can run it:

$ ./dtlz1

-nsgaiii option

This option for MOPs. It makes EASENA to use a template of Nondominated Sorting genetic algorithm III (tpl/NSGAIII.tpl). NSGA-III extends NSGA-II to using reference points to handle many-objective problems. In order to compile your .ez file, the steps are following:

$ easena -nsgaiii dtlz1.ez
$ make
$ ./dtlz1

-asrea option

This option for MOPs. It makes EASENA to use a template of Archived-Based Stcochastic Ranking Evolutionary Algorithm (tpl/ASREA.tpl). This MOEA ranks the population by comparing individuals with members of an archive, that breaks complexity into O(man) (m being the number of objectives, a the size of the archive and n the population size). The principe of compilation and of launching is the same as in case of -nsgaii and -nsgaiii:

$ easena -asrea dtlz1.ez
$ make
$ ./dtlz1

-ibea option

This option for MOPs. It makes EASENA to use a template of Indicator based evolutionary algorithm (tpl/IBEA.tpl). In current template the IBEA is based on progressively improvement the epsilon indicator function. Compilation and launching steps are the same as in all multi-objective cases above:

$ easena -ibea dtlz1.ez
$ make
$ ./dtlz1

-cdas option

This option for MOPs. It makes EASENA to use a template of Controlling Dominance Area of Solutions optimization algorithm (tpl/CDAS.tpl). CDAS controls the degree of expansion or contraction of the dominance area of solutions in order to improve the performance. Compilation steps are the same as in all multi-objective cases above:

$ easena -cdas dtlz1.ez
$ make
$ ./dtlz1

-memetic

The idea behind this option is that you can modify the genome of the individual in the evaluation function, if you want to run a local optimizer there, such as a gradient descent, for instance.

-cmaes

Implements a CMA-ES algorithm to optimize continuous problems.

Miscellaneous parameters

-v

This will compile a file in verbose mode. Mainly used for debug purposes.

-tl

This true line compiling mode will locate errors differently. Useful it it seems to you that the error is not located where the easea compiler tells you it is.