Skip to content

Commit

Permalink
vine status merlin
Browse files Browse the repository at this point in the history
  • Loading branch information
Barry Jay Sly-Delgado committed Aug 21, 2024
1 parent 13080d4 commit 1ba76b6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
5 changes: 4 additions & 1 deletion merlin/common/vine_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,10 @@ def expand_tasks_with_samples( # pylint: disable=R0913,R0914
next_index.min,
).set_manager(steps[0].get_task_manager())

# TODO VINE local execution option
# TODO VINE possible local execution option:
# there does not exsist the functionallity
# to schedule to the manager remotely so a group
# of tasks needs to retuned together.
#if self.request.is_eager:
# sig.delay()
if 1:
Expand Down
8 changes: 6 additions & 2 deletions merlin/examples/taskvine/hello_samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ study:
cmd: print("Hurrah, we did it!")
depends: [step_1_*]
shell: /usr/bin/env python3


#batch:
# type: slurm

merlin:
resources:
task_server: taskvine
workers:
default:
manager: merlin_test_manager
manager: hello_samples_manager
steps: [step_1, step_2]
managers:
merlin_test_manager:
hello_samples_manager:
samples:
generate:
cmd: python3 $(SPECROOT)/make_samples.py --filepath=$(MERLIN_INFO)/samples.csv --number=$(N_SAMPLES)
Expand Down
40 changes: 34 additions & 6 deletions merlin/study/vineadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,48 @@ def query_taskvine_study(spec: MerlinSpec):
:param spec: A MerlinSpec object representing our study
"""
study_info = {"waiting":0,
"running":0,
"complete":0,
"workers":0,
"cores":0,
"cores_inuse":0,
"memory":0,
"memory_inuse":0,
"gpus":0,
"gpus_inuse":0}
result = subprocess.run(["vine_status"], capture_output=True)
# PROJECT HOST PORT WAITING RUNNING COMPLETE WORKERS

study_info = {"waiting":0, "running":0, "complete":0, "workers":0}
# MANAGER HOST PORT WAITING RUNNING COMPLETE WORKERS
lines = result.stdout.splitlines()
for line in lines[1:]:
line = line.decode("utf-8")
manager, host, port, waiting, running, complete, workers = line.split(maxspit=6)
if manager in spec.merlin["resources"]["managers"]:
manager, host, port, waiting, running, complete, workers = line.split(maxsplit=6)
#if manager in spec.merlin["resources"]["managers"]:
if 1:
study_info["waiting"] += int(waiting)
study_info["running"] += int(running)
study_info["complete"] += int(complete)
study_info["workers"] += int(workers)
print(spec.merlin["resources"]["managers"])
result = subprocess.run(["vine_status", "-R"], capture_output=True)
# MANAGER CORES INUSE MEM(GB) INUSE GPUS INUSE
lines = result.stdout.splitlines()
for line in lines[1:]:
line = line.decode("utf-8")
manager, cores, cores_inuse, memory, memory_inuse, gpus, gpus_inuse = line.split(maxsplit=6)
#if manager in spec.merlin["resources"]["managers"]:
if 1:
study_info["cores"] += int(cores)
study_info["cores_inuse"] += int(cores_inuse)
study_info["memory"] += int(memory)
study_info["memory_inuse"] += int(memory_inuse)
study_info["gpus"] += int(gpus)
study_info["gpus_inuse"] += int(gpus_inuse)
headers = list(study_info.keys())
values = list(study_info.values())
print(headers, values)
print(tabulate(values, headers=headers))
print(study_info)



def get_running_managers(celery_app_name: str, test_mode: bool = False) -> List[str]:
Expand Down

0 comments on commit 1ba76b6

Please sign in to comment.