Skip to content

Instantly share code, notes, and snippets.

@rom1504
Last active August 7, 2023 02:03
Show Gist options
  • Save rom1504/8d66fe0f73de181bb45f0698045cc937 to your computer and use it in GitHub Desktop.
Save rom1504/8d66fe0f73de181bb45f0698045cc937 to your computer and use it in GitHub Desktop.
does_it_freeze.py
import wandb
import os
import numpy as np
import time
from os import listdir
import uuid
import sys
path = "/fsx/home-rom1504/"
def get_time():
d = np.random.rand(10**3,10**3)
i = time.time()
file_name = str(uuid.uuid4()) + ".npy"
np.save(path + file_name, d)
t = time.time()
duration_write = t - i
l = list(listdir(path))
tt = time.time()
duration_list = tt - t
d = np.load(path + file_name)
t2 = time.time()
duration_read = t2 - tt
os.remove(path + file_name)
return {"duration_read":duration_read, "duration_write": duration_write, "duration_list": duration_list}
def logger():
wandb.init(project="does_it_freeze", id=sys.argv[1], resume="allow")
while 1:
wandb.log(get_time())
time.sleep(10)
logger()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment