Hey, I need to run my programa but it will run for 9 day ( one computer) . I want to know, if I use 2 computer the time os less? and how can i do it?
Show older comments
Answers (2)
Jan
on 13 Jun 2015
0 votes
Start with using the profiler to find out the bottlenecks of the code. Then improve the code there. If e.g. the disk access consumes the most time, buying a SSD will be more efficient than using another computer. If the RAM is exhausted and the computer uses the disk as virtual memory, installing more RAM can acclerate the code by a factor of 100 (or 10 or 1000).
After optimizing the program for running on one computer, you can start to think of using the Parallel Programming Toolbox to split the work to run on multiple cores.
1 Comment
yogan sganzerla
on 13 Jun 2015
Walter Roberson
on 13 Jun 2015
0 votes
You would need to install the Parallel Processing Toolkit, and the Distributed Computing Engine Toolbox, and configure and validate a cluster profile. Then in the code you would use parpool to request access to the resources. You would then use parfor or spmd to give the code to be executed by the workers.
The Distributed Computing Engine is expensive. You would not normally want to go that route first. Instead you would normally want to use a single multicore computer with lots of RAM, and the Parallel Computing Toolkit is able to use multiple cores on a single computer without needing the Distributed Computing engine.
4 Comments
yogan sganzerla
on 13 Jun 2015
Edited: Walter Roberson
on 13 Jun 2015
Walter Roberson
on 13 Jun 2015
A lot depends on the actual content of your loops. If you are counting things then you might be able to take advantage of reduction variables
If you can separate the computation into sections where you calculate with each section independently and then merge the results together, then you can generally convert the code to use parfor. However for something like a chaos map where the value of one iteration depends upon the value of all previous iterations then you cannot generally convert to use parfor.
yogan sganzerla
on 15 Jun 2015
Walter Roberson
on 15 Jun 2015
If your code cannot be redesigned to work on blocks and merged the results, then you need to ensure that your loops are optimized, using vectorized arithmetic and logical variables where practical.
We would need to see your code to determine what can be done in your situation.
Categories
Find more on Parallel Computing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!