Beispiel #1
0
def start_network_bench(bench):
    global hosts_state
    nb_hosts = bench['nb-hosts']
    msg = HM(HM.MODULE, HM.NETWORK, HM.START)
    msg.block_size = bench['block-size']
    msg.running_time = bench['runtime']
    msg.network_test = bench['mode']
    msg.network_connection = bench['connection']
    msg.ports_list = bench['port-list']
    bench['arity_groups'] = []
    arity_group = []
    used_hosts = []
    ip_list = {}

    while nb_hosts > 0:
        for hv in bench['hosts-list']:
            for host in bench['hosts-list'][hv]:
                if nb_hosts == 0:
                    break
                # We shall not use the same host twice
                if host in used_hosts:
                    continue
                used_hosts.append(host)
                arity_group.append(host)
                ip_list[host] = bench['ip-list'][host]
                nb_hosts = nb_hosts - 1
                if len(arity_group) == bench['arity']:
                    bench['arity_groups'].append(arity_group)
                    msg.peer_servers = ip_list.items()
                    for peer_server in arity_group:
                        if peer_server not in get_host_list(
                                NETWORK_RUN).keys():
                            msg.my_peer_name = bench['ip-list'][peer_server]
                            hosts_state[peer_server] |= NETWORK_RUN
                            lock_socket_list.acquire()
                            start_time(peer_server)
                            HP.send_hm_message(socket_list[peer_server], msg)
                            lock_socket_list.release()
                    arity_group = []
                    ip_list = {}
                # We shall break to switch to another hypervisor
                break
        if nb_hosts == 0:
            return
Beispiel #2
0
def start_memory_bench(bench):
    global hosts_state
    nb_hosts = bench['nb-hosts']
    msg = HM(HM.MODULE, HM.MEMORY, HM.START)
    msg.cpu_instances = bench['cores']
    msg.block_size = bench['block-size']
    msg.running_time = bench['runtime']
    msg.mode = bench['mode']

    for host in bench['hosts-list']:
        if nb_hosts == 0:
            break
        if host not in get_host_list(MEMORY_RUN).keys():
            hosts_state[host] |= MEMORY_RUN
            nb_hosts = nb_hosts - 1
            lock_socket_list.acquire()
            start_time(host)
            HP.send_hm_message(socket_list[host], msg)
            lock_socket_list.release()
Beispiel #3
0
def start_memory_bench(bench):
    global hosts_state
    nb_hosts = bench['nb-hosts']
    msg = HM(HM.MODULE, HM.MEMORY, HM.START)
    msg.cpu_instances = bench['cores']
    msg.block_size = bench['block-size']
    msg.running_time = bench['runtime']
    msg.parallel_mode = bench['mode']

    for host in bench['hosts-list']:
        if nb_hosts == 0:
            break
        if host not in get_host_list(MEMORY_RUN).keys():
            hosts_state[host] |= MEMORY_RUN
            nb_hosts = nb_hosts - 1
            lock_socket_list.acquire()
            start_time(host)
            HP.send_hm_message(socket_list[host], msg)
            lock_socket_list.release()
Beispiel #4
0
def start_network_bench(bench):
    global hosts_state
    nb_hosts = bench['nb-hosts']
    msg = HM(HM.MODULE, HM.NETWORK, HM.START)
    msg.block_size = bench['block-size']
    msg.running_time = bench['runtime']
    msg.network_test = bench['mode']
    msg.network_connection = bench['connection']
    msg.ports_list = bench['port-list']
    bench['arity_groups'] = []
    arity_group = []
    used_hosts = []
    ip_list = {}

    while nb_hosts > 0:
        for hv in bench['hosts-list']:
            for host in bench['hosts-list'][hv]:
                if nb_hosts == 0:
                    break
                # We shall not use the same host twice
                if host in used_hosts:
                    continue
                used_hosts.append(host)
                arity_group.append(host)
                ip_list[host] = bench['ip-list'][host]
                nb_hosts = nb_hosts - 1
                if len(arity_group) == bench['arity']:
                    bench['arity_groups'].append(arity_group)
                    msg.peer_servers = ip_list.items()
                    for peer_server in arity_group:
                        if peer_server not in get_host_list(NETWORK_RUN).keys():
                            msg.my_peer_name = bench['ip-list'][peer_server]
                            hosts_state[peer_server] |= NETWORK_RUN
                            lock_socket_list.acquire()
                            start_time(peer_server)
                            HP.send_hm_message(socket_list[peer_server], msg)
                            lock_socket_list.release()
                    arity_group = []
                    ip_list = {}
                # We shall break to switch to another hypervisor
                break
        if nb_hosts == 0:
            return
Beispiel #5
0
def start_storage_bench(bench):
    global hosts_state
    nb_hosts = bench['nb-hosts']
    msg = HM(HM.MODULE, HM.STORAGE, HM.START)
    msg.block_size = bench['block-size']
    msg.access = bench['access']
    msg.running_time = bench['runtime']
    msg.mode = bench['mode']
    msg.device = bench['device']
    msg.rampup_time = bench['rampup-time']

    for host in bench['hosts-list']:
        if nb_hosts == 0:
            break
        if host not in get_host_list(STORAGE_RUN).keys():
            hosts_state[host] |= STORAGE_RUN
            nb_hosts = nb_hosts - 1
            lock_socket_list.acquire()
            start_time(host)
            HP.send_hm_message(socket_list[host], msg)
            lock_socket_list.release()
Beispiel #6
0
def start_storage_bench(bench):
    global hosts_state
    nb_hosts = bench['nb-hosts']
    msg = HM(HM.MODULE, HM.STORAGE, HM.START)
    msg.block_size = bench['block-size']
    msg.access = bench['access']
    msg.running_time = bench['runtime']
    msg.mode = bench['mode']
    msg.device = bench['device']
    msg.rampup_time = bench['rampup-time']

    for host in bench['hosts-list']:
        if nb_hosts == 0:
            break
        if host not in get_host_list(STORAGE_RUN).keys():
            hosts_state[host] |= STORAGE_RUN
            nb_hosts = nb_hosts - 1
            lock_socket_list.acquire()
            start_time(host)
            HP.send_hm_message(socket_list[host], msg)
            lock_socket_list.release()