title: Why does my MATLAB Neural Network train slower when using parallel processing?
body: <p>If I use the function:</p>
  
  <pre><code>net=feedfowardnet([60 60])
  
  net2=train(net,x,t)
  </code></pre>
  
  <p>It takes about 20 minuets to train. (I have done this on multiple computers {with the same specs}, and the average time is always around 20 mins)</p>
  
  <p>If I use the function:</p>
  
  <pre><code>parpool  %//starts a local parallel pool connected to 2 workers
  net2=train(net,x,t,'useParallel','yes')
  </code></pre>
  
  <p>It takes around 40 minuets to complete training. I have two cores, so this is counter intuitive, it should be twice as fast, not twice as slow. I am using the same starting network, and the same training inputs and targets.</p>
  
  <p>Also, when I open the task manager during NN training, it shows that both CPUs are working at 100%, even when <code>parpool</code> and <code>useParallel</code> are turned off.</p>
  
  <p><a href="http://www.mathworks.co.uk/help/nnet/ref/train.html" rel="nofollow">This page</a> of the Mathworks website says that "Parallel Computing Toolbox™ allows Neural Network Toolbox™ to simulate and train networks faster and on larger datasets than can fit on one PC. Parallel training is currently supported for backpropagation training only, not for self-organizing maps."</p>
  
  <p>I am using 2000 training examples in the data set. There are 32 inputs and 3 outputs so this is definitely a large data set. The parallel pool is also definitely turned off when I just use the <code>net2=train(net,x,t)</code> function.</p>
  
  <p>I have tested the use of <code>parpool</code> with other functions, (ones containing <code>parfor</code> loops), and the calculation is usually twice as fast. It is just seems to be the neural network training that goes slower.</p>
  
  <p>Is there any reason for this?</p>
  
  <p>I am using an Intel Core 2 Duo E8400 Cpu @3GHz, and I am using MATLAB version R2013 b. I am also using a computer on a network (inside a university). I'm not sure if this makes a difference.</p>
  
  <hr>
  
  <p><em>More info on the university computer network. I am using multiple computers on the network at the same time. I have not connected them together in a way to do distributed computing, each one is just doing its own thing using parallel computing on its own 2 processors. However I am not sure if the computers are still interfering with each other in some way because they are logged on with the same user. I load the training input and target data into the matlab workspace on each computer using:</em></p>
  
  <pre><code>load('H:\18-03-14\x.mat')
  load('H:\18-03-14\net.mat')
  load('H:\18-03-14\t.mat')
  </code></pre>
  
  <p><em>Where <code>H:</code> is the network drive. I am not sure if once these are in the matlab workspace, they are still somehow connected, and interfere with each other across different computers. Do they?</em></p>