예제 #1
0
def run(customer_list):

	# Sort the customers by arrival time
	customer_list.sort(key=lambda tup: tup[0]);

	customers = []

	for (time, customer) in customer_list:
		customers.append(customer)

	successful_customers = flow.run(customers)

	licenses = []

	for customer in successful_customers:
		licenses.append(customer.uae_license)

	return licenses
예제 #2
0
def vc_relax(job):
    converged = False
    for e_cut in [160, 40, 60, 80, 100, 150, 200, 250, 300, 400, 500]:
        print('Attempting ecut={}'.format(e_cut))
        infile = create_infile(job, 'vc-relax', e_cut)
        cmd = '{} < {} > {}'.format(PWX, infile, job.fn('vc-relax.out'))
        subprocess.check_call(cmd, shell=True)
        with open(job.fn('vc-relax.out')) as outfile:
            for line in outfile:
                if (line.startwith('!')):
                    converged = True
                    break
        if (converged):
            job.document['ecut'] = e_cut
            break
    else:
        raise RuntimeError('Did not converge for ecut values!')


def scf(job):
    infile = create_infile(job, 'scf', job.document['ecut'])
    print(job.fn('scf.out'))
    subprocess.check_call('{} < {} > {}'.format(PWX, infile,
                                                job.fn('scf.out')),
                          shell=True)


if __name__ == "__main__":
    import flow
    flow.run()