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

    counter = to2

    while counter <= to1:
        nennermodulo = ClusterAPI.execute(clusterServer,
                                          str(nenner) + "%" + str(zaehler), 0)
Esempio 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")
Esempio 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")
Esempio 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))
Esempio 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))
Esempio 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*")
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*"
        )
def bfl(counter, x):
    multiplicator = 99
    command = str(multiplicator) + " ** (" + str(multiplicator) + " + " + str(
        counter) + ")"
    print(ClusterAPI.execute(counter, command, 1))
    print("\n")
Esempio 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
Esempio n. 10
0
def bfl(counter, x):
    multiplicator = 99
    command = str(multiplicator) + " ** (" + str(multiplicator) + " + " + str(counter) + ")"
    print(ClusterAPI.execute(counter, command, 1))
    print("\n")
Esempio n. 11
0
def threadfuction(clusterServer, to1, to2, nenner, zaehler):

    counter = to2

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