Crandore Hub

xegaMigration

'Xega' Island Models

Implements asynchronous message-passing communication protocols for island models of extended and evolutionary algorithms (see Tomassini, Marco (2005, ISBN:978-3-540-24193-5)) for the R-package 'xega' <https://CRAN.R-project.org/package=xega>. Basic asynchronous as well as synchronized communication primitives are supplied based on file I/O operations ('rds') on a shared file system or by 'openMPI' (MPI) messages. The gene selection and replacement strategies, the migration policy as well as the communication topology between islands are configurable. Homogeneous and heterogeneous island algorithms are supported. For examples (R and shell-scripts), see <https://github.com/ageyerschulz/xega/tree/main/examples/IslandModels>.

README

Testing the Island Models of the R-Package xegaMigration.

Testing the island models of the R-package xegaMigration 
requires a fully functional distributed system, because of 
the properties of the distributed algorithms used. 
xegaMigration uses either the communication primitives 
of mpi or semantically equivalent communication primitives
using a common file system (the rds-file I/O of base R). 

To run all test cases (this may take several hours):

./allTests.sh

Test Cases.

I. Test homogeneous island models without result collection phase.

test-1-run.R: mpi communication.   
     Should produce four xegaResult files in directory "./test1".   

test-1-test.R: 
     Tests: 
     - Do we have four files?
     - Did all the island algorithms improve the fitness? (4 times)
     - Did all the islands have the same number of generations?

test-2-run.R: rds communication.   
     Should produce four xegaResult files in directory "./test1".   

test-2-test.R: 
     Tests: 
     - Do we have four files?
     - Did all the island algorithms improve the fitness? (4 times)
     - Did all the islands have the same number of generations?
      
II. Test heterogenous island models with result collection phase.

We need heterogenous island models with controlled run-time differences
so that we know the order in which the processes finish.
Process 0 is the process collecting the results, 
the other processes send their results as soon as they finish.

We need to test the following orders:
[a] 0<1<2<3
[b] 1<2<3<0
[c] 2<1<0<3

test-3-run.R: mpi

test-4-run.R: mpi

test-5.run.R: rds communication.
        Process 0 probes 60 seconds for the results of the other 
        processes (maxDelay=60).
 
test-5-test.R: 
     Tests: 
     - Do we have 1 xegaIResult file?
     - Does the xegaIResult file has three elements?
     - Return code 0? (We have four results in the $results element)
       Expected!
     - 4 elements in $results?
     - Did all the island algorithms improve the fitness? (4 times)
     - Did all the islands have the same number of generations?
      
test-6.run.R: rds communication.
        Process 0 probes 0 seconds for the results of the other 
        processes (maxDelay=0).
 
test-6-test.R: 
     Tests: 
     - Do we have 1 xegaIResult file? Expectation: Yes!
     - Does the xegaIResult file has three elements?
     - Return code -1? (We have less than four results in the $results element)
       Expected!
     - Less than 4 elements in $results?
     - Did all the island algorithms improve the fitness? (x times)
     - Did all the islands have the same number of generations?

test-7A-run.R: rds communication.
     - order [a] 0<1<2<3
     - collect=TRUE
     - CommunicationTopology="ring2"
    
test-7B-run.R: rds communication. 
    - order [b] 1<2<3<0
    - collect=TRUE
    - CommunicationTopology="random", nrecv=1

test-7C-run.R: rds communication.
    - order [c] 2<1<0<3
    - collect=TRUE
    - CommunicationTopology="random", nrecv=2
   
test-8A-run.R: rds communication.
     - order [a] 0<1<2<3
     - collect=TRUE
     - CommunicationTopology="ring"
    
test-8B-run.R: mpi communication. 
    - order [b] 1<2<3<0
    - collect=TRUE
    - CommunicationTopology="random", nrecv=1

test-8C-run.R: mpi communication.
    - order [c] 2<1<0<3
    - collect=TRUE
    - CommunicationTopology="random", nrecv=2

test-9-run.R: rds communication.
    - collect=TRUE
    - CommunicationTopology="gPetersen",   (Petersen(5, 2).
    - mutrate=0.0
    - crossrate=0.0 

test-9A-run.R: mpi communication.
    - collect=TRUE
    - migrationDebug=TRUE
    - CommunicationTopology="gPetersen",   (Petersen(4, 2).
    - mutrate=0.0
    - crossrate=0.0 

test-10-run.R: rdsb communication.
    - collect=TRUE
    - CommunicationTopology="gPetersen",   (Petersen(5, 2).

test-11-run.R: rdsb communication. (+ cores=2 MultiCore).
    - npid=25           (50 processes)
    - popsize=1000
    - generations=100
    - collect=TRUE
    - CommunicationTopology="random"

test-12-run.R: rdsb communication. (+ cores=2 MultiCore).
    - npid=25           (50 processes)
    - popsize=1000
    - generations=100
    - collect=TRUE
    - CommunicationTopology="torus2D",  torusX=5, torusY=5).

test-13-run.R: rdsb communication. (+ cores=2 MultiCore).
    - npid=64           (128 processes)
    - popsize=1000
    - generations=100
    - mutrate=0.6
    - crossrate= 0.25
    - max2opt =100
    - migrate = "OnImprovement"
    - collect=TRUE
    - migrationDebug=TRUE
    - CommunicationTopology="torus3D",  torusX=4, torusY=4, torusZ=4).

Versions across snapshots

VersionRepositoryFileSize
0.5.0.4 rolling linux/jammy R-4.5 xegaMigration_0.5.0.4.tar.gz 993.8 KiB
0.5.0.4 rolling linux/noble R-4.5 xegaMigration_0.5.0.4.tar.gz 993.8 KiB
0.5.0.4 rolling source/ R- xegaMigration_0.5.0.4.tar.gz 892.4 KiB
0.5.0.4 latest linux/jammy R-4.5 xegaMigration_0.5.0.4.tar.gz 993.8 KiB
0.5.0.4 latest linux/noble R-4.5 xegaMigration_0.5.0.4.tar.gz 993.8 KiB
0.5.0.4 latest source/ R- xegaMigration_0.5.0.4.tar.gz 892.4 KiB
0.5.0.4 2026-04-23 source/ R- xegaMigration_0.5.0.4.tar.gz 0 B

Dependencies (latest)

Imports

Suggests