1########################################################################## 2# Copyright (c) 2009, ETH Zurich. 3# All rights reserved. 4# 5# This file is distributed under the terms in the attached LICENSE file. 6# If you do not find this file, copies can be found by writing to: 7# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group. 8########################################################################## 9 10import re 11import os 12import tests 13from common import TestCommon 14from results import PassFailResult 15 16#module /acreto/x86_64/sbin/gm_pr spawnflags=2 /nfs/soc-LiveJournal1.bin 20 nfs://10.110.4.4/mnt/local/nfs/acreto/ 17 18@tests.add_test 19class GreenMarl_PageRank(TestCommon): 20 '''Green Marl: Page Rank Test''' 21 name = "GreenMarl_PageRank" 22 23 def get_modules(self, build, machine): 24 modules = super(GreenMarl_PageRank, self).get_modules(build, machine) 25 if 'SHL__NUM_CORES' in os.environ : 26 ncores = os.environ['SHL__NUM_CORES'] 27 else: 28 ncores = machine.get_ncores() 29 30 modules.add_module("gm_pr", ["spawnflags=2", 31 "/nfs/soc-LiveJournal1.bin", 32 ncores, 33 "nfs://10.110.4.4/mnt/local/nfs/acreto/"]) 34 35 modules.add_module("e1000n", ["auto", "noirq"]) 36 modules.add_module("NGD_mng", ["auto"]) 37 modules.add_module("netd", ["auto"]) 38 modules.add_module("/shl__settings.lua", ["nospawn"]) 39 return modules 40 41 def get_finish_string(self): 42 return "XXXXXXXXXX GM DONE XXXXXXXXXXXXXX" 43 44 def boot(self, *args): 45 super(GreenMarl_PageRank, self).boot(*args) 46# self.set_timeout(NFS_TIMEOUT) 47 48 def process_data(self, testdir, rawiter): 49 # the test passed iff the last line is the finish string 50 lastline = '' 51 passed = False; 52 for line in rawiter: 53 if line.startswith(self.get_finish_string()) : 54 passed = True; 55 break; 56 elif line.startswith("Aborted") : 57 passed = False; 58 break; 59 return PassFailResult(passed) 60 61 def process_data(self, testdir, rawiter): 62 passed = False 63 for line in rawiter: 64 if line.startswith(self.get_finish_string()): 65 passed = True 66 break 67 return PassFailResult(passed) 68 69@tests.add_test 70class GreenMarl_TriangleCounting(TestCommon): 71 '''Green Marl: Triangle Counting Test''' 72 name = "GreenMarl_TriangleCounting" 73 74 def get_modules(self, build, machine): 75 modules = super(GreenMarl_TriangleCounting, self).get_modules(build, machine) 76 # TODO: nfs location and number of cores... 77 modules.add_module("gm_pr", ["spawnflags=2", 78 "/nfs/soc-LiveJournal1.bin", 79 machine.get_ncores(), 80 "nfs://10.110.4.4/mnt/local/nfs/acreto/"]) 81 82 modules.add_module("e1000n", ["auto", "noirq"]) 83 modules.add_module("NGD_mng", ["auto"]) 84 modules.add_module("netd", ["auto"]) 85 86 return modules 87 88 def get_finish_string(self): 89 return "XXXXXXXXXX GM DONE XXXXXXXXXXXXXX" 90 91 def boot(self, *args): 92 super(GreenMarl_PageRank, self).boot(*args) 93 94 def process_data(self, testdir, rawiter): 95 # the test passed iff the last line is the finish string 96 lastline = '' 97 for line in rawiter: 98 lastline = line 99 passed = lastline.startswith(self.get_finish_string()) 100 return PassFailResult(passed)