Open FeelUsM opened 2 years ago
Perhaps, something like this?
S x;
.global
G G = x;
.sort
#do iter = 1, 10
* some calculation
id x = x + 1;
P;
.store
* save the stored expression
Save out`iter'.sav;
* prepare for the next iteration
G Gtmp = G;
.sort
Delete storage; * this clears all stored expressions
Drop Gtmp;
G G = Gtmp;
#enddo
.end
Saved expressions can be used in a different program:
Load out5.sav; * pick up one of the save files
L F = G;
* some calculation
id x = x^2;
P;
.end
Unfortunately each module that contain Local/Global G = Gtmp;
expression executes in 1 (one) thread.
So I need to separate this expression in separate module:
Global G = Gtmp;
.sort
But sorting large expressions in one thread needs very much time (more than do calculation and sorting with many threads).
Is there any way to copy expression without sorting?
Is looked into. Probably a special case for this can be created.
I want to write code that will save intermediate results in file, like this:
Or how to do such calculations properly?