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
030914e9
Commit
030914e9
authored
16 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
start/stop msg
parent
5b392e44
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Common/Gmsh.cpp
+10
-0
10 additions, 0 deletions
Common/Gmsh.cpp
Common/GmshMessage.cpp
+12
-0
12 additions, 0 deletions
Common/GmshMessage.cpp
Common/GmshMessage.h
+4
-0
4 additions, 0 deletions
Common/GmshMessage.h
Fltk/Main.cpp
+2
-20
2 additions, 20 deletions
Fltk/Main.cpp
with
28 additions
and
20 deletions
Common/Gmsh.cpp
+
10
−
0
View file @
030914e9
...
...
@@ -4,6 +4,7 @@
// bugs and problems to <gmsh@geuz.org>.
#include
<string>
#include
<time.h>
#include
"GmshDefines.h"
#include
"GModel.h"
#include
"GmshMessage.h"
...
...
@@ -83,6 +84,9 @@ int GmshBatch()
{
if
(
!
GModel
::
current
())
return
0
;
Msg
::
Info
(
"Running '%s'"
,
Msg
::
GetCommandLine
().
c_str
());
Msg
::
Info
(
"Started on %s"
,
Msg
::
GetLaunchDate
().
c_str
());
OpenProject
(
CTX
.
filename
);
for
(
unsigned
int
i
=
1
;
i
<
CTX
.
files
.
size
();
i
++
){
if
(
CTX
.
files
[
i
]
==
"-new"
)
...
...
@@ -124,5 +128,11 @@ int GmshBatch()
CreateOutputFile
(
CTX
.
output_filename
,
CTX
.
mesh
.
format
);
}
time_t
now
;
time
(
&
now
);
std
::
string
currtime
=
ctime
(
&
now
);
currtime
.
resize
(
currtime
.
size
()
-
1
);
Msg
::
Info
(
"Stopped on %s"
,
currtime
.
c_str
());
return
1
;
}
This diff is collapsed.
Click to expand it.
Common/GmshMessage.cpp
+
12
−
0
View file @
030914e9
...
...
@@ -6,6 +6,7 @@
#include
<stdlib.h>
#include
<stdio.h>
#include
<string.h>
#include
<time.h>
#include
"GmshMessage.h"
#include
"Gmsh.h"
#include
"Options.h"
...
...
@@ -34,6 +35,8 @@ std::map<std::string, double> Msg::_timers;
int
Msg
::
_warningCount
=
0
;
int
Msg
::
_errorCount
=
0
;
GmshMessage
*
Msg
::
_callback
=
0
;
std
::
string
Msg
::
_commandLine
;
std
::
string
Msg
::
_launchDate
;
#if defined(HAVE_NO_VSNPRINTF)
static
int
vsnprintf
(
char
*
str
,
size_t
size
,
const
char
*
fmt
,
va_list
ap
)
...
...
@@ -59,6 +62,15 @@ void Msg::Init(int argc, char **argv)
MPI_Comm_size
(
MPI_COMM_WORLD
,
&
_commSize
);
MPI_Errhandler_set
(
MPI_COMM_WORLD
,
MPI_ERRORS_RETURN
);
#endif
time_t
now
;
time
(
&
now
);
_launchDate
=
ctime
(
&
now
);
_launchDate
.
resize
(
_launchDate
.
size
()
-
1
);
_commandLine
.
clear
();
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
if
(
i
)
_commandLine
+=
" "
;
_commandLine
+=
argv
[
i
];
}
}
void
Msg
::
Exit
(
int
level
)
...
...
This diff is collapsed.
Click to expand it.
Common/GmshMessage.h
+
4
−
0
View file @
030914e9
...
...
@@ -33,6 +33,8 @@ class Msg {
static
int
_warningCount
,
_errorCount
;
// callback
static
GmshMessage
*
_callback
;
// command-line and startup time
static
std
::
string
_commandLine
,
_launchDate
;
public:
Msg
()
{}
static
void
Init
(
int
argc
,
char
**
argv
);
...
...
@@ -48,6 +50,8 @@ class Msg {
static
int
GetThreadNum
();
static
void
SetVerbosity
(
int
val
){
_verbosity
=
val
;
}
static
int
GetVerbosity
(){
return
_verbosity
;
}
static
std
::
string
GetLaunchDate
(){
return
_launchDate
;
}
static
std
::
string
GetCommandLine
(){
return
_commandLine
;
}
static
void
Fatal
(
const
char
*
fmt
,
...);
static
void
Error
(
const
char
*
fmt
,
...);
static
void
Warning
(
const
char
*
fmt
,
...);
...
...
This diff is collapsed.
Click to expand it.
Fltk/Main.cpp
+
2
−
20
View file @
030914e9
...
...
@@ -4,7 +4,6 @@
// bugs and problems to <gmsh@geuz.org>.
#include
<string>
#include
<time.h>
#include
"GUI.h"
#include
"menuWindow.h"
#include
"Gmsh.h"
...
...
@@ -26,17 +25,6 @@ extern Context_T CTX;
int
main
(
int
argc
,
char
*
argv
[])
{
// Log some info
time_t
now
;
time
(
&
now
);
std
::
string
currtime
(
ctime
(
&
now
));
currtime
[
currtime
.
size
()
-
1
]
=
'\0'
;
std
::
string
cmdline
;
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
if
(
i
)
cmdline
+=
" "
;
cmdline
+=
argv
[
i
];
}
// Hack to generate automatic documentation (before getting
// user-defined options)
if
(
argc
==
2
&&
std
::
string
(
argv
[
1
])
==
"-doc"
){
...
...
@@ -59,14 +47,8 @@ int main(int argc, char *argv[])
// Non-interactive Gmsh
if
(
CTX
.
batch
)
{
Msg
::
Info
(
"Running '%s'"
,
cmdline
.
c_str
());
Msg
::
Info
(
"Started on %s"
,
currtime
.
c_str
());
GmshBatch
();
GmshFinalize
();
time
(
&
now
);
currtime
=
ctime
(
&
now
);
currtime
[
currtime
.
size
()
-
1
]
=
'\0'
;
Msg
::
Info
(
"Stopped on %s"
,
currtime
.
c_str
());
Msg
::
Exit
(
0
);
}
...
...
@@ -89,8 +71,8 @@ int main(int argc, char *argv[])
Msg
::
Info
(
"Build host : %s"
,
Get_GmshBuildHost
());
Msg
::
Info
(
"Packager : %s"
,
Get_GmshPackager
());
Msg
::
Info
(
"Home directory : %s"
,
CTX
.
home_dir
);
Msg
::
Info
(
"Launch date : %s"
,
currtime
.
c_str
());
Msg
::
Info
(
"Command line : %s"
,
cmdl
ine
.
c_str
());
Msg
::
Info
(
"Launch date : %s"
,
Msg
::
GetLaunchDate
()
.
c_str
());
Msg
::
Info
(
"Command line : %s"
,
Msg
::
GetCommandL
ine
()
.
c_str
());
Msg
::
Info
(
"-------------------------------------------------------"
);
// Display the GUI immediately to have a quick "a la Windows" launch time
...
...
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