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
2928b34a
Commit
2928b34a
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
onelab work
parent
86d9ce52
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Common/onelab.h
+1
-1
1 addition, 1 deletion
Common/onelab.h
Fltk/onelabWindow.cpp
+38
-12
38 additions, 12 deletions
Fltk/onelabWindow.cpp
with
39 additions
and
13 deletions
Common/onelab.h
+
1
−
1
View file @
2928b34a
...
@@ -522,7 +522,7 @@ namespace onelab{
...
@@ -522,7 +522,7 @@ namespace onelab{
_gmshClient
->
Error
(
"Did not receive message header: aborting remote get"
);
_gmshClient
->
Error
(
"Did not receive message header: aborting remote get"
);
return
false
;
return
false
;
}
}
std
::
string
msg
(
length
);
std
::
string
msg
(
length
,
' '
);
if
(
!
_gmshClient
->
ReceiveMessage
(
length
,
&
msg
[
0
])){
if
(
!
_gmshClient
->
ReceiveMessage
(
length
,
&
msg
[
0
])){
_gmshClient
->
Error
(
"Did not receive message body: aborting remote get"
);
_gmshClient
->
Error
(
"Did not receive message body: aborting remote get"
);
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.cpp
+
38
−
12
View file @
2928b34a
...
@@ -7,8 +7,12 @@
...
@@ -7,8 +7,12 @@
#include
"GmshMessage.h"
#include
"GmshMessage.h"
#include
"Context.h"
#include
"Context.h"
#include
"OS.h"
#include
"OS.h"
#include
"OpenFile.h"
#include
"drawContext.h"
#include
"PView.h"
#include
"FlGui.h"
#include
"FlGui.h"
#include
"paletteWindow.h"
#include
"paletteWindow.h"
#include
"menuWindow.h"
#include
"onelabWindow.h"
#include
"onelabWindow.h"
// This file contains the Gmsh/FLTK specific parts of the ONELAB
// This file contains the Gmsh/FLTK specific parts of the ONELAB
...
@@ -98,41 +102,52 @@ bool onelab::localNetworkClient::run(const std::string &what)
...
@@ -98,41 +102,52 @@ bool onelab::localNetworkClient::run(const std::string &what)
double
timer
=
GetTimeInSeconds
();
double
timer
=
GetTimeInSeconds
();
char
*
message
=
new
char
[
length
+
1
]
;
std
::
string
message
(
length
,
' '
)
;
if
(
!
server
->
Receive
String
(
length
,
message
)){
if
(
!
server
->
Receive
Message
(
length
,
&
message
[
0
]
)){
Msg
::
Error
(
"Did not receive message body: stopping server"
);
Msg
::
Error
(
"Did not receive message body: stopping server"
);
delete
[]
message
;
break
;
break
;
}
}
switch
(
type
)
{
switch
(
type
)
{
case
GmshSocket
::
GMSH_START
:
case
GmshSocket
::
GMSH_START
:
_pid
=
atoi
(
message
);
_pid
=
atoi
(
message
.
c_str
()
);
break
;
break
;
case
GmshSocket
::
GMSH_STOP
:
case
GmshSocket
::
GMSH_STOP
:
_pid
=
-
1
;
_pid
=
-
1
;
break
;
break
;
case
GmshSocket
::
GMSH_ONELAB_PARAM
:
case
GmshSocket
::
GMSH_ONELAB_PARAM
:
printf
(
"server: got onelab param!
\n
"
);
printf
(
"server: got onelab param
%s
!
\n
"
,
message
.
c_str
()
);
break
;
break
;
case
GmshSocket
::
GMSH_PROGRESS
:
case
GmshSocket
::
GMSH_PROGRESS
:
Msg
::
StatusBar
(
2
,
false
,
"%s %s"
,
_name
.
c_str
(),
message
);
Msg
::
StatusBar
(
2
,
false
,
"%s %s"
,
_name
.
c_str
(),
message
.
c_str
()
);
break
;
break
;
case
GmshSocket
::
GMSH_INFO
:
case
GmshSocket
::
GMSH_INFO
:
Msg
::
Direct
(
"%-8.8s: %s"
,
_name
.
c_str
(),
message
);
Msg
::
Direct
(
"%-8.8s: %s"
,
_name
.
c_str
(),
message
.
c_str
()
);
break
;
break
;
case
GmshSocket
::
GMSH_WARNING
:
case
GmshSocket
::
GMSH_WARNING
:
Msg
::
Direct
(
2
,
"%-8.8s: %s"
,
_name
.
c_str
(),
message
);
Msg
::
Direct
(
2
,
"%-8.8s: %s"
,
_name
.
c_str
(),
message
.
c_str
()
);
break
;
break
;
case
GmshSocket
::
GMSH_ERROR
:
case
GmshSocket
::
GMSH_ERROR
:
Msg
::
Direct
(
1
,
"%-8.8s: %s"
,
_name
.
c_str
(),
message
);
Msg
::
Direct
(
1
,
"%-8.8s: %s"
,
_name
.
c_str
(),
message
.
c_str
());
break
;
case
GmshSocket
::
GMSH_MERGE_FILE
:
{
int
n
=
PView
::
list
.
size
();
MergeFile
(
message
);
drawContext
::
global
()
->
draw
();
if
(
n
!=
(
int
)
PView
::
list
.
size
())
FlGui
::
instance
()
->
menu
->
setContext
(
menu_post
,
0
);
}
break
;
case
GmshSocket
::
GMSH_PARSE_STRING
:
ParseString
(
message
);
drawContext
::
global
()
->
draw
();
break
;
break
;
default
:
default
:
Msg
::
Warning
(
"Received unknown message type (%d)"
,
type
);
Msg
::
Warning
(
"Received unknown message type (%d)"
,
type
);
break
;
break
;
}
}
delete
[]
message
;
FlGui
::
instance
()
->
check
();
FlGui
::
instance
()
->
check
();
}
}
...
@@ -140,8 +155,7 @@ bool onelab::localNetworkClient::run(const std::string &what)
...
@@ -140,8 +155,7 @@ bool onelab::localNetworkClient::run(const std::string &what)
delete
server
;
delete
server
;
Msg
::
StatusBar
(
2
,
true
,
"Done running '%s'"
,
_name
.
c_str
());
Msg
::
StatusBar
(
2
,
true
,
"Done running '%s'"
,
_name
.
c_str
());
return
true
;
return
false
;
}
}
bool
onelab
::
localNetworkClient
::
kill
()
bool
onelab
::
localNetworkClient
::
kill
()
...
@@ -169,6 +183,17 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -169,6 +183,17 @@ void onelab_cb(Fl_Widget *w, void *data)
FlGui
::
instance
()
->
onelab
->
show
();
FlGui
::
instance
()
->
onelab
->
show
();
}
}
void
onelab_compute_cb
(
Fl_Widget
*
w
,
void
*
data
)
{
printf
(
"onelab has %d clients
\n
"
,
onelab
::
server
::
instance
()
->
getNumClients
());
for
(
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
firstClient
();
it
!=
onelab
::
server
::
instance
()
->
lastClient
();
it
++
){
onelab
::
client
*
c
=
it
->
second
;
printf
(
"client name = %s
\n
"
,
c
->
getName
().
c_str
());
c
->
run
(
"/Users/geuzaine/src/getdp/demos/test.pro -solve MagSta_phi -pos phi"
);
}
}
onelabWindow
::
onelabWindow
(
int
deltaFontSize
)
onelabWindow
::
onelabWindow
(
int
deltaFontSize
)
{
{
FL_NORMAL_SIZE
-=
deltaFontSize
;
FL_NORMAL_SIZE
-=
deltaFontSize
;
...
@@ -184,6 +209,7 @@ onelabWindow::onelabWindow(int deltaFontSize)
...
@@ -184,6 +209,7 @@ onelabWindow::onelabWindow(int deltaFontSize)
}
}
_run
=
new
Fl_Button
(
width
-
WB
-
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"Compute"
);
_run
=
new
Fl_Button
(
width
-
WB
-
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"Compute"
);
_run
->
callback
(
onelab_compute_cb
);
_win
->
position
_win
->
position
(
CTX
::
instance
()
->
solverPosition
[
0
],
CTX
::
instance
()
->
solverPosition
[
1
]);
(
CTX
::
instance
()
->
solverPosition
[
0
],
CTX
::
instance
()
->
solverPosition
[
1
]);
...
...
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