def __init__(self, connection): self._hostname = base.get_hostname() self._scratch = base.get_scratch(self._hostname) self._tmpdir = self._scratch + "/" + str(uuid.uuid4()) self._xtbpath = { "bismuth": "/mnt/c/Users/guido/opt/xtb/6.2.2/bin/xtb", "alchemy": "/home/vonrudorff/opt/xtb/xtb_6.2.2/bin/xtb", "avl03": "/home/grudorff/opt/xtb/xtb_6.2.2/bin/xtb", "scicore": "/scicore/home/lilienfeld/rudorff/opt/xtb/xtb_6.2.2/bin/xtb", }[self._hostname] # grid scheme = quadpy.sphere.lebedev_031() self._OHgrid = scheme.points.copy() * 0.97 self._CHgrid = scheme.points.copy() * 1.09 self._environments = [] number_neighbors = ( 7 ) # self + six neighbors (in 3d, the highest coordination with octahedral symmetry) for point in range(len(scheme.points)): self._environments.append(([ _ for _ in np.argpartition( np.linalg.norm(scheme.points[point] - scheme.points, axis=1), number_neighbors, )[:number_neighbors] if _ != point ]))
def __init__(self, connection): self._hostname = base.get_hostname() self._scratch = base.get_scratch(self._hostname) self._tmpdir = self._scratch + "/" + str(uuid.uuid4()) self._connection = connection self._xtbpath = { "bismuth": "/mnt/c/Users/guido/opt/xtb/6.2.2/bin/xtb", "alchemy": "/home/vonrudorff/opt/xtb/xtb_6.2.2/bin/xtb", "avl03": "/home/grudorff/opt/xtb/xtb_6.2.2/bin/xtb", "scicore": "/scicore/home/lilienfeld/rudorff/opt/xtb/xtb_6.2.2/bin/xtb", }[self._hostname]
def handler(self, signal, frame): self.stopped = True guard = Guard() signal.signal(signal.SIGINT, guard.handler) signal.signal(signal.SIGTERM, guard.handler) cache = {} # identify client to server based on host randomid = "".join( random.choice(string.ascii_uppercase + string.digits) for _ in range(10) ) myhost = base.get_hostname() redis.client_setname(myhost + ":" + randomid) while not guard.stopped: bytecost = 0 starttime = time.time() # fetch jobid = redis.rpoplpush("queue", "running") if jobid is None: break bytecost += 20 + len(jobid) jobid = jobid.decode("utf-8") try: payload, filename = redis.hmget("job:" + jobid, "arg", "fname") bytecost += len(payload) + len(filename) + 20 filename = filename.decode("ascii")
def __init__(self, connection): self._hostname = base.get_hostname() self._scratch = base.get_scratch(self._hostname) self._tmpdir = self._scratch + "/" + str(uuid.uuid4())
CALL_INTERVAL = 5 * 60 # crontab interval in seconds MAX_KBPS_SCICORE = 10 * 1024 / 3 # change db to 0 parts = constr.split("/") parts[-1] = "0" constr = "/".join(parts) redis = Redis.from_url("redis://" + constr) redis4 = Redis.from_url("redis://" + constr[:-1] + "4") # check operational if redis.get("meta:operational").decode("ascii") != "yes": sys.exit(0) hostname = base.get_hostname() username = getpass.getuser() tmpfile = "/tmp/%s.autoscaler-tmp" % username if hostname == "scicore": qoss = ["30min", "6hours", "1day"] times = ["00:30:00", "06:00:00", "24:00:00"] else: qoss = ["noqos"] times = ["notime"] # bandwidth limit local_capacity = 1e4 if hostname == "scicore": clients = len(