bugGNU Octave - Bugs: bug #63412, [octave forge] (parallel) Optim...

 
 

bug #63412: [octave forge] (parallel) Optim not working with parallel package

Submitter:  None
Submitted:  Thu 24 Nov 2022 11:29:43 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Oliver Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 7.3.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 24 Nov 2022 05:39:26 PM UTC, comment #4: 

I also tried it with Octave 7.3.0 and added


pkg load optim
pkg load parallel


to the .octaverc

Then, the following occurs:


>> warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\m
ean.m shadows a core library function
warning: called from
    C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\PKG_ADD at line 11 column
 3
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 632 column 7
    C:\PROGRA~1\GNUOCT~1\OCTAVE~2.0\mingw64\share\octave\7.3.0\m\startup/octaverc at line 29 column 1

warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\mean
.m shadows a core library function
warning: called from
    C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\PKG_ADD at line 11 column
 3
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 632 column 7
    C:\PROGRA~1\GNUOCT~1\OCTAVE~2.0\mingw64\share\octave\7.3.0\m\startup/octaverc at line 29 column 1

warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\mean
.m shadows a core library function
warning: called from
    C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\PKG_ADD at line 11 column
 3
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 632 column 7
    C:\PROGRA~1\GNUOCT~1\OCTAVE~2.0\mingw64\share\octave\7.3.0\m\startup/octaverc at line 29 column 1

warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\mean
.m shadows a core library function
warning: called from
    C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\PKG_ADD at line 11 column
 3
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 632 column 7
    C:\PROGRA~1\GNUOCT~1\OCTAVE~2.0\mingw64\share\octave\7.3.0\m\startup/octaverc at line 29 column 1

warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\mean
.m shadows a core library function
warning: called from
    C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\PKG_ADD at line 11 column
 3
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 632 column 7
    C:\PROGRA~1\GNUOCT~1\OCTAVE~2.0\mingw64\share\octave\7.3.0\m\startup/octaverc at line 29 column 1

warning: function C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\shadow\mean
.m shadows a core library function
warning: called from
    C:\Program Files\GNU Octave\Octave-7.3.0\mingw64\share\octave\packages\statistics-1.5.0\PKG_ADD at line 11 column
 3
    load_packages_and_dependencies at line 56 column 5
    load_packages at line 53 column 3
    pkg at line 632 column 7
    C:\PROGRA~1\GNUOCT~1\OCTAVE~2.0\mingw64\share\octave\7.3.0\m\startup/octaverc at line 29 column 1

error: octave_base_value::save_binary(): wrong type argument 'cs-list'
error: octave_base_value::load_binary(): wrong type argument 'cs-list'
>> error: octave_base_value::save_binary(): wrong type argument 'cs-list'
error: octave_base_value::save_binary(): wrong type argument 'cs-list'
error: octave_base_value::save_binary(): wrong type argument 'cs-list'
error: octave_base_value::save_binary(): wrong type argument 'cs-list'
error: octave_base_value::save_binary(): wrong type argument 'cs-list'


Anonymous
Thu 24 Nov 2022 05:20:13 PM UTC, comment #3: 


> In my example, i used "pkg load optim" and "pkg load parallel", is it enugh or must the package loaded in another way?


See comment #1:

> Afaict, you'd need to load any packages in your .octaverc file to have them available in all of these separate instances of Octave.
> In your example, that would be `pkg load optim`.


See also: https://docs.octave.org/v7.3.0/Startup-Files.html

Also: Octave 6.3.0 is old and no longer supported. Please, consider updating to Octave 7.3.0.

Markus Mützel <mmuetzel>
Group administrator
Thu 24 Nov 2022 04:52:00 PM UTC, comment #2: 

I tried it with Octave 6.3.0 and the latest versions of optim and parallel using "pkg install -forge optim" and "pkg install -forge parallel".

In my example, i used "pkg load optim" and "pkg load parallel", is it enugh or must the package loaded in another way?

Anonymous
Thu 24 Nov 2022 01:24:58 PM UTC, comment #1: 

Which versions of Octave, the optim package and the parallel package are you using?

IIUC, the parallel package starts several Octave instances which perform different portions of the evaluation.

Afaict, you'd need to load any packages in your .octaverc file to have them available in all of these separate instances of Octave.
In your example, that would be `pkg load optim`.

Does that help?

Markus Mützel <mmuetzel>
Group administrator
Thu 24 Nov 2022 11:29:43 AM UTC, original submission:  

Hello,

I installed the optim and the parallel package to perform a nonlin_curvefit much faster. Even if for the example below, the parallel optimization is defintely not needed, I wish to have it for my data and refeinement function.

Using

options.parallel_local = false;

all works fine and the result is as expected.

For

options.parallel_local = true;

an error occurs:


>> could not save variable.
could not save variable.
could not save variable.
could not save variable.
could not save variable.
could not save variable.
errorerror: octave_base_value::load_binary(): wrong type argument 'cs-list'
>> : octave_base_value::save_binary(): wrong type argument 'cs-list'
error: octave_base_value::save_binary(): wrong type argument 'cs-list'
error: oeerror: octave_base_value::save_binary(): wrong type argument 'cs-list'
ctave_base_value::save_binary(): wrong type argument 'cs-list'rrorerror: octave_base_value::save_binary(): wrong type argument 'cs-list'

: octave_base_value::save_binary(): wrong type argument 'cs-list'



Here is the full script:

#Theoretical values
a = 5;
b = 4;
c = 3;

#Start values for refinement
m = 1;
n = 1;
o = 1;

#Lower and upper bounds
lb = [0;  0;  0];
ub = [10; 10; 10];

#Noice Level
s = 0.0;

#Load optim package
pkg load optim;

#Load optim package
pkg load parallel;

x=-100:100;
for i = 1:length(x)
  yTemp = a*x(i)^3 + b*x(i)^2 + c*x(i);
  y(i) = s*randn(1)*yTemp+yTemp;
endfor

x = x;
y = y;

options.parallel_local = true;

fun = @ (p, x) p(1)*x.^3 + p(2)*x.^2 + p(3)*x;
paramn = [m; n; o];
[param, f, cvg, outp] = nonlin_curvefit(fun, paramn, x, y, options);

a      = a
b      = b
c      = c
aRes   = param(1)
bRes   = param(2)
cRes   = param(3)

for i = 1:length(x)
  yRes(i) = aRes*x(i)^3 + bRes*x(i)^2 + cRes*x(i);
endfor

plot(x, y, ".k;Data points;", "markersize", 10, x, yRes, "r;Result;", "LineWidth", 3);


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54003:  Parallel-Test.m added by None (854B - application/vnd.wolfram.mathematica.package)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-24 mmuetzel Release6.2.0 7.3.0
    2022-11-24 mmuetzel SummaryOctave Optim not working with parallel package [octave forge] (parallel) Optim not working with parallel package
    2022-11-24 None Attached File- Added Parallel-Test.m, #54003

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code