Info
This question is closed. Reopen it to edit or answer.
Parallel computation at discrete times using matlab
1 view (last 30 days)
Show older comments
I have a problem with parallel computing in Matlab. Though I have gone through a bit over PARFOR function, I don’t find a comprehensive solution to the problem I am facing, which I have described below. There are several groups of nodes in a network. Inside the main function there is a for loop that resembles time:
Main function starts:
Statements…
k=100;
for i = 1:k
{
Statements …
Function A
Statements …
}
Let, there are two groups of distinct nodes named g1 and g2. During i=4, function A is called by group g1. So, nodes in group g1 leave main function and is executed inside function A. The main function and function A should execute simultaneously since then (meaning inside function A, there will be another loop that will continue for several times (for example, 10 times) and each time the loop executes, value of ‘i’ will be increased by 1 to keep up the time synchronized with main function). While these activities are going on, another group g2, being executed inside main function by this time, calls function A when i=6. So, similar to group g1, nodes in g2 also go out of the main function and are executed inside function A in a similar fashion. Hence, these two versions of the function A (with different inputs: g1 & g2) start at different times (i=4 and i=6 respectively) and are run simultaneously (in time ‘i’) with the main function. How to design such a problem? What exact mechanisms are available in Matlab and how to use those. Would you please guide me?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!