Skip to content

Commit

Permalink
Merge pull request #32 from bengland2/issue-cleanup
Browse files Browse the repository at this point in the history
resolve issues 12 and 19
  • Loading branch information
bengland2 authored Nov 30, 2021
2 parents 72de4a4 + e332a8e commit e8d3224
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion fallocate.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def fallocate(fd, mode, offset, length):
elif sys.version.startswith('2'):
ret = os.write(fd, 'hi there')
else:
raise Exception('unrecognized python version %s' % sys.version)
print('unrecognized python version %s' % sys.version)
sys.exit(NOTOK)
assert ret == 8
os.close(fd)
print('SUCCESS')
6 changes: 3 additions & 3 deletions smallfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import errno
import codecs
from shutil import rmtree
from math import sqrt, log2
import math
from sync_files import ensure_dir_exists, ensure_deleted, write_sync_file, touch

OK = 0 # system call return code for success
Expand Down Expand Up @@ -503,7 +503,7 @@ def reset(self):
self.pause_sec = self.pause_between_files / self.MICROSEC_PER_SEC
# recalculate this to capture any changes in self.total_hosts and self.threads
self.total_threads = self.total_hosts * self.threads
self.throttling_factor = 0.1 * log2(self.total_threads + 1)
self.throttling_factor = 0.1 * math.log(self.total_threads + 1, 2)

# to measure per-thread elapsed time
self.start_time = None
Expand Down Expand Up @@ -1317,7 +1317,7 @@ def do_write(self, append=False, truncate=False):
raise SMFRunException('xattr module not present ' +
'but record-ctime-size specified')
if append and truncate:
raise Exception('can not append and truncate at the same time')
raise SMFRunException('can not append and truncate at the same time')

while self.do_another_file():
fn = self.mk_file_nm(self.src_dirs)
Expand Down

0 comments on commit e8d3224

Please sign in to comment.