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
b3ce786a
Commit
b3ce786a
authored
10 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
clarify exe vs. args + make OnelabRunClient treat exe as full command line
parent
13b98a88
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
Common/GmshMessage.cpp
+4
-4
4 additions, 4 deletions
Common/GmshMessage.cpp
Common/OS.cpp
+6
-5
6 additions, 5 deletions
Common/OS.cpp
Common/OS.h
+2
-1
2 additions, 1 deletion
Common/OS.h
with
12 additions
and
10 deletions
Common/GmshMessage.cpp
+
4
−
4
View file @
b3ce786a
...
...
@@ -1183,7 +1183,7 @@ void Msg::ImportPhysicalsAsOnelabRegions()
#endif
}
void
Msg
::
RunOnelabClient
(
const
std
::
string
&
name
,
const
std
::
string
&
exe
)
void
Msg
::
RunOnelabClient
(
const
std
::
string
&
name
,
const
std
::
string
&
command
)
{
#if defined(HAVE_ONELAB) && !defined(HAVE_ONELAB2)
onelab
::
server
::
citer
it
=
onelab
::
server
::
instance
()
->
findClient
(
name
);
...
...
@@ -1192,7 +1192,7 @@ void Msg::RunOnelabClient(const std::string &name, const std::string &exe)
client
=
it
->
second
;
}
else
{
if
(
exe
.
empty
()){
if
(
command
.
empty
()){
Msg
::
Error
(
"Unknown ONELAB client `%s'"
,
name
.
c_str
());
return
;
}
...
...
@@ -1202,8 +1202,8 @@ void Msg::RunOnelabClient(const std::string &name, const std::string &exe)
onelab
::
server
::
instance
()
->
set
(
o
);
#if defined(HAVE_FLTK)
Msg
::
Info
(
"Creating new ONELAB client `%s' (%s)"
,
name
.
c_str
(),
exe
.
c_str
());
client
=
new
gmshLocalNetworkClient
(
name
,
ex
e
);
command
.
c_str
());
client
=
new
gmshLocalNetworkClient
(
name
,
command
,
""
,
tru
e
);
client
->
run
();
#else
Msg
::
Error
(
"Cannot create ONELAB client without FLTK"
);
...
...
This diff is collapsed.
Click to expand it.
Common/OS.cpp
+
6
−
5
View file @
b3ce786a
...
...
@@ -380,7 +380,8 @@ int KillProcess(int pid)
return
1
;
}
int
SystemCallExe
(
const
std
::
string
&
exe
,
const
std
::
string
&
args
,
bool
blocking
)
int
SystemCallExe
(
const
std
::
string
&
exe
,
const
std
::
string
&
argsOrCommand
,
bool
blocking
)
{
// do we try to run a .py script, .m script or an .exe?
std
::
vector
<
std
::
string
>
split
=
SplitFileName
(
exe
);
...
...
@@ -398,17 +399,17 @@ int SystemCallExe(const std::string &exe, const std::string &args, bool blocking
std
::
string
command
;
if
(
exe
.
size
()){
command
.
append
(
"
\"
"
+
exe
+
"
\"
"
);
// allows exe with white space
if
(
args
.
size
())
command
.
append
(
" "
);
if
(
args
OrCommand
.
size
())
command
.
append
(
" "
);
}
command
.
append
(
args
);
command
.
append
(
args
OrCommand
);
#if defined(WIN32) && !defined(__CYGWIN__)
if
(
isPython
||
isOctave
){
Msg
::
Info
(
"Shell opening '%s' with arguments '%s'"
,
exe
.
c_str
(),
args
.
c_str
());
args
OrCommand
.
c_str
());
setwbuf
(
0
,
"open"
);
setwbuf
(
1
,
exe
.
c_str
());
setwbuf
(
2
,
args
.
c_str
());
setwbuf
(
2
,
args
OrCommand
.
c_str
());
ShellExecuteW
(
NULL
,
wbuf
[
0
],
wbuf
[
1
],
wbuf
[
2
],
NULL
,
0
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Common/OS.h
+
2
−
1
View file @
b3ce786a
...
...
@@ -25,7 +25,8 @@ int KillProcess(int pid);
int
CreateSingleDir
(
const
std
::
string
&
dirName
);
void
CreatePath
(
const
std
::
string
&
fullPath
);
int
SystemCall
(
const
std
::
string
&
command
,
bool
blocking
=
false
);
int
SystemCallExe
(
const
std
::
string
&
exe
,
const
std
::
string
&
args
,
bool
blocking
=
false
);
int
SystemCallExe
(
const
std
::
string
&
exe
,
const
std
::
string
&
argsOrCommand
,
bool
blocking
=
false
);
std
::
string
GetCurrentWorkdir
();
void
RedirectIOToConsole
();
FILE
*
Fopen
(
const
char
*
f
,
const
char
*
mode
);
...
...
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