Exemplo n.º 1
0
def _create_computer():
    tot_m, used_m, free_m = memory()
    tot_d, used_d, free_d = disk(ROOT_FOLDER)
    computer = Computer(name=socket.gethostname(),
                        gpu=len(GPUtil.getGPUs()),
                        cpu=cpu_count(),
                        memory=tot_m,
                        ip=IP,
                        port=PORT,
                        user=get_username(),
                        disk=tot_d,
                        root_folder=ROOT_FOLDER)
    ComputerProvider(_session).create_or_update(computer, 'name')
Exemplo n.º 2
0
def _create_computer():
    tot_m, used_m, free_m = memory()
    tot_d, used_d, free_d = disk(ROOT_FOLDER)
    computer = Computer(name=socket.gethostname(),
                        gpu=torch.cuda.device_count(),
                        cpu=cpu_count(),
                        memory=tot_m,
                        ip=IP,
                        port=PORT,
                        user=get_username(),
                        disk=tot_d,
                        root_folder=ROOT_FOLDER,
                        sync_with_this_computer=SYNC_WITH_THIS_COMPUTER,
                        can_process_tasks=CAN_PROCESS_TASKS)
    ComputerProvider(_session).create_or_update(computer, 'name')