# Pool two computers for MATLAB parfor without MDCS

I have two identical computers, both with 4 dual cores and MATLAB installed on them. They are connected to the same network.

Is there anyway I can run a parforloop using the computation power of both machines without relying on MATLAB distributed computing server? I do not have a license for this, and seems to expensive to connect just two computers.

• parfor works only with the parallel computing toolbox, distributed computing server, or the MATLAB Coder. You could also try to split your problem in two independent tasks (domain decomposition, etc) that can be run in parallel on your two MATLAB boxes. Also, the most common linear algebra operations (lu, fft, backslash) are multithreaded by default, so you should see an improvement over single-core machines for large-enough array sizes. – GoHokies Oct 10 '16 at 18:11
• Split the problem does not work as the structure of the code is such that the parfor loop is run several times depending on an outer non-paralellizable outer loop. – phdstudent Oct 10 '16 at 20:24
• I made a tool for performing similar tasks once. The idea is to communicate between the nodes through a filesystem (you must be able to mount a network filesystem that is shared between the two systems). The overhead is so large that it only makes sense if each iteration takes long, say over 5 minutes or so. You can find the code in GitHub if you want to take a look. There is an example but the documentation is otherwise quite bad. I've successfully used this to compute Monte Carlo nonlinear FEM computations simultaneously on 30 or so computers. – knl Oct 13 '16 at 7:19
• There is an falternative available on Mathworks File Exchange here. – Abhinav Nov 20 '18 at 21:15

The short answer is "no", you cannot run a parfor loop without the distributed computing toolbox. You would have to do it manually, by setting up a system for communicating between the two matlab sessions, for sharing data, and for remotely executing commands. All of which is possible.