예제 #1
0
def processRecord(event, indexes, force, disp):
    global verbose
    e = json.loads(event)
    if 'verbose' in e and e['verbose'] == 'true':
        verbose = True
    if 'parallel' in e:
        info('Calculating parallelization values')
        p = e['parallel']
        if p['node'] == 1:
            sIndex = 0
            info('First node. Setting sIndex to 0')
        else:
            sIndex = libtaylor.magic(e['reps'], p['node'], p['nodes'])
            info('sIndex set to ' + str(sIndex))
        if p['node'] == p['nodes']:
            # if it's the last node in the node set, then the end is the last index
            eIndex = e['digits']**e['reps']
            info('Last node. eIndex set to ' + str(eIndex))
        else:
            eIndex = libtaylor.magic(e['reps'], p['node'] + 1, p['nodes'])
            info('eIndex set to ' + str(eIndex))
        if sIndex == eIndex:
            eIndex = eIndex + 1
    else:
        if 'start' in e:
            sIndex = e['start']
        else:
            sIndex = 0
        if 'end' in e:
            eIndex = e['end']
        else:
            eIndex = e['digits']**e['reps']
    info("sIndex=" + str(sIndex))
    info("eIndex=" + str(eIndex))

    libtaylor.main(e, sIndex, eIndex, indexes, force, disp)
예제 #2
0
def processRecord(event, indexes, force, disp):
	global verbose
	e = json.loads(event)
	if 'verbose' in e and e['verbose'] == 'true':
		verbose = True
	if 'parallel' in e:
		info('Calculating parallelization values')
		p = e['parallel']
		if p['node'] == 1:
			sIndex = 0
			info('First node. Setting sIndex to 0')
		else:
			sIndex = libtaylor.magic(e['reps'], p['node'], p['nodes'])
			info('sIndex set to ' + str(sIndex))
		if p['node'] == p['nodes']:
			# if it's the last node in the node set, then the end is the last index
			eIndex = e['digits']**e['reps']
			info('Last node. eIndex set to ' + str(eIndex))
		else:
			eIndex = libtaylor.magic(e['reps'], p['node']+1, p['nodes'])
			info('eIndex set to ' + str(eIndex))
		if sIndex == eIndex:
			eIndex = eIndex + 1
	else:
		if 'start' in e:
			sIndex=e['start']
		else:
			sIndex=0
		if 'end' in e:
			eIndex=e['end']
		else:
			eIndex=e['digits']**e['reps']
	info("sIndex="+str(sIndex))
	info("eIndex="+str(eIndex))

	libtaylor.main(e, sIndex, eIndex, indexes, force, disp)
예제 #3
0
#   and number of nodes
if args.parallel:
    if args.verbose and not args.silent:
        print 'Calculating parallelization values'
    p = args.parallel.split(":")
    if len(p) != 2:
        print "Error: Parameter not formatted properly: " + args.parallel
        print "Is your start/end node list properly formatted as '(start):(end)'?"
        exit(1)
    if int(p[0]) == 1:
        # If it's the first node in the node set, then the start index is 0
        sIndex = 0
        if args.verbose and not args.silent:
            print 'First node. Setting sIndex to 0'
    else:
        sIndex = libtaylor.magic(args.reps, int(p[0]), int(p[1]))
        if args.verbose and not args.silent:
            print 'sIndex set to ' + str(sIndex)
    if int(p[0]) == int(p[1]):
        # if it's the last node in the node set, then the end is the last index
        eIndex = args.digits**args.reps
        if args.verbose and not args.silent:
            print 'Last node. eIndex set to ' + str(eIndex)
    else:
        eIndex = libtaylor.magic(args.reps, int(p[0]) + 1, int(p[1]))
        if args.verbose and not args.silent:
            print 'eIndex set to ' + str(eIndex)

    if sIndex == eIndex:
        eIndex = eIndex + 1
else:
예제 #4
0
#   and number of nodes
if args.parallel:
	if args.verbose and not args.silent:
		print 'Calculating parallelization values'
	p = args.parallel.split(":");
	if len(p) != 2:
		print "Error: Parameter not formatted properly: " + args.parallel
		print "Is your start/end node list properly formatted as '(start):(end)'?"
		exit(1)
	if int(p[0]) == 1:
		# If it's the first node in the node set, then the start index is 0
		sIndex = 0
		if args.verbose and not args.silent:
			print 'First node. Setting sIndex to 0'
	else:
		sIndex = libtaylor.magic(args.reps, int(p[0]), int(p[1]))
		if args.verbose and not args.silent:
			print 'sIndex set to ' + str(sIndex)
	if int(p[0]) == int(p[1]):
		# if it's the last node in the node set, then the end is the last index
		eIndex = args.digits**args.reps
		if args.verbose and not args.silent:
			print 'Last node. eIndex set to ' + str(eIndex)
	else:
		eIndex = libtaylor.magic(args.reps, int(p[0])+1, int(p[1]))
		if args.verbose and not args.silent:
			print 'eIndex set to ' + str(eIndex)

	if sIndex == eIndex:
		eIndex = eIndex + 1
else: