Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
2248d568
Commit
2248d568
authored
10 years ago
by
Francois Henrotte
Browse files
Options
Downloads
Patches
Plain Diff
management of archived solution files and recomputations
parent
008574dd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Fltk/onelabGroup.cpp
+8
-7
8 additions, 7 deletions
Fltk/onelabGroup.cpp
contrib/onelab/python/onelab.py
+46
-23
46 additions, 23 deletions
contrib/onelab/python/onelab.py
with
54 additions
and
30 deletions
Fltk/onelabGroup.cpp
+
8
−
7
View file @
2248d568
...
...
@@ -855,17 +855,19 @@ void onelab_cb(Fl_Widget *w, void *data)
}
// save db in "restore" mode"
double
restoreMode
=
0
;
std
::
vector
<
onelab
::
number
>
pn
;
onelab
::
server
::
instance
()
->
get
(
pn
,
"0Metamodel/9Use restored solution"
);
if
(
pn
.
size
()){
pn
[
0
].
s
etValue
(
1
);
pn
[
0
].
setV
isibl
e
(
1
);
restoreMode
=
pn
[
0
].
g
etValue
();
pn
[
0
].
setV
alu
e
(
2
);
onelab
::
server
::
instance
()
->
set
(
pn
[
0
]);
}
std
::
string
s
;
s
.
assign
(
SplitFileName
(
GModel
::
current
()
->
getFileName
())[
0
]
+
fileName
);
if
(
fileChooser
(
FILE_CHOOSER_CREATE
,
"Save"
,
"*.db"
,
s
.
c_str
())){
if
(
!
restoreMode
)
archiveSolutionFiles
(
fileChooserGetName
(
1
));
saveDb
(
fileChooserGetName
(
1
));
}
...
...
@@ -874,7 +876,6 @@ void onelab_cb(Fl_Widget *w, void *data)
onelab
::
server
::
instance
()
->
get
(
pn
,
"0Metamodel/9Use restored solution"
);
if
(
pn
.
size
()){
pn
[
0
].
setValue
(
0
);
pn
[
0
].
setVisible
(
0
);
onelab
::
server
::
instance
()
->
set
(
pn
[
0
]);
}
action
=
"check"
;
...
...
This diff is collapsed.
Click to expand it.
contrib/onelab/python/onelab.py
+
46
−
23
View file @
2248d568
...
...
@@ -453,20 +453,6 @@ class client :
self
.
_send
(
self
.
_GMSH_ERROR
,
line
.
rstrip
().
encode
(
'
utf-8
'
))
sys
.
exit
(
1
)
def
getPath
(
self
,
inp
=
''
)
:
return
path
(
self
.
wdir
,
inp
)
def
exists
(
self
,
p
)
:
if
not
os
.
path
.
exists
(
p
):
self
.
sendError
(
'
path error: %s
'
%
(
p
))
exit
(
0
)
return
True
def
checkPath
(
self
,
inp
=
''
)
:
p
=
path
(
self
.
wdir
,
inp
)
self
.
exists
(
p
)
return
p
def
copy
(
self
,
here
,
there
):
os
.
system
(
'
cp
'
+
here
+
'
'
+
there
)
...
...
@@ -500,21 +486,58 @@ class client :
else
:
print
(
call
.
stderr
.
read
())
def
solutionFiles
(
self
,
list
)
:
def
getPath
(
self
,
inp
=
''
)
:
return
path
(
self
.
wdir
,
inp
)
def
fileExists
(
self
,
p
)
:
return
os
.
path
.
exists
(
p
)
def
checkFile
(
self
,
p
)
:
if
not
self
.
fileExists
(
p
):
self
.
sendError
(
'
path error: %s
'
%
(
p
))
exit
(
0
)
return
True
def
checkPath
(
self
,
inp
=
''
)
:
p
=
path
(
self
.
wdir
,
inp
)
self
.
checkFile
(
p
)
return
p
def
solutionFiles
(
self
,
client
,
list
)
:
self
.
defineNumber
(
'
0Metamodel/9Use restored solution
'
,
value
=
0
,
choices
=
[
0
,
1
])
self
.
defineString
(
'
0Metamodel/9Tag
'
,
value
=
''
)
if
list
:
if
self
.
getNumber
(
'
0Metamodel/9Use restored solution
'
)
:
return
self
.
getStringChoices
(
'
0Metamodel/9Solution files
'
)
solFiles
=
self
.
getStringChoices
(
'
0Metamodel/9Solution files
'
)
for
i
in
solFiles
:
self
.
checkFile
(
i
)
else
:
solFiles
=
list
self
.
setString
(
'
0Metamodel/9Solution files
'
,
value
=
solFiles
[
0
],
choices
=
solFiles
,
readOnly
=
1
)
for
i
in
solFiles
:
if
not
self
.
fileExists
(
i
)
:
self
.
setChanged
(
client
,
True
)
return
solFiles
def
needsCompute
(
self
,
client
)
:
# Avoid recomputation when a database with restored solutions has just been loaded
# Otherwise, stop using restored solutions when the client elmer has changed
if
self
.
useRestoredSolution
()
==
2
:
# we have just loaded a database
self
.
setRestoredSolution
(
1
)
self
.
setChanged
(
client
,
0
)
# do not compute
else
:
self
.
setNumber
(
'
0Metamodel/9Use restored solution
'
,
visible
=
0
)
self
.
set
String
(
'
0Metamodel/9Solution files
'
,
value
=
list
[
0
],
choices
=
list
,
readOnly
=
1
)
return
list
if
self
.
isChanged
(
client
):
self
.
set
RestoredSolution
(
0
)
return
True
return
False
def
r
estoreSolution
(
self
)
:
def
useR
estore
d
Solution
(
self
)
:
return
self
.
getNumber
(
'
0Metamodel/9Use restored solution
'
)
def
setRestoredSolution
(
self
,
val
)
:
self
.
setNumber
(
'
0Metamodel/9Use restored solution
'
,
value
=
val
)
def
outputFiles
(
self
,
list
)
:
if
list
:
self
.
setString
(
'
0Metamodel/9Output files
'
,
value
=
list
[
0
],
...
...
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