summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraas <andras.horvath@gmail.com>2013-10-07 13:56:43 -0700
committerraas <andras.horvath@gmail.com>2013-10-07 13:56:43 -0700
commite46cfd9faa2f9c86836de5ccf8e924266da7c526 (patch)
treea1fdb8b439a97c21c2eddc1eb39c21b883038915
parent93a74f64ce6e30e940ebbf456bf35679bca8d668 (diff)
parentc2f7676d12a6d591d774ecdfa51e7fdbb62fe4e0 (diff)
Merge pull request #1 from jmslocum/master
Version 1.3 mbw
-rw-r--r--README1
-rw-r--r--mbw.c12
-rw-r--r--mbw.spec6
3 files changed, 14 insertions, 5 deletions
diff --git a/README b/README
index 0c6f722..218fd8b 100644
--- a/README
+++ b/README
@@ -1,6 +1,7 @@
MBW determines the "copy" memory bandwidth available to userspace programs. Its simplistic approach models that of real applications. It is not tuned to extremes and it is not aware of hardware architecture, just like your average software package.
2006, 2012 Andras.Horvath atnospam gmail.com
+2013 j.m.slocum atnospam gmail.com
http://github.com/raas/mbw
diff --git a/mbw.c b/mbw.c
index 3a02826..6251ea9 100644
--- a/mbw.c
+++ b/mbw.c
@@ -27,6 +27,8 @@
* MBW memory bandwidth benchmark
*
* 2006, 2012 Andras.Horvath@gmail.com
+ * 2013 j.m.slocum@gmail.com
+ * (Special thanks to Stephen Pasich)
*
* http://github.com/raas/mbw
*
@@ -105,12 +107,14 @@ double worker(unsigned long long asize, long *a, long *b, int type, unsigned lon
/* timer stops */
gettimeofday(&endtime, NULL);
} else if(type==2) { /* memcpy block test */
+ char* aa = (char*)a;
+ char* bb = (char*)b;
gettimeofday(&starttime, NULL);
- for(t=0; t<array_bytes; t+=block_size) {
- b=mempcpy(b, a, block_size);
+ for (t=array_bytes; t >= block_size; t-=block_size, aa+=block_size){
+ bb=mempcpy(bb, aa, block_size);
}
- if(t>array_bytes) {
- b=mempcpy(b, a, t-array_bytes);
+ if(t) {
+ bb=mempcpy(bb, aa, t);
}
gettimeofday(&endtime, NULL);
} else { /* dumb test */
diff --git a/mbw.spec b/mbw.spec
index e3a0dd6..8481f97 100644
--- a/mbw.spec
+++ b/mbw.spec
@@ -1,6 +1,6 @@
Summary: Memory bandwidth benchmark
Name: mbw
-Version: 1.2
+Version: 1.3
Release: 1
License: LGPL
Buildroot: %{_tmppath}/%{name}-buildroot
@@ -33,6 +33,10 @@ rm -rf %{buildroot}
%{_mandir}/man1/mbw.1.gz
%changelog
+* Thu Oct 03 2013 James Slocum <j.m.slocum@gmail.com> 1.3-1
+- Fix MCBLOCK test: copy from the full source buffer, not just its first $blocksize.
+- Fix MCBLOCK test: fixed segfault caused by for() going out of bounds
+
* Sun Mar 11 2012 Andras Horvath <andras.horvath@gmail.com> 1.2-1
- Fix MCBLOCK test: actually copy to the full buffer, not just its first $blocksize.