资源简介
Torque集群是由一个管理点和多个计算节点组成。管理节点运行pbs_server进程,计算节点运行pbs_mom进程。用于提交和管理作业的客户端命令可以安装在任何主机上(包括不运行pbsserver或pbsmom的主机)。
代码片段和文件信息
#!/usr/bin/env python
import sys
import os
import glob
import subprocess
def remove_build_dirs(the_list):
dot_dirs = [‘.svn‘ ‘.deps‘ ‘.libs‘]
for f in dot_dirs:
try:
the_list.remove(f)
except ValueError:
pass
return the_list
def get_testdirs(dir):
flist = os.listdir(dir)
tmp_list = flist[:]
tmp_list = remove_build_dirs(tmp_list)
for f in flist:
check_val = dir
check_val += “/“
check_val += f
if os.path.isdir(check_val) != True:
try:
tmp_list.remove(f)
except ValueError:
pass
return tmp_list
def merge_lists(orig_list path new_list):
for item in new_list:
new_item = item
if path != None:
new_item = path
new_item += “/“
new_item += item
if orig_list == None:
orig_list = [new_item]
else:
orig_list.append(new_item)
def add_c_file_list(dir src_list):
path = dir
path += “/*.c“
list = glob.glob(path)
merge_lists(src_list None list)
def get_data(dir dir_list src_list):
flist = os.listdir(dir)
tmp_list = flist[:]
tmp_list = remove_build_dirs(tmp_list)
for f in flist:
check_val = dir
check_val += “/“
check_val += f
if os.path.isdir(check_val) != True:
try:
tmp_list.remove(f)
except ValueError:
pass
if tmp_list == None:
return None
for pos in range(len(tmp_list)):
tmp_dir = dir
tmp_dir += “/“
tmp_dir += tmp_list[pos]
if “test“ in tmp_list[pos]:
add_c_file_list(dir src_list)
tmp_entries = get_testdirs(tmp_dir)
if tmp_entries != None:
test_dir_list = merge_lists(dir_list tmp_dir tmp_entries)
else:
tmp_entries = get_data(tmp_dir dir_list src_list)
if tmp_entries != None:
test_dir_list = merge_lists(dir_list None tmp_entries)
# Return a list of directores in the unit test directory each directory representing a src file
def generate_data(dir dir_list src_list):
get_data(dir dir_list src_list)
return
# Get a full directory list and a working copy to prune
flist = os.listdir(dir)
worklist = flist[:]
# Get rid of non-directories
for f in flist:
if os.path.isdir(f) != True:
try:
worklist.remove(f)
except ValueError:
pass
worklist = remove_extra_test(worklist)
flist = []
for f in worklist:
flist.append(“../“ + f + “.c“)
return flist
def remove_extra_test(list):
# Get rid of known overhead directories
extras = [‘autom4te.cache‘ ‘m4‘]
for f in extras:
try:
list.remove(f)
except ValueError:
pass
return list
def generate_harness_line_counts(list ext):
counts = {}
for f in list:
x_files = f
x_files += ext
cmd = “wc -l “ + x_files
p = subprocess.Popen(cmd shell=True stdout=subprocess.PIPE stderr=subprocess.PIPE)
output errors = p.communicate()
item = output.split()
# only process lines that hav
评论
共有 条评论