Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCDDS-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SPC
SCDDS
SCDDS-core
Commits
25e1c8f9
Commit
25e1c8f9
authored
3 years ago
by
Cristian Galperti
Browse files
Options
Downloads
Patches
Plain Diff
SCDclass_expcode stdinits handling refactored
parent
97b300dc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/classes/SCDclass_expcode.m
+33
-19
33 additions, 19 deletions
code/classes/SCDclass_expcode.m
with
33 additions
and
19 deletions
code/classes/SCDclass_expcode.m
+
33
−
19
View file @
25e1c8f9
...
...
@@ -30,13 +30,13 @@ classdef SCDclass_expcode
activecpus
% numerical list of configured CPUs
%nodeddlist % list of data dictionaries at node level
wrapperlist
% list of configured wrappers
algo
objlist
% list of loaded algorithm objects
init
objlist
% list of loaded algorithm objects
with configured inits
algonamelist
% List of loaded algorithm names
algoddlist
% list of data dictionaries at algorithm level
mdscontainer
% container class for MDS+ interface objects
taskcontainer
% container class for generic init and term task objects
exportedtps
% list of tunable parameters variable to be exported
std
inits
% list of standard inits scripts
fp
inits
% list of standard inits scripts
modeltoactualize
% name of the algorithm to actualize ('all' means all coonfigured)
algos
% list of algorithms objects
nodes
% array of node properties structs
...
...
@@ -330,10 +330,10 @@ classdef SCDclass_expcode
end
function
init
(
obj
)
if
(
~
isempty
(
obj
.
algo
objlist
))
for
ii
=
1
:
numel
(
obj
.
algo
objlist
)
if
(
~
isempty
(
obj
.
init
objlist
))
for
ii
=
1
:
numel
(
obj
.
init
objlist
)
if
nargin
==
1
obj
.
algo
objlist
{
ii
}
.
init
();
obj
.
init
objlist
{
ii
}
.
init
();
elseif
nargin
==
2
error
(
'this use is deprecated, add tasks instead'
)
else
...
...
@@ -453,7 +453,7 @@ classdef SCDclass_expcode
fprintf
(
'* Configured MDS tunparams objects: %d (use printparameters method for details)\n'
,
obj
.
mdscontainer
.
numparams
);
fprintf
(
'* Configured MDS wavegens objects: %d (use printwavegens method for details)\n'
,
obj
.
mdscontainer
.
numwavegens
);
fprintf
(
'* Configured general purpose tasks: %d (use printtasks method for details)\n'
,
obj
.
taskcontainer
.
numtasks
);
fprintf
(
'* Configured init scripts: %d (use printinits method for details)\n'
,
numel
(
obj
.
std
init
s
));
fprintf
(
'* Configured init scripts: %d (use printinits method for details)\n'
,
numel
(
obj
.
init
objlist
));
end
function
printtasks
(
obj
)
...
...
@@ -461,11 +461,28 @@ classdef SCDclass_expcode
end
function
printinits
(
obj
)
if
(
~
isempty
(
obj
.
stdinits
))
for
ii
=
1
:
numel
(
obj
.
stdinits
)
fprintf
(
'%s -> %s\n'
,
char
(
obj
.
stdinits
{
ii
}{
1
}),
char
(
obj
.
stdinits
{
ii
}{
2
}));
% TODO: uniform the approach between stdinits and fpinits
% but only if fpinits will stay ...
fprintf
(
'* Configured std init scripts:\n'
);
if
(
~
isempty
(
obj
.
initobjlist
))
for
ii
=
1
:
numel
(
obj
.
initobjlist
)
[
stdinitstmp
,
~
]
=
obj
.
initobjlist
{
ii
}
.
getinits
;
if
~
isempty
(
stdinitstmp
)
for
jj
=
1
:
numel
(
stdinitstmp
)
fprintf
(
' %s\n'
,
char
(
stdinitstmp
{
jj
}));
end
end
end
end
fprintf
(
'* Configured fp init scripts:\n'
);
if
(
~
isempty
(
obj
.
fpinits
))
for
ii
=
1
:
numel
(
obj
.
fpinits
)
fprintf
(
' %s -> %s\n'
,
char
(
obj
.
fpinits
{
ii
}{
1
}),
char
(
obj
.
fpinits
{
ii
}{
2
}));
end
end
end
function
printMARTe2taskconfig
(
obj
,
shot
,
varargin
)
...
...
@@ -652,10 +669,10 @@ classdef SCDclass_expcode
if
(
numel
(
fpinits
)
>
0
)
toadd
=
ones
(
numel
(
fpinits
),
1
);
for
ii
=
1
:
numel
(
fpinits
)
if
(
~
isempty
(
obj
.
std
inits
))
for
jj
=
1
:
numel
(
obj
.
std
inits
)
for
kk
=
1
:
numel
(
obj
.
std
inits
{
jj
}{
2
})
if
(
strcmp
(
char
(
obj
.
std
inits
{
jj
}{
2
}{
kk
}),
fpinits
{
ii
}{
2
}))
if
(
~
isempty
(
obj
.
fp
inits
))
for
jj
=
1
:
numel
(
obj
.
fp
inits
)
for
kk
=
1
:
numel
(
obj
.
fp
inits
{
jj
}{
2
})
if
(
strcmp
(
char
(
obj
.
fp
inits
{
jj
}{
2
}{
kk
}),
fpinits
{
ii
}{
2
}))
warning
(
'SCDclass_expcode:addalgorithm'
,
'An init driving the structure %s has already been added, ignoring this init.\d'
,
algoinits
{
ii
}{
2
})
toadd
(
ii
)
=
0
;
end
...
...
@@ -666,17 +683,14 @@ classdef SCDclass_expcode
temp
=
cell
(
10
,
1
);
temp
{
1
}
=
fpinits
{
ii
}{
1
};
temp
{
2
}
=
fpinits
{
ii
}{
2
};
obj
.
std
inits
{
end
+
1
}
=
temp
;
obj
.
fp
inits
{
end
+
1
}
=
temp
;
end
end
if
any
(
toadd
)
% if any inits from this algoobj were taken
% TODO: algoobjlist IS COMPLETELY MISLEADING, IT IS
% USED PRESENTLY AS A LIST OF ALGORITHMS WITH CONFIGURED
% INITS, IT MUST BE ABSOLUTELY MODIFIED
obj
.
algoobjlist
{
end
+
1
}
=
algo
;
%% Add the full algorithm object here, to see if it is fine
obj
.
initobjlist
{
end
+
1
}
=
algo
;
%% Add the full algorithm object here, to see if it is fine
end
elseif
(
numel
(
stdinitstmp
)
>
0
)
obj
.
algo
objlist
{
end
+
1
}
=
algo
;
obj
.
init
objlist
{
end
+
1
}
=
algo
;
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment