Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GeoModelDev
GeoModel
Commits
96711b87
Commit
96711b87
authored
Feb 12, 2024
by
Joseph Boudreau
Browse files
Options
Downloads
Patches
Plain Diff
Fix to gmstatistics program
parent
6a6f8838
No related branches found
No related tags found
1 merge request
!276
Fix to gmstatistics program
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
GeoModelTools/GMSTATISTICS/src/gmstatistics.cxx
+70
-56
70 additions, 56 deletions
GeoModelTools/GMSTATISTICS/src/gmstatistics.cxx
with
70 additions
and
56 deletions
GeoModelTools/GMSTATISTICS/src/gmstatistics.cxx
+
70
−
56
View file @
96711b87
...
...
@@ -97,15 +97,10 @@ int main(int argc, char ** argv) {
std
::
cout
.
rdbuf
(
fileBuff
);
#ifdef __APPLE__
{
GeoIntrusivePtr
<
GeoVPhysVol
>
world
{
createGeoWorld
()};
for
(
const
std
::
string
&
plugin
:
inputPlugins
)
{
GeoIntrusivePtr
<
GeoPhysVol
>
world
{
createGeoWorld
()};
//
// Loop over plugins, create the geometry and put it under the world:
//
GeoGeometryPluginLoader
loader
;
GeoVGeometryPlugin
*
factory
=
loader
.
load
(
plugin
);
if
(
!
factory
)
{
...
...
@@ -113,34 +108,15 @@ int main(int argc, char ** argv) {
std
::
cout
.
rdbuf
(
coutBuff
);
return
5
;
}
int
before
=
snoop
();
factory
->
create
(
world
);
int
net
=
snoop
()
-
before
;
std
::
cout
.
rdbuf
(
coutBuff
);
if
(
printTree
)
{
GeoInventoryGraphAction
action
(
std
::
cout
);
world
->
exec
(
&
action
);
}
#ifndef __APPLE__
unsigned
int
expand
=
heapsize
();
world
->
unref
();
unsigned
int
contract
=
expand
-
heapsize
();
std
::
cout
<<
basename
((
char
*
)
plugin
.
c_str
())
<<
" allocates "
<<
net
/
factor
<<
" MB"
<<
" net GeoModel "
<<
contract
/
1000000.0
<<
" MB"
<<
std
::
endl
;
delete
factory
;
#else
// APPLE: meaningless std::cout << basename((char *) plugin.c_str()) << " allocates " << net/factor << " MB" << std::endl;
#endif
std
::
cout
.
rdbuf
(
fileBuff
);
}
std
::
cout
.
rdbuf
(
coutBuff
);
#ifdef __APPLE__
//
// Ceci n'est pas une pipe:
//
...
...
@@ -160,5 +136,43 @@ int main(int argc, char ** argv) {
sum
+=
total
;
}
std
::
cout
<<
"Total GeoModel object allocation: "
<<
sum
/
1000000.0
<<
"MB"
<<
std
::
endl
;
}
#else
{
for
(
const
std
::
string
&
plugin
:
inputPlugins
)
{
GeoGeometryPluginLoader
loader
;
GeoVGeometryPlugin
*
factory
=
loader
.
load
(
plugin
);
if
(
!
factory
)
{
std
::
cerr
<<
"Could not load plugin "
<<
plugin
<<
std
::
endl
;
std
::
cout
.
rdbuf
(
coutBuff
);
return
5
;
}
unsigned
int
expand
{
0
};
unsigned
int
net
{
0
};
{
GeoIntrusivePtr
<
GeoVPhysVol
>
world
{
createGeoWorld
()};
int
before
=
snoop
();
factory
->
create
(
world
);
net
=
snoop
()
-
before
;
std
::
cout
.
rdbuf
(
coutBuff
);
if
(
printTree
)
{
GeoInventoryGraphAction
action
(
std
::
cout
);
world
->
exec
(
&
action
);
}
expand
=
heapsize
();
}
unsigned
int
contract
=
expand
-
heapsize
();
std
::
cout
<<
basename
((
char
*
)
plugin
.
c_str
())
<<
" allocates "
<<
net
/
factor
<<
" MB"
<<
" net GeoModel "
<<
contract
/
1000000.0
<<
" MB"
<<
std
::
endl
;
delete
factory
;
std
::
cout
.
rdbuf
(
fileBuff
);
}
std
::
cout
.
rdbuf
(
coutBuff
);
}
#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
sign in
to comment