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


bug #58811: [octave forge] (parallel) parcellfun modifies load path

Submitted by:  Muhali <muhali>
Submitted on:  Thu 23 Jul 2020 04:56:15 PM UTC  
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Assigned to:  Olaf Till <i7tiol>
Originator Name:  Open/Closed:  Open
Release:  5.2.0 Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 27 Jul 2020 07:24:01 AM UTC, comment #2: 

Thx. What was the last package version that had the old setting (so that it would work with older octave (4, 5)?

Muhali <muhali>
Sun 26 Jul 2020 05:52:46 PM UTC, comment #1: 

There were reasons to change parcellfun to use newly started Octave instances. Any global variables for parallel Octave instances can only (reasonably) be set in Octaves startup file. This includes system globals like the set path. So actually parcellfun doesn't modify the path but it doesn't see modifications.

While I think that for globals set with 'global' in arbitrary user scripts it is probably reasonable to use variables closed into anonymous functions instead, system globals like the path should probably be honoured by the parallel Octave instances. So I put this on my TODO-list.

You mentioned that .octaverc is executed if parcellfun is called. This should only happen if you call parcellfun for the first time or if you call it with a higher number of parallel instances than ever used before in the same Octave session (except if parcellfun_set_nproc was called to reduce the number of existing parallel instances).

Olaf Till <i7tiol>
Project MemberIn charge of this item.
Thu 23 Jul 2020 04:56:15 PM UTC, original submission:  

Here is an example demonstrating that the parcellfun function modifies the load path:

pkg load parallel

d = tempname ;
mkdir(d) ;
addpath(d) ;

p1 = length(path)
p2 = cellfun(@(i) length(path), {1})
p3 = parcellfun(1, @(i) length(path), {1})

If the last three lines are replaced by

p1 = regexp(path, d)
p2 = cellfun(@(i) regexp(path, i), {d})
p3 = parcellfun(1, @(i) regexp(path, i), {d})

the following error message is returned:

error: parcellfun: =: nonconformant arguments (op1 is 1x1, op2 is 1x7)
error: called from
    parcellfun at line 209 column 23

I also noticed that with each (parallel) function call the octave init file (~/.octaverc) is executed.

Muhali <muhali>


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

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-26 i7tiol Assigned toNone => i7tiol
    2020-07-26 i7tiol StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.5