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
06f6049d
Commit
06f6049d
authored
12 years ago
by
Francois Henrotte
Browse files
Options
Downloads
Patches
Plain Diff
loader as a test native client
parent
aeeaf614
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/onelab/OnelabParser.cpp
+2
-0
2 additions, 0 deletions
contrib/onelab/OnelabParser.cpp
contrib/onelab/loader.cpp
+32
-0
32 additions, 0 deletions
contrib/onelab/loader.cpp
contrib/onelab/myOS.cpp
+2
-2
2 additions, 2 deletions
contrib/onelab/myOS.cpp
with
36 additions
and
2 deletions
contrib/onelab/OnelabParser.cpp
+
2
−
0
View file @
06f6049d
...
@@ -1676,4 +1676,6 @@ void MetaModel::client_sentence(const std::string &name,
...
@@ -1676,4 +1676,6 @@ void MetaModel::client_sentence(const std::string &name,
OLMsg
::
Error
(
"Unknown client <%s>"
,
name
.
c_str
());
OLMsg
::
Error
(
"Unknown client <%s>"
,
name
.
c_str
());
}
}
}
}
else
OLMsg
::
Error
(
"Unknown action <%s>"
,
action
.
c_str
());
}
}
This diff is collapsed.
Click to expand it.
contrib/onelab/loader.cpp
+
32
−
0
View file @
06f6049d
...
@@ -236,6 +236,7 @@ int main(int argc, char *argv[]){
...
@@ -236,6 +236,7 @@ int main(int argc, char *argv[]){
launchMenu
=
true
;
launchMenu
=
true
;
}
}
else
if
(
!
strcmp
(
argv
[
i
]
+
1
,
"lol"
))
{
else
if
(
!
strcmp
(
argv
[
i
]
+
1
,
"lol"
))
{
//loader used to call non-native clients (type=encapsulated)
std
::
string
clientName
=
argv
[
i
+
1
];
std
::
string
clientName
=
argv
[
i
+
1
];
client
=
new
onelab
::
remoteNetworkClient
(
clientName
,
argv
[
i
+
2
]);
client
=
new
onelab
::
remoteNetworkClient
(
clientName
,
argv
[
i
+
2
]);
if
(
client
){
if
(
client
){
...
@@ -265,6 +266,37 @@ int main(int argc, char *argv[]){
...
@@ -265,6 +266,37 @@ int main(int argc, char *argv[]){
}
}
exit
(
1
);
exit
(
1
);
}
}
else
if
(
!
strcmp
(
argv
[
i
]
+
1
,
"onelab"
))
{
//loader used as a test native client
client
=
new
onelab
::
remoteNetworkClient
(
argv
[
i
+
1
],
argv
[
i
+
2
]);
if
(
!
client
){
std
::
cout
<<
"I have no client
\n
"
;
exit
(
1
);
}
std
::
vector
<
onelab
::
string
>
strings
;
client
->
get
(
strings
,
client
->
getName
()
+
"/9CheckCommand"
);
if
(
strings
.
empty
()){
// initialize
onelab
::
string
s
(
client
->
getName
()
+
"/9CheckCommand"
,
"-a"
);
client
->
set
(
s
);
onelab
::
number
o
(
client
->
getName
()
+
"/Initialized"
,
1
);
client
->
set
(
o
);
}
else
{
std
::
cout
<<
"I am initialized: CheckCommand=<"
<<
strings
[
0
].
getValue
()
<<
">"
<<
std
::
endl
;
onelab
::
number
o
(
"alpha"
,
123456
);
client
->
set
(
o
);
client
->
get
(
strings
,
"MESSAGE"
);
if
(
strings
.
size
()){
std
::
cout
<<
"I have to tell you: "
<<
strings
[
0
].
getValue
()
<<
std
::
endl
;
}
std
::
cout
<<
"Now sleeping for 5s
\n
"
;
SleepInSeconds
(
5
);
std
::
cout
<<
"Awake again
\n
"
;
}
delete
client
;
return
0
;
}
else
if
(
!
strcmp
(
argv
[
i
]
+
1
,
"v"
))
{
else
if
(
!
strcmp
(
argv
[
i
]
+
1
,
"v"
))
{
i
++
;
i
++
;
if
(
argv
[
i
])
if
(
argv
[
i
])
...
...
This diff is collapsed.
Click to expand it.
contrib/onelab/myOS.cpp
+
2
−
2
View file @
06f6049d
...
@@ -184,7 +184,7 @@ int SystemCall(const std::string &command, bool blocking)
...
@@ -184,7 +184,7 @@ int SystemCall(const std::string &command, bool blocking)
PROCESS_INFORMATION
prInfo
;
PROCESS_INFORMATION
prInfo
;
memset
(
&
suInfo
,
0
,
sizeof
(
suInfo
));
memset
(
&
suInfo
,
0
,
sizeof
(
suInfo
));
suInfo
.
cb
=
sizeof
(
suInfo
);
suInfo
.
cb
=
sizeof
(
suInfo
);
//
OLMsg::Info("Calling <%s>", command.c_str());
OLMsg
::
Info
(
"Calling <%s>"
,
command
.
c_str
());
if
(
blocking
){
if
(
blocking
){
CreateProcess
(
NULL
,
(
char
*
)
command
.
c_str
(),
NULL
,
NULL
,
FALSE
,
CreateProcess
(
NULL
,
(
char
*
)
command
.
c_str
(),
NULL
,
NULL
,
FALSE
,
NORMAL_PRIORITY_CLASS
,
NULL
,
NULL
,
NORMAL_PRIORITY_CLASS
,
NULL
,
NULL
,
...
@@ -210,7 +210,7 @@ int SystemCall(const std::string &command, bool blocking)
...
@@ -210,7 +210,7 @@ int SystemCall(const std::string &command, bool blocking)
}
}
std
::
string
cmd
(
command
);
std
::
string
cmd
(
command
);
if
(
!
blocking
)
cmd
+=
" &"
;
if
(
!
blocking
)
cmd
+=
" &"
;
//
OLMsg::Info("Calling <%s>", cmd.c_str());
OLMsg
::
Info
(
"Calling <%s>"
,
cmd
.
c_str
());
return
system
(
cmd
.
c_str
());
return
system
(
cmd
.
c_str
());
#endif
#endif
}
}
...
...
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