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
6bbf2e3d
Commit
6bbf2e3d
authored
12 years ago
by
Francois Henrotte
Browse files
Options
Downloads
Patches
Plain Diff
dealing with subclient termination
parent
31df27e3
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/gmshLocalNetworkClient.h
+1
-1
1 addition, 1 deletion
Fltk/gmshLocalNetworkClient.h
Fltk/onelabGroup.cpp
+18
-5
18 additions, 5 deletions
Fltk/onelabGroup.cpp
with
19 additions
and
6 deletions
Fltk/gmshLocalNetworkClient.h
+
1
−
1
View file @
6bbf2e3d
...
...
@@ -39,7 +39,7 @@ class gmshLocalNetworkClient : public onelab::localNetworkClient{
if
(
i
>=
0
&&
i
<
getNumClients
())
return
_clients
[
i
];
return
0
;
}
bool
receiveMessage
();
bool
receiveMessage
(
int
&
type
);
bool
run
();
bool
kill
();
};
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabGroup.cpp
+
18
−
5
View file @
6bbf2e3d
...
...
@@ -145,7 +145,7 @@ class onelabGmshServer : public GmshServer{
}
};
bool
gmshLocalNetworkClient
::
receiveMessage
()
bool
gmshLocalNetworkClient
::
receiveMessage
(
int
&
type
)
{
double
timer
=
GetTimeInSeconds
();
...
...
@@ -154,11 +154,13 @@ bool gmshLocalNetworkClient::receiveMessage()
return
false
;
}
int
type
,
length
,
swap
;
int
length
,
swap
;
if
(
!
getGmshServer
()
->
ReceiveHeader
(
&
type
,
&
length
,
&
swap
)){
Msg
::
Error
(
"Abnormal server termination (did not receive message header)"
);
return
false
;
}
else
if
(
false
)
std
::
cout
<<
"Received header: "
<<
type
<<
" from "
<<
getName
()
<<
std
::
endl
;
std
::
string
message
(
length
,
' '
);
if
(
!
getGmshServer
()
->
ReceiveMessage
(
length
,
&
message
[
0
])){
...
...
@@ -346,10 +348,11 @@ bool gmshLocalNetworkClient::receiveMessage()
{
#if defined(HAVE_ONELAB_METAMODEL)
localSolverClient
*
c
=
new
InterfacedClient
(
"OLParser"
,
""
,
""
);
std
::
string
ofileName
=
message
;
std
::
vector
<
std
::
string
>
split
=
SplitOLFileName
(
message
);
std
::
string
ofileName
=
split
[
0
]
+
split
[
1
]
;
std
::
ofstream
outfile
(
ofileName
.
c_str
());
if
(
outfile
.
is_open
())
c
->
convert_onefile
(
ofileName
+
".ol"
,
outfile
);
c
->
convert_onefile
(
message
,
outfile
);
else
Msg
::
Error
(
"The file <%s> cannot be opened"
,
ofileName
.
c_str
());
outfile
.
close
();
...
...
@@ -398,6 +401,10 @@ bool gmshLocalNetworkClient::run()
gmshLocalNetworkClient
*
c
=
0
;
for
(
int
i
=
0
;
i
<
getNumClients
();
i
++
){
c
=
getClient
(
i
);
//std::cout << " client " << i << "/" << getNumClients()
// << " pid= " << c->getPid() << std::endl;
if
(
c
->
getPid
()
<
0
){
if
(
c
==
this
){
// the "master" client stopped
stop
=
true
;
...
...
@@ -428,8 +435,14 @@ bool gmshLocalNetworkClient::run()
}
}
}
int
type
=
0
;
if
(
stop
)
break
;
if
(
haveData
&&
!
c
->
receiveMessage
())
break
;
if
(
haveData
&&
!
c
->
receiveMessage
(
type
))
break
;
if
((
c
!=
this
)
&&
(
type
==
GmshSocket
::
GMSH_STOP
)){
std
::
string
reply
=
c
->
getName
();
getGmshServer
()
->
SendMessage
(
GmshSocket
::
GMSH_STOP
,
reply
.
size
(),
&
reply
[
0
]);
//onelab::server::instance()->unregisterClient(c);
}
if
(
c
==
this
&&
c
->
getPid
()
<
0
)
break
;
}
...
...
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