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

 
 

bug #58811: [octave forge] (parallel) parcellfun does not see changes of load path

Submitter:  Muhali <muhali>
Submitted:  Thu 23 Jul 2020 04:56:15 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  i7tiol
Originator Name:  Open/Closed:  * Closed
Release:  * 5.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 13 Oct 2020 12:19:08 PM UTC, comment #5: 


comment #4:

> comment #1:
> > 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
>
> This will break a sizeable portion of my scripts. Is there no workaround, or any way to use the old and functioning version of parcellfun?
>


and globals are not recognized in any function that is called during execution.

Muhali <muhali>
Tue 13 Oct 2020 11:29:43 AM UTC, comment #4: 

comment #1:

> 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


This will break a sizeable portion of my scripts. Is there no workaround, or any way to use the old and functioning version of parcellfun?

Muhali <muhali>
Tue 25 Aug 2020 09:47:51 PM UTC, comment #3: 
Olaf Till <i7tiol>
Group Member
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>
Group Member
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:
   
   
Comment:
   

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)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-25 i7tiol StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2020-08-25 i7tiol Summary[octave forge] (parallel) parcellfun modifies load path [octave forge] (parallel) parcellfun does not see changes of load path
    2020-07-26 i7tiol Assigned toNone i7tiol
    2020-07-26 i7tiol StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code