Print

Print


Rodrigo, let me try to understand what you're up to.  You are running ECJ and you are ALSO running a simulator.

1. Is the simulator going to be part of the ECJ process?

2. Let's assume #1 is "true".  Then when run ECJ with the simulator, could you do it this way:
	a. ECJ fires up
	b. ECJ constructs and initializes the simulator
	c. ECJ pauses the simulator
	d. ECJ gets an individual
	e. ECJ gives the individual to the simulator
	f. ECJ unpauses the simulator
	g. When the simulator finishes, it reports the result to ECJ
	h. ECJ resets the simulator and pauses it.
	i. Go to [d]
	j. When all individuals are done, ECJ destroys the simulator and quits

This is the simplest model, and it doesn't require multithreading at all.  Is there a reason you need to deviate from this? [that's not a rhetorical question -- there might be a valid reason]

3. Let's assume #1 is "false".  In this case does ECJ need to set up a socket connection to the remote simulator process, and if so, is this the reason you need to set up some threads, to maintain the socket communication?

Sean

On Dec 4, 2014, at 11:09 AM, Eric 'Siggy' Scott <[log in to unmask]> wrote:

> For parallel evaluation, the thread number is an argument to Problem.evaluate().  You can pass this along as an argument to the external program you call to tell it which server to connect to.
> 
> Master-slave processes can certainly be run on one computer.  I think it would be a bit trickier to get a Problem to know which slave it's running from, though.  I'd stick with multithreading.
> 
> Siggy
> 
> On Thu, Dec 4, 2014 at 10:10 AM, Rodrigo Moreno Garcia <[log in to unmask]> wrote:
> Hi,
> 
> 
> 
> 
> I want to use the parallel evaluation feature of ECJ to run the evolution of a robot inside a simulation. I have been reading through the ECJ tutorials and the manual and apparently this can be done either by using multithreading or by using parallel processes. The problem is that it is better for me to start multiple instances of the simulator only at the beginning of the evolutionary process, since it is an external program, and then use each individual thread or process to control only one individual instance of a simulator at a given time, that is, the simulator instances would act as servers waiting for the threads to connect, run the simulation and return the result,  so:
> 
> 
> Is there a way to identify different threads in the multithread case so that one thread would only control one simulator instance at a time? or
> 
> is there a way to know in which slave a problem is running in the parallel process case?
> Can the master-slave parallel process system be run on one computer or should it be always used in a cluster?
> 
> 
> Thank you very much,
> 
> 
> Best Regards,
> 
> Rodrigo
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> Ph.D student in Computer Science
> George Mason University
> http://mason.gmu.edu/~escott8/