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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
702d1956
Commit
702d1956
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Enforce that we have a single network client at the time in the onelabWindow.
parent
9717446b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/onelabWindow.cpp
+24
-21
24 additions, 21 deletions
Fltk/onelabWindow.cpp
with
24 additions
and
21 deletions
Fltk/onelabWindow.cpp
+
24
−
21
View file @
702d1956
...
@@ -118,15 +118,11 @@ bool onelab::localNetworkClient::run()
...
@@ -118,15 +118,11 @@ bool onelab::localNetworkClient::run()
std
::
string
action
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
std
::
string
action
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
get
(
ps
,
getName
()
+
"/1ModelName"
);
get
(
ps
,
getName
()
+
"/1ModelName"
);
std
::
string
modelName
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
std
::
string
modelName
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
get
(
ps
,
getName
()
+
"/9InitializeCommand"
);
std
::
string
initializeCommand
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
get
(
ps
,
getName
()
+
"/9CheckCommand"
);
get
(
ps
,
getName
()
+
"/9CheckCommand"
);
std
::
string
checkCommand
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
std
::
string
checkCommand
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
get
(
ps
,
getName
()
+
"/9ComputeCommand"
);
get
(
ps
,
getName
()
+
"/9ComputeCommand"
);
std
::
string
computeCommand
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
std
::
string
computeCommand
=
(
ps
.
empty
()
?
""
:
ps
[
0
].
getValue
());
if
(
action
==
"initialize"
)
if
(
action
==
"check"
)
command
+=
" "
+
modelName
+
" "
+
initializeCommand
;
else
if
(
action
==
"check"
)
command
+=
" "
+
modelName
+
" "
+
checkCommand
;
command
+=
" "
+
modelName
+
" "
+
checkCommand
;
else
if
(
action
==
"compute"
)
else
if
(
action
==
"compute"
)
command
+=
" "
+
modelName
+
" "
+
computeCommand
;
command
+=
" "
+
modelName
+
" "
+
computeCommand
;
...
@@ -1021,15 +1017,31 @@ void onelabWindow::rebuildSolverList()
...
@@ -1021,15 +1017,31 @@ void onelabWindow::rebuildSolverList()
void
onelabWindow
::
addSolver
(
const
std
::
string
&
name
,
const
std
::
string
&
commandLine
,
void
onelabWindow
::
addSolver
(
const
std
::
string
&
name
,
const
std
::
string
&
commandLine
,
int
index
)
int
index
)
{
{
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
findClient
(
name
);
if
(
onelab
::
server
::
instance
()
->
findClient
(
name
)
!=
if
(
it
==
onelab
::
server
::
instance
()
->
lastClient
()){
onelab
::
server
::
instance
()
->
lastClient
())
return
;
// solver already exists
onelab
::
localNetworkClient
*
c
=
new
onelab
::
localNetworkClient
(
name
,
commandLine
);
c
->
setIndex
(
index
);
// unregister the other non-local clients so we keep only the new one
opt_solver_name
(
index
,
GMSH_SET
,
name
);
std
::
vector
<
onelab
::
client
*>
networkClients
;
if
(
commandLine
.
empty
())
for
(
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
firstClient
();
onelab_choose_executable_cb
(
0
,
(
void
*
)
c
);
it
!=
onelab
::
server
::
instance
()
->
lastClient
();
it
++
)
if
(
it
->
second
->
isNetworkClient
())
networkClients
.
push_back
(
it
->
second
);
for
(
unsigned
int
i
=
0
;
i
<
networkClients
.
size
();
i
++
){
onelab
::
server
::
instance
()
->
unregisterClient
(
networkClients
[
i
]);
delete
networkClients
[
i
];
}
}
// create and register the new client
onelab
::
localNetworkClient
*
c
=
new
onelab
::
localNetworkClient
(
name
,
commandLine
);
c
->
setIndex
(
index
);
opt_solver_name
(
index
,
GMSH_SET
,
name
);
if
(
commandLine
.
empty
())
onelab_choose_executable_cb
(
0
,
(
void
*
)
c
);
FlGui
::
instance
()
->
onelab
->
rebuildSolverList
();
FlGui
::
instance
()
->
onelab
->
rebuildSolverList
();
// initialize the client
onelab_cb
(
0
,
(
void
*
)
"initialize"
);
}
}
void
onelabWindow
::
removeSolver
(
const
std
::
string
&
name
)
void
onelabWindow
::
removeSolver
(
const
std
::
string
&
name
)
...
@@ -1054,18 +1066,9 @@ void solver_cb(Fl_Widget *w, void *data)
...
@@ -1054,18 +1066,9 @@ void solver_cb(Fl_Widget *w, void *data)
int
num
=
(
intptr_t
)
data
;
int
num
=
(
intptr_t
)
data
;
if
(
num
>=
0
){
if
(
num
>=
0
){
// unregister all non-local clients
for
(
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
firstClient
();
it
!=
onelab
::
server
::
instance
()
->
lastClient
();
it
++
){
onelab
::
client
*
c
=
it
->
second
;
if
(
c
->
isNetworkClient
())
onelab
::
server
::
instance
()
->
unregisterClient
(
c
);
}
// register new client
std
::
string
name
=
opt_solver_name
(
num
,
GMSH_GET
,
""
);
std
::
string
name
=
opt_solver_name
(
num
,
GMSH_GET
,
""
);
std
::
string
exe
=
opt_solver_executable
(
num
,
GMSH_GET
,
""
);
std
::
string
exe
=
opt_solver_executable
(
num
,
GMSH_GET
,
""
);
FlGui
::
instance
()
->
onelab
->
addSolver
(
name
,
exe
,
num
);
FlGui
::
instance
()
->
onelab
->
addSolver
(
name
,
exe
,
num
);
onelab_cb
(
0
,
(
void
*
)
"initialize"
);
}
}
else
else
FlGui
::
instance
()
->
onelab
->
rebuildSolverList
();
FlGui
::
instance
()
->
onelab
->
rebuildSolverList
();
...
...
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