Ejemplo n.º 1
0
def threadfuction(clusterServer, to1, to2, nenner, zaehler):

    counter = to2

    while counter <= to1:
        nennermodulo = ClusterAPI.execute(clusterServer,
                                          str(nenner) + "%" + str(zaehler), 0)
Ejemplo n.º 2
0
def callmethodUI():
    print("Which nodes callmethod do you want to change? (0 = all)")
    node = int(input("> "))
    print("What callmethod should be used? (c++ / python)")
    method = input("> ")

    if node == 0:
        result = ClusterAPI.setCallmethodAll(method)
    elif node <= ClusterAPI.getClusterLenght() and node > 0:
        result = ClusterAPI.setCallmethod(node - 1, method)
    else:
        print("Invalid node")

    if result == True:
        print(">> Done")
    else:
        print(">> Error: Server denied")
Ejemplo n.º 3
0
def callmethodUI():
    print("Which nodes callmethod do you want to change? (0 = all)")
    node = int(input("> "))
    print("What callmethod should be used? (c++ / python)")
    method = input("> ")
    
    if node == 0:
        result = ClusterAPI.setCallmethodAll(method)
    elif node <= ClusterAPI.getClusterLenght() and node > 0:
        result = ClusterAPI.setCallmethod(node - 1, method)
    else:
        print("Invalid node")

    if result == True:
        print(">> Done")
    else:
        print(">> Error: Server denied")
Ejemplo n.º 4
0
def shorten(zaehler, nenner):

    clusterLenght = ClusterAPI.getClusterLenght()

    counter = 1

    while counter <= clusterLenght:

        to1 = clusterLenght / counter
        to2 = clusterLenght / (counter - 1)
        _thread.start_new_thread(threadfunction, (clusterServer, to1, to2))
Ejemplo n.º 5
0
def shorten(zaehler, nenner):

    clusterLenght =  ClusterAPI.getClusterLenght()

    counter = 1

    while counter <= clusterLenght:

        to1 = clusterLenght / counter
        to2 = clusterLenght / (counter - 1)
        _thread.start_new_thread(threadfunction, (clusterServer, to1, to2))
Ejemplo n.º 6
0
def start():
    if ClusterAPI.clustercheck != False:

        clusterLenght = ClusterAPI.getClusterLenght()

        counter = 1

        while counter <= clusterLenght:
            _thread.start_new_thread(bfl, (counter, "x"))
            counter += 1

        print("Calculating. Please wait.")

    else:

        print("Theres something wrong with your cluster configuration. Check it with *clustercheck*")
Ejemplo n.º 7
0
def start():
    if (ClusterAPI.clustercheck != False):

        clusterLenght = ClusterAPI.getClusterLenght()

        counter = 1

        while counter <= clusterLenght:
            _thread.start_new_thread(bfl, (counter, "x"))
            counter += 1

        print("Calculating. Please wait.")

    else:

        print(
            "Theres something wrong with your cluster configuration. Check it with *clustercheck*"
        )
Ejemplo n.º 8
0
def bfl(counter, x):
    multiplicator = 99
    command = str(multiplicator) + " ** (" + str(multiplicator) + " + " + str(
        counter) + ")"
    print(ClusterAPI.execute(counter, command, 1))
    print("\n")
Ejemplo n.º 9
0
def calc(clServer, formula):
    orig = clServer
    if (clServer > ClusterAPI.getClusterLenght()):
        clServer = ClusterAPI.getClusterLenght()
    result = ClusterAPI.execute(clServer, str(formula), 0)
    results[orig - 1] = result
Ejemplo n.º 10
0
def bfl(counter, x):
    multiplicator = 99
    command = str(multiplicator) + " ** (" + str(multiplicator) + " + " + str(counter) + ")"
    print(ClusterAPI.execute(counter, command, 1))
    print("\n")
Ejemplo n.º 11
0
def threadfuction(clusterServer, to1, to2, nenner, zaehler):

    counter = to2

    while counter <= to1:
        nennermodulo = ClusterAPI.execute(clusterServer, str(nenner) + "%" + str(zaehler), 0)