Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
parfor error

Subject: parfor error

From: DADE SEDE

Date: 22 Mar, 2013 12:23:06

Message: 1 of 2

Hello,
Can anybody help me please with parfor? I have been struggling on that for long time.

I have an array neuronDelayConfiguationArray which looks like follows :

[1,1]
[1,2]
[1,3]
[1,4]
[1,5]
[2,1]
...

first number is neurons, second delays

If I open 6 matlabpool 6 of them run and, but when it comes to 7th it fails.
It says "Not enough input arguments." so I guess it doesn't read from the neuronDelayConfiguationArray, which is weird cause it runs just fine with FOR loop

      parfor g = 1:size(neuronDelayConfiguationArray,1)
                    neurons = neuronDelayConfiguationArray{g,1}(1,1);
                    delays = neuronDelayConfiguationArray{g,1}(1,2);
                    sit = NarxBuiler(neurons, delays, TrainXSet, TrainYSet);
                    sitarray(g,1) = sit;
                end

Additional note: once I had additional parameter in NarxBuiler function, which I sent to the function as a static number like NarxBuiler( ..... , 1) but parfor told me the variable was undefined. Thus it leads me to thinking all these errors are random...

Thanks for any help. I am using 2012b

Subject: parfor error

From: DADE SEDE

Date: 22 Mar, 2013 12:29:07

Message: 2 of 2

SO the output for 2 matlabpools are:

Training with TRAINLM.
Epoch 0/1000, Time 0.105, Performance 0.084469/0, Gradient 0.17709/1e-07, Mu 0.001/10000000000, Validation Checks 0/6
Epoch 11/1000, Time 0.291, Performance 0.0008596/0, Gradient 0.00019432/1e-07, Mu 1e-10/10000000000, Validation Checks 6/6
Training with TRAINLM completed: Validation stop.
 
 
Training with TRAINLM.
Epoch 0/1000, Time 0.124, Performance 0.064409/0, Gradient 0.12319/1e-07, Mu 0.001/10000000000, Validation Checks 0/6
Epoch 13/1000, Time 0.384, Performance 0.00052657/0, Gradient 0.0010604/1e-07, Mu 1e-06/10000000000, Validation Checks 6/6
Training with TRAINLM completed: Validation stop.

**So it runs ok for two cycles, but after that it shows the following error":
 
Error using parallel_function (line 589)

Not enough input arguments.

Error stack:
NarxBuiler>NarxBuiler.NarxBuiler at 20

Error in main (line 72)
                parfor g = 1:size(neuronDelayConfiguationArray,1)

"DADE SEDE" wrote in message <kihifa$lf2$1@newscl01ah.mathworks.com>...
> Hello,
> Can anybody help me please with parfor? I have been struggling on that for long time.
>
> I have an array neuronDelayConfiguationArray which looks like follows :
>
> [1,1]
> [1,2]
> [1,3]
> [1,4]
> [1,5]
> [2,1]
> ...
>
> first number is neurons, second delays
>
> If I open 6 matlabpool 6 of them run and, but when it comes to 7th it fails.
> It says "Not enough input arguments." so I guess it doesn't read from the neuronDelayConfiguationArray, which is weird cause it runs just fine with FOR loop
>
> parfor g = 1:size(neuronDelayConfiguationArray,1)
> neurons = neuronDelayConfiguationArray{g,1}(1,1);
> delays = neuronDelayConfiguationArray{g,1}(1,2);
> sit = NarxBuiler(neurons, delays, TrainXSet, TrainYSet);
> sitarray(g,1) = sit;
> end
>
> Additional note: once I had additional parameter in NarxBuiler function, which I sent to the function as a static number like NarxBuiler( ..... , 1) but parfor told me the variable was undefined. Thus it leads me to thinking all these errors are random...
>
> Thanks for any help. I am using 2012b

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us