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
|
''' Testing bash apps
'''
import argparse
import time
import parsl
from parsl import python_app
from parsl.tests.configs.local_threads import config
local_config = config
@python_app
def increment(x):
return x + 1
def test_stress(count=1000):
"""Threaded app launch stress test"""
start = time.time()
x = {}
for i in range(count):
x[i] = increment(i)
end = time.time()
print("Launched {0} tasks in {1} s".format(count, end - start))
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--count", default="100",
help="width of the pipeline")
parser.add_argument("-d", "--debug", action='store_true',
help="Count of apps to launch")
args = parser.parse_args()
if args.debug:
parsl.set_stream_logger()
test_stress(count=int(args.count))
|