import time
import random

print "--SELFTEST-- loading test"

max = 40

def payload1(id):
	print "--STEPTEST-- payload1 start"

	time.sleep(random.randint(1, 5))

	b = job.barrier('127.0.0.1#P%d' % (id), 'here', 60)
	b.rendezvous(*us)

	print "--STEPTEST-- payload1 complete"

us = []
jobs = []
for n in range(1, max+1):
	us.append('127.0.0.1#P%d' % (n))
	jobs.append([payload1, n])

job.parallel(*jobs)