Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xdmf
Xdmf
Commits
0382f139
Commit
0382f139
authored
Feb 22, 2013
by
Andrew J. Burns (Cont
Browse files
File splitting optimized more
parent
4084f4e6
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
core/XdmfHDF5Writer.cpp
View file @
0382f139
This diff is collapsed.
Click to expand it.
tests/Python/SplitTime.py
0 → 100644
View file @
0382f139
import
Xdmf
import
timeit
import
os
import
time
numberArrays
=
10000
arraySize
=
10000
class
TimedWrite
():
def
__init__
(
self
):
self
.
domain
=
Xdmf
.
XdmfDomain
.
New
()
grid
=
Xdmf
.
XdmfUnstructuredGrid
.
New
()
self
.
domain
.
insert
(
grid
)
for
i
in
range
(
0
,
numberArrays
):
attribute
=
Xdmf
.
XdmfAttribute
.
New
()
attribute
.
resizeAsFloat64
(
arraySize
)
grid
.
insert
(
attribute
)
hdf5Writer
=
Xdmf
.
XdmfHDF5Writer
.
New
(
"/usr/var/tmp/ajburns/timing.h5"
)
hdf5Writer
.
setFileSizeLimit
(
10000
)
self
.
writer
=
Xdmf
.
XdmfWriter
.
New
(
"/usr/var/tmp/ajburns/timing.xmf"
,
hdf5Writer
)
self
.
writer
.
setLightDataLimit
(
10
)
def
write
(
self
):
self
.
domain
.
accept
(
self
.
writer
)
if
__name__
==
"__main__"
:
timedWrite
=
TimedWrite
()
startclock
=
time
.
clock
()
print
timeit
.
Timer
(
timedWrite
.
write
).
timeit
(
1
)
print
(
time
.
clock
()
-
startclock
)
os
.
remove
(
"/usr/var/tmp/ajburns/timing.xmf"
)
os
.
remove
(
"/usr/var/tmp/ajburns/timing.h5"
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment