-
Notifications
You must be signed in to change notification settings - Fork 2
/
run-test-pmfs.py
42 lines (37 loc) · 1.29 KB
/
run-test-pmfs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
#coding=utf-8
import time
import os
import sys
def do_work(filesize, filename):
i = 0
while i < 10:
os.system('./write_to_ram %s %s %s %s %s' %('PMFS', 'Posix-write', '0', filesize, filename))
# os.system('./mmap_to_ram %s %s %s %s %s' %('PMFS', 'Posix-mmap', '0', filesize, filename))
i += 1
i = 0
while i < 10:
# os.system('./run_nvp ./write_to_ram %s %s %s %s %s' %('PMFS', 'Quill', '0', filesize, filename))
# os.system('./run_nvp ./mmap_to_ram %s %s %s %s %s' %('PMFS', 'Quill-mmap', '0', filesize, filename))
i += 1
i = 0
while i < 10:
os.system('./read_from_ram %s %s %s %s %s' %('PMFS', 'Posix-read', '0', filesize, filename))
# os.system('./mmap_to_ram %s %s %s %s %s' %('PMFS', 'Posix-mmap', '0', filesize, filename))
i += 1
def main():
date = time.strftime("%Y-%m-%d_%X", time.localtime(time.time()))
filename = "./results/results_pmfs_" + date + ".csv"
filename = filename.replace(':', '-')
print filename
f = open(filename, 'w')
f.write("FS,Type,request_size,file_size,count,time (ns),Bandwidth (GB/s),Latency (ns)\n")
file.close(f)
# file_sizes = ['4194304', '134217728', '1073741824']
file_sizes = ['1G']
for filesize in file_sizes:
print "Performing test..."
do_work(filesize, filename)
time.sleep(1)
print "Test " + filename + " finished."
main()