Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Chuck Atkins
ParaView
Commits
f1cf7da2
Commit
f1cf7da2
authored
Mar 09, 2017
by
Chuck Atkins
Browse files
Fix various issues with benchmark scripts
parent
62f72214
Pipeline
#50465
failed with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Wrapping/Python/paraview/benchmark/manyspheres.py
View file @
f1cf7da2
import
datetime
as
dt
from
paraview
import
servermanager
from
paraview.simple
import
*
#
from paraview.benchmark import *
import
logbase
,
logparser
from
paraview.benchmark
import
*
#
import logbase, logparser
logbase
.
maximize_logs
()
records
=
[]
...
...
@@ -81,7 +81,7 @@ def memtime_stamp():
def
run
(
output_basename
=
'log'
,
num_spheres
=
8
,
num_spheres_in_scene
=
None
,
resolution
=
725
,
view_size
=
(
1920
,
1080
),
num_frames
=
10
,
save_logs
=
True
,
color
=
False
,
OSPR
ay
=
False
):
transparency
=
False
,
ospr
ay
=
False
):
if
num_spheres_in_scene
is
None
:
num_spheres_in_scene
=
num_spheres
...
...
@@ -89,7 +89,7 @@ def run(output_basename='log', num_spheres=8, num_spheres_in_scene=None,
controller
=
vtk
.
vtkMultiProcessController
.
GetGlobalController
()
view
=
get_render_view
(
view_size
)
if
OSPR
ay
:
if
ospr
ay
:
view
.
EnableOSPRay
=
1
print
(
'Generating bounding box'
)
...
...
@@ -167,13 +167,15 @@ self.GetOutput().ShallowCopy(ap.GetOutput())
paramprop
.
SetElement
(
4
,
'res'
)
paramprop
.
SetElement
(
5
,
str
(
resolution
))
gen
.
UpdateProperty
(
'Parameters'
)
genDisplay
=
Show
()
genDisplay
.
SetRepresentationType
(
'Surface'
)
if
color
:
print
(
'Assigning colors'
)
pidScale
=
ProcessIdScalars
()
pidScaleDisplay
=
Show
()
print
(
'Assigning colors'
)
pidScale
=
ProcessIdScalars
()
pidScaleDisplay
=
Show
()
pidScaleDisplay
.
SetRepresentationType
(
'Surface'
)
if
transparency
:
print
(
'Enabling 50% transparency'
)
pidScaleDisplay
.
Opacity
=
0.5
print
(
'Repositioning initial camera'
)
c
=
GetActiveCamera
()
...
...
@@ -220,7 +222,7 @@ self.GetOutput().ShallowCopy(ap.GetOutput())
'num_spheres_in_scene'
:
num_spheres_in_scene
,
'resolution'
:
resolution
,
'view_size'
:
view_size
,
'num_frames'
:
num_frames
,
'save_logs'
:
save_logs
,
'
color'
:
color
}))
'
transparency'
:
transparency
,
'ospray'
:
ospray
}))
# Save the memory statistics collected
with
open
(
output_basename
+
'.mem.txt'
,
'w'
)
as
ofile
:
...
...
@@ -230,7 +232,7 @@ self.GetOutput().ShallowCopy(ap.GetOutput())
logparser
.
summarize_results
(
num_frames
,
(
fpsT1
-
fpsT0
).
total_seconds
(),
num_polys
,
'Polys'
,
save_logs
,
output_basename
)
print
(
'Points / Frame:
'
,
num_points
)
print
(
'Points / Frame:
%d'
%
(
num_points
)
)
def
main
(
argv
):
...
...
@@ -250,9 +252,9 @@ def main(argv):
help
=
'View size used to render'
)
parser
.
add_argument
(
'-f'
,
'--frames'
,
default
=
10
,
type
=
int
,
help
=
'Number of frames'
)
parser
.
add_argument
(
'-
c
'
,
'--
color
'
,
action
=
'store_true'
,
help
=
'Enable
color renderings
'
)
parser
.
add_argument
(
'-y'
,
'--
OSPR
ay'
,
action
=
'store_true'
,
parser
.
add_argument
(
'-
t
'
,
'--
transparency
'
,
action
=
'store_true'
,
help
=
'Enable
transparency
'
)
parser
.
add_argument
(
'-y'
,
'--
ospr
ay'
,
action
=
'store_true'
,
help
=
'Use OSPRAY to render'
)
args
=
parser
.
parse_args
(
argv
)
...
...
@@ -269,8 +271,8 @@ def main(argv):
run
(
output_basename
=
args
.
output_basename
,
num_spheres
=
args
.
spheres
,
num_spheres_in_scene
=
args
.
spheres_in_scene
,
resolution
=
args
.
resolution
,
view_size
=
args
.
view_size
,
num_frames
=
args
.
frames
,
color
=
args
.
color
,
OSPRay
=
args
.
OSPR
ay
)
view_size
=
args
.
view_size
,
num_frames
=
args
.
frames
,
transparency
=
args
.
transparency
,
ospray
=
args
.
ospr
ay
)
if
__name__
==
"__main__"
:
import
sys
...
...
Wrapping/Python/paraview/benchmark/waveletcontour.py
View file @
f1cf7da2
import
datetime
as
dt
from
paraview
import
servermanager
from
paraview.simple
import
*
#
from paraview.benchmark import *
import
logbase
,
logparser
from
paraview.benchmark
import
*
#
import logbase, logparser
logbase
.
maximize_logs
()
records
=
[]
...
...
@@ -80,13 +80,13 @@ def memtime_stamp():
def
run
(
output_basename
=
'log'
,
dimension
=
100
,
view_size
=
(
1920
,
1080
),
num_frames
=
10
,
save_logs
=
True
,
color
=
False
,
OSPR
ay
=
False
):
num_frames
=
10
,
save_logs
=
True
,
transparency
=
False
,
ospr
ay
=
False
):
import
vtk
controller
=
vtk
.
vtkMultiProcessController
.
GetGlobalController
()
view
=
get_render_view
(
view_size
)
if
OSPR
ay
:
if
ospr
ay
:
view
.
EnableOSPRay
=
1
print
(
'Generating wavelet'
)
...
...
@@ -105,10 +105,12 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080),
contour
.
Isosurfaces
=
list
(
map
(
float
,
range
(
10
,
110
,
10
)))
contourDisplay
=
Show
()
contourDisplay
.
SetRepresentationType
(
'Surface'
)
ColorBy
(
contourDisplay
,
(
'POINTS'
,
'RTData'
))
contourDisplay
.
RescaleTransferFunctionToDataRange
(
True
,
False
)
if
color
:
ColorBy
(
contourDisplay
,
(
'POINTS'
,
'RTData'
)
)
contourDisplay
.
RescaleTransferFunctionToDataRange
(
True
,
False
)
if
transparency
:
print
(
'Enabling 50% transparency'
)
contourDisplay
.
Opacity
=
0.5
print
(
'Repositioning initial camera'
)
c
=
GetActiveCamera
()
...
...
@@ -155,6 +157,8 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080),
'dimension'
:
dimension
,
'view_size'
:
view_size
,
'num_frames'
:
num_frames
,
'transparency'
:
transparency
,
'ospray'
:
ospray
,
'save_logs'
:
save_logs
}))
# Save the memory statistics collected
...
...
@@ -181,9 +185,9 @@ def main(argv):
help
=
'View size used to render'
)
parser
.
add_argument
(
'-f'
,
'--frames'
,
default
=
10
,
type
=
int
,
help
=
'Number of frames'
)
parser
.
add_argument
(
'-
c
'
,
'--
color
'
,
action
=
'store_true'
,
help
=
'Enable
color renderings
'
)
parser
.
add_argument
(
'-y'
,
'--
OSPR
ay'
,
action
=
'store_true'
,
parser
.
add_argument
(
'-
t
'
,
'--
transparency
'
,
action
=
'store_true'
,
help
=
'Enable
transparency
'
)
parser
.
add_argument
(
'-y'
,
'--
ospr
ay'
,
action
=
'store_true'
,
help
=
'Use OSPRAY to render'
)
args
=
parser
.
parse_args
(
argv
)
...
...
@@ -199,8 +203,8 @@ def main(argv):
Connect
(
m
.
group
(
2
))
run
(
output_basename
=
args
.
output_basename
,
dimension
=
args
.
dimension
,
view_size
=
args
.
view_size
,
num_frames
=
args
.
frames
,
color
=
args
.
color
,
OSPRay
=
args
.
OSPR
ay
)
view_size
=
args
.
view_size
,
num_frames
=
args
.
frames
,
transparency
=
args
.
transparency
,
ospray
=
args
.
ospr
ay
)
if
__name__
==
"__main__"
:
import
sys
...
...
Wrapping/Python/paraview/benchmark/waveletvolume.py
View file @
f1cf7da2
import
datetime
as
dt
from
paraview
import
servermanager
from
paraview.simple
import
*
#
from paraview.benchmark import *
import
logbase
,
logparser
from
paraview.benchmark
import
*
#
import logbase, logparser
logbase
.
maximize_logs
()
records
=
[]
...
...
@@ -80,13 +80,13 @@ def memtime_stamp():
def
run
(
output_basename
=
'log'
,
dimension
=
100
,
view_size
=
(
1920
,
1080
),
num_frames
=
10
,
save_logs
=
True
,
OSPR
ay
=
False
):
num_frames
=
10
,
save_logs
=
True
,
ospr
ay
=
False
):
import
vtk
controller
=
vtk
.
vtkMultiProcessController
.
GetGlobalController
()
view
=
get_render_view
(
view_size
)
if
OSPR
ay
:
if
ospr
ay
:
view
.
EnableOSPRay
=
1
print
(
'Generating wavelet'
)
...
...
@@ -140,6 +140,7 @@ def run(output_basename='log', dimension=100, view_size=(1920, 1080),
'dimension'
:
dimension
,
'view_size'
:
view_size
,
'num_frames'
:
num_frames
,
'ospray'
:
ospray
,
'save_logs'
:
save_logs
}))
# Save the memory statistics collected
...
...
@@ -165,7 +166,7 @@ def main(argv):
help
=
'View size used to render'
)
parser
.
add_argument
(
'-f'
,
'--frames'
,
default
=
10
,
type
=
int
,
help
=
'Number of frames'
)
parser
.
add_argument
(
'-y'
,
'--
OSPR
ay'
,
action
=
'store_true'
,
parser
.
add_argument
(
'-y'
,
'--
ospr
ay'
,
action
=
'store_true'
,
help
=
'Use OSPRAY to render'
)
args
=
parser
.
parse_args
(
argv
)
...
...
@@ -181,7 +182,7 @@ def main(argv):
Connect
(
m
.
group
(
2
))
run
(
output_basename
=
args
.
output_basename
,
dimension
=
args
.
dimension
,
view_size
=
args
.
view_size
,
num_frames
=
args
.
frames
,
OSPR
ay
=
args
.
OSPR
ay
)
view_size
=
args
.
view_size
,
num_frames
=
args
.
frames
,
ospr
ay
=
args
.
ospr
ay
)
if
__name__
==
"__main__"
:
import
sys
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment