simple render time extraction script

metadata
Wenzel Jakob 2014-04-14 23:54:07 +02:00
parent 2cb71227ef
commit 7ab0ff3533
3 changed files with 41 additions and 3 deletions

View File

@ -0,0 +1,37 @@
import subprocess, sys, re
if len(sys.argv) == 1:
print('rendertime.py: Simple utility to extract the rendering time of an EXR file created using Mitsuba')
print('Syntax: rendertime.py <one or more EXR files>')
for arg in sys.argv[1:]:
sys.stdout.write("%s: " % arg)
p = subprocess.Popen(["exrheader", arg], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
matches = re.findall('Render time: ([^\n]*)', p.communicate()[0])
if len(matches) != 1:
sys.stdout.write('error reading metadata!\n')
continue
value = matches[0]
units = [
['d', 60*60*24],
['h', 60*60],
['m', 60],
['s', 1]
];
for unit in units:
if value[-1] == unit[0]:
value = float(value[0:-1]) * unit[1]
break
force = False
for unit in units:
if value > unit[1] or force:
amount = int(value / unit[1])
value -= amount * unit[1]
force = True
sys.stdout.write('%i%s ' % (amount, unit[0]))
sys.stdout.write('\n')

View File

@ -30,7 +30,7 @@
#endif #endif
/// Activate lots of extra checks /// Activate lots of extra checks
// #define MTS_KD_DEBUG 1 #define MTS_KD_DEBUG 1
/** Compile-time KD-tree depth limit. Allows to put certain /** Compile-time KD-tree depth limit. Allows to put certain
data structures on the stack */ data structures on the stack */
@ -2449,9 +2449,9 @@ protected:
for (SizeType i=0; i<m_primCount; ++i) { for (SizeType i=0; i<m_primCount; ++i) {
const AABBType aabb = derived->getAABB(indices[i]); const AABBType aabb = derived->getAABB(indices[i]);
for (int axis=0; axis<PointType::dim; ++axis) { for (int axis=0; axis<PointType::dim; ++axis) {
int64_t minIdx = (int64_t) ((aabb.min[axis] - m_aabb.min[axis]) int64_t minIdx = (int64_t) (((float) aabb.min[axis] - (float) m_aabb.min[axis])
* m_invBinSize[axis]); * m_invBinSize[axis]);
int64_t maxIdx = (int64_t) ((aabb.max[axis] - m_aabb.min[axis]) int64_t maxIdx = (int64_t) (((float) aabb.max[axis] - (float) m_aabb.min[axis])
* m_invBinSize[axis]); * m_invBinSize[axis]);
m_maxBins[axis * m_binCount m_maxBins[axis * m_binCount
+ std::max((int64_t) 0, std::min(maxIdx, maxBin))]++; + std::max((int64_t) 0, std::min(maxIdx, maxBin))]++;

View File

@ -9,5 +9,6 @@ plugins += env.SharedLibrary('thinlens', ['thinlens.cpp'])
plugins += env.SharedLibrary('orthographic', ['orthographic.cpp']) plugins += env.SharedLibrary('orthographic', ['orthographic.cpp'])
plugins += env.SharedLibrary('telecentric', ['telecentric.cpp']) plugins += env.SharedLibrary('telecentric', ['telecentric.cpp'])
plugins += env.SharedLibrary('spherical', ['spherical.cpp']) plugins += env.SharedLibrary('spherical', ['spherical.cpp'])
plugins += env.SharedLibrary('fisheye', ['fisheye.cpp'])
Export('plugins') Export('plugins')