Example #1
0
def threadFunction():

    # check the meta periodically
    addrList = metaclient.getServerAddr()
    addr = addrList[0]

    # if the value is not NULL

    while (1):
        value = metaclient.getMeta(addr, "simend")
        if (value == "NULL"):
            time.sleep(0.1)
            continue
        else:
            break

    endsim = timeit.default_timer()
    print("sim end, stop the ana")
    os._exit(0)
Example #2
0
def threadFunction():

    # check the meta periodically
    addrList = metaclient.getServerAddr()
    addr = addrList[0]

    # if the value is not NULL

    while (1):
        value = metaclient.getMeta(addr, "FINISH")
        if (value == "NULL"):
            time.sleep(0.1)
            continue
        else:
            break

    print("sim is finish, stop")
    print("prepare time: ", prepareTime)
    print("actual work time: ", actualworkTime)
    os._exit(0)
Example #3
0
def threadFunction():

    # check the meta periodically
    addrList = metaclient.getServerAddr()
    addr = addrList[0]

    # if the value is not NULL

    while (1):
        value = metaclient.getMeta(addr, "meaningless")
        if (value == "NULL"):
            time.sleep(0.1)
            continue
        else:
            break

    endsim = timeit.default_timer()
    print("data is becoming meaningless, time span")
    print(endsim - startsim)
    metaclient.putMeta(addr, "simend", "simendInfo")
    os._exit(0)
Example #4
0
def threadCheckFinish():

    # check if there is finish meta data
    addrList = metaclient.getServerAddr()
    addr = addrList[0]

    while (1):
        value = metaclient.getMeta(addr, "FINISH")
        if (value == "NULL"):
            print("not finish")
            time.sleep(0.5)
            continue
        else:
            print("sim finish")
            while (1):
                if (runningTask == 0):
                    metaclient.Recordtimetick(addr, "TOTAL")
                    os._exit(0)
                else:
                    time.sleep(0.1)
                    print("running task ", runningTask)
                    continue
Example #5
0
from mpi4py import MPI
import dataspaces.dataspaceClient as dataspaces


import sys
# insert pubsub and detect the things after every iteration
sys.path.append('../../../src/publishclient/pythonclient')
import pubsub as pubsubclient
import timeit

sys.path.append('../../../src/metadatamanagement/pythonclient')
import metaclient



addrList=metaclient.getServerAddr()
addr = addrList[0]
metaclient.Recordtimestart(addr, "TIMET")


startsim = timeit.default_timer()

comm = MPI.COMM_WORLD
rank = comm.Get_rank()




# init dataspace client

# copy all conf.* file to current dir