Skip to content

Commit c61416a

Browse files
committed
Add sumsjob- to screen session name
1 parent 52e1cd6 commit c61416a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Downloads](https://pepy.tech/badge/sumsjob)](https://pepy.tech/project/sumsjob)
55
[![License](https://img.shields.io/github/license/lululxvi/sumsjob)](https://github.com/lululxvi/sumsjob/blob/master/LICENSE)
66

7-
&Sigma;&Sigma;<sub>Job</sub> or Sums<sub>Job</sub> (**S**imple **U**tility for **M**ultiple-**S**ervers **Job** **Sub**mission) is a simple Linux command-line utility which submits a job to one of the multiple servers each with limited resources such as GPUs. &Sigma;&Sigma;<sub>Job</sub> provides similar key functions for multiple servers as [Slurm Workload Manager](https://slurm.schedmd.com) for supercomputers and computer clusters. It provides three key functions:
7+
&Sigma;&Sigma;<sub>Job</sub> or Sums<sub>Job</sub> (**S**imple **U**tility for **M**ultiple-**S**ervers **Job** **Sub**mission) is a simple Linux command-line utility which submits a job to one of the multiple servers each with limited resources such as GPUs. &Sigma;&Sigma;<sub>Job</sub> provides similar key functions for multiple servers as [Slurm Workload Manager](https://slurm.schedmd.com) for supercomputers and computer clusters. It provides four key functions:
88

99
- show the status of GPUs on all servers,
1010
- submit a job to servers in noninteractive mode, i.e., the job will be running in the background of the server,

sumsjob/sacct.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,30 @@ def sacct():
2727

2828
# Example:
2929
# There is a screen on:
30-
# 47065.1640588557_8760 (12/27/2021 02:02:41 AM) (Detached)
30+
# 47065.sumsjob-jobname (12/27/2021 02:02:41 AM) (Detached)
3131
# 1 Sockets in /run/screen/S-lu.
3232
# Or
3333
# No Sockets found in /run/screen/S-lu.
3434
lines = process.stdout.strip().split("\n")
35-
lines = filter(lambda l: "Detached" in l, lines)
35+
lines = filter(lambda l: "sumsjob-" in l, lines)
3636
if not lines:
3737
continue
3838

3939
lines = map(lambda l: l.strip(), lines)
4040
for l in lines:
4141
session_name, creation_time = l.split("\t")[:2]
42-
session_name = session_name.split(".", 1)[1]
42+
job_name = session_name.split("sumsjob-", 1)[1]
4343
creation_time = creation_time[1:-1]
44-
jobs.append({"Server": m, "JobName": session_name, "Start": creation_time})
44+
jobs.append({"Server": m, "JobName": job_name, "Start": creation_time})
4545

4646
jobs = order_by_start(jobs)
4747
print("Server JobName Start")
4848
print("-------- ---------------- ----------------------")
4949
for job in jobs:
50-
session_name = job["JobName"]
51-
if len(session_name) > 16:
52-
session_name = session_name[:15] + "+"
53-
print(f"{job['Server']:<8} {session_name:<16} {job['Start']}")
50+
job_name = job["JobName"]
51+
if len(job_name) > 16:
52+
job_name = job_name[:15] + "+"
53+
print(f"{job['Server']:<8} {job_name:<16} {job['Start']}")
5454
return jobs
5555

5656

sumsjob/submit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def submit_one(
7171
return
7272

7373
if jobname is None:
74-
jobname = "%d_%04x" % (time.time(), random.randint(0, int("ffff", 16)))
74+
jobname = "%d%04x" % (time.time(), random.randint(0, int("ffff", 16)))
7575
runpath = os.path.join(config.path_prefix, jobname)
7676

7777
push_files("./", machine, runpath, options=config.files_push, verbose=verbose)
@@ -99,7 +99,7 @@ def submit_one(
9999
cmd = "cd {} && CUDA_VISIBLE_DEVICES={} {} {} 2>&1 | tee {}.log".format(
100100
runpath, gpuid, config.cmd, jobpy, jobname
101101
)
102-
cmd = f'screen -dmS {jobname} bash -c "{cmd}"'
102+
cmd = f'screen -dmS sumsjob-{jobname} bash -c "{cmd}"'
103103
cmd = local_cmdline(machine, cmd, verbose=verbose)
104104
subprocess.check_call(cmd, shell=True)
105105

0 commit comments

Comments
 (0)