Hi everyone,
A frequency parameter for my stimulation is increased at each turn of a loop, 50 frequencies are tested at each run.
I've parallelised the process such that n trials can be performed simultaneously, for a statistical analysis. (i use the ParallelNetManager)
Is there any easy way to parallel the process such that n groups of processors are working on n independant trials, AND within each of these groups, each processors is testing 1 assigned frequency?
This would lead to a 50 times shorter duration.
Thank you for any idea or comment,
=)
Another Kind of parallelisation
Moderator: hines
I interpret this as a set of ntrial*nfreqIs there any easy way to parallel the process such that n groups of processors are working on n independant trials, AND within each of these groups, each processors is testing 1 assigned frequency?
independent runs. i.e.
Code: Select all
for itrial = 1, ntrial {
for ifreq = 1, nfreq {
do_a_sim(itrial, ifreq)
}
}
However, if one of the above loops in fact is a single run network simulation then I am afraid the bulletin board and
network communication presently cannot be used simultaneously and one must do all communication in a way compatible with network communication. i.e. if a network sim uses 10 processes and you have 50 available, then you can combine 5 networks into one large network and do a run. Then use pc.barrier, pc.allreduce, pc.allgather, and pc.broadcast to exchange data. The latter is new in the alpha version and can be used to send an string or Vector from
any pc.id to all the other ranks.
Well, it relies on the main script structure...
Organize your functions and variables such that the total number of task is: #tasks = #repetitions . #values to be tested
i use this simple code:
///////////////////////////////////////////////////////////////////
n // Number of tasks
N // Number of repetitions
pnm1 = new ParallelNetManager(n)
pnm1.round_robin()
pnm1.ncell = n
for i=0, n-1 {
variable = any_function_of_i(i,N,...)
if(i%pnm1.nhost == pnm1.myid){
///// Execute whatever you want here...
///// function(variable,...)...
}
}
pnm1.pc.runworker
pnm1.pc.done()
///////////////////////////////////////////////////////////////////
Then it should be effeciently parallelized!
I hope it would help...
Bye,
=)
Organize your functions and variables such that the total number of task is: #tasks = #repetitions . #values to be tested
i use this simple code:
///////////////////////////////////////////////////////////////////
n // Number of tasks
N // Number of repetitions
pnm1 = new ParallelNetManager(n)
pnm1.round_robin()
pnm1.ncell = n
for i=0, n-1 {
variable = any_function_of_i(i,N,...)
if(i%pnm1.nhost == pnm1.myid){
///// Execute whatever you want here...
///// function(variable,...)...
}
}
pnm1.pc.runworker
pnm1.pc.done()
///////////////////////////////////////////////////////////////////
Then it should be effeciently parallelized!
I hope it would help...
Bye,
=)