Beispiel #1
0
def example_1():
    """Square some numbers on remote hosts!
    """
    with cfut.CondorExecutor(True) as executor:
        futures = [executor.submit(square, n) for n in range(5)]
        for future in concurrent.futures.as_completed(futures):
            print future.result()
Beispiel #2
0
def example_2():
    """Get host identifying information about the servers running
    our jobs.
    """
    with cfut.CondorExecutor(False) as executor:
        futures = [executor.submit(hostinfo) for n in range(5)]
        for future in concurrent.futures.as_completed(futures):
            print future.result().strip()
Beispiel #3
0
def example_3():
    """Demonstrates the use of the map() convenience function.
    """
    exc = cfut.CondorExecutor(False)
    print list(cfut.map(exc, square, [5, 7, 11]))