1import time 2import random 3 4print "--SELFTEST-- loading test" 5 6max = 20 7 8def payload1(id): 9 print "--STEPTEST-- payload1 start" 10 11 time.sleep(random.randint(1, 5)) 12 13 b = job.barrier('127.0.0.1#P%d' % (id), 'here', 60) 14 b.rendezvous(*us) 15 16 print "--STEPTEST-- payload1 complete" 17 18us = [] 19jobs = [] 20for n in range(1, max+1): 21 us.append('127.0.0.1#P%d' % (n)) 22 jobs.append([payload1, n]) 23 24job.parallel(*jobs) 25