MATLAB Answers

Running into "not enough input arguments" error when using parfeval on a linux machine (works fine on Mac OSX).

3 views (last 30 days)
Alexander Hayes
Alexander Hayes on 28 Apr 2021
Answered: Edric Ellis on 28 Apr 2021
I am trying to parallelize a camera calibration pipeline using parfeval. The function works great on my Mac Pro, but gives a "not enough input agruments" error after I push it to the linux production machine. The two setups are identical in terms of code, support files, and file structure. The Mac Pro is running R2019B and the linux machine has R2020B. Here is the error I get on the linux machine:
>> [logfile,numT,numF] = mastcamz_run_radcal_v4('all',1,1,1,1,0,0,0,0,1);
Starting parallel pool (parpool) using the 'local' profile ...
Connected to the parallel pool (number of workers: 16).
Not enough input arguments.
Error in mastcamz_run_radcal_v4 (line 261)
F(i) = parfeval(p,@pareval_mastcamz_run_radcal_v4,3,sols(i),run_rad,run_epo,run_iof,run_pix,deliver_flag,save_local,force_cal,force_shutter,save_scratch,base_dir,scratch_dir,deliver_dir);
The number of input arguments to pareval_mastcamz_run_radcal_v4 is correct and, as stated above, the overall function works great on the Mac.
Any ideas?
I tried deleted the "local_cluster_job" directory, as suggested by previous posts, but that didn't help me at all...
Thank you!

Answers (1)

Edric Ellis
Edric Ellis on 28 Apr 2021
Without reproduction steps that we can try, we can only speculate as to what's going wrong here. My guess is that you aren't providing enough inputs to your call to mastcamz_run_radcal_v4, and line 261 is attempting to refer to an input that you haven't specified. A bit like this very much simplified example:
%% Call some_fcn with only 2 arguments
some_fcn(1, 2)
In some_fcn 1 2
Not enough input arguments.

Error in solution>some_fcn (line 8)
disp(c); % Gets "Not enough input arguments" when some_fcn is called with only 2 arguments
%% Here's a function that takes 3 argument
function some_fcn(a,b,c)
disp('In some_fcn')
disp(a); % This is fine
disp(b); % Also fine
disp(c); % Gets "Not enough input arguments" when some_fcn is called with only 2 arguments





Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!