Skip to content

Commit

Permalink
Merge pull request #47 from lunarc/develop
Browse files Browse the repository at this point in the history
Default options for group configs
  • Loading branch information
jonaslindemann authored May 30, 2023
2 parents 320a242 + c9ea6d9 commit 5a1778d
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 43 deletions.
37 changes: 20 additions & 17 deletions etc/gfxlauncher.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[general]
script_dir = /sw/pkg/ondemand-dt/run
install_dir = /sw/pkg/gfxlauncher
help_url = "https://lunarc-documentation.readthedocs.io/en/latest/gfxlauncher/"
help_url = "https://lunarc-documentation.readthedocs.io/en/latest/getting_started/gfxlauncher/"
browser_command = firefox

[slurm]
default_part = gpua40
default_account = lu-test

feature_mem96gb = "96 GB Memory node"
feature_mem64gb = "64 GB Memory node"
feature_mem128gb = "128 GB Memory node"
Expand All @@ -20,33 +23,32 @@ feature_kepler = "2 x NVIDIA K80 GPU"
feature_ampere = "2 x NVIDIA A100 GPU"
feature_ignore = "rack-,rack_,bc,haswell,cascade,enc,jobtmp,skylake,ampere,kepler,sandy"

part_lu = "Aurora CPU"
part_lu32 = "Aurora CPU (32c)"
part_gpu = "Aurora GPU (K80)"
part_gpu2 = "Aurora GPU (A100)"
part_gpuk20 = "Aurora GPU (K20)"
part_gpua100 = "Aurora GPU (A100)"
part_lvis = "On-demand (K20)"
part_lvis2 = "On-demand (A40)"
part_win = "Windows on-demand (V100)"
part_lu48 = "COSMOS CPU (AMD, 48c)"
part_lu32 = "COSMOS CPU (Intel, 32c)"
part_gpua40 = "On-Demand Shared (A40)"
part_gpua100 = "On-Demand Shared (A100)"
part_ignore = "lunarc,hep"

group_ondemand = lvis,lvis2
group_ondemand = gpua40
group_metashape184 = lvis2
group_cpu = lu,lu32
group_gpu = gpu,gpu2,gpuk20,gpua100
group_cpu = lu48
group_gpu = gpua100,gpua40
group_win = win
group_all = lvis,lvis2,lu,lu32,gpu,gpu2,gpuk20,gpua100
group_all = lu48,lu32,gpua100,gpua40

group_ondemand_tasks = 4
group_ondemand_memory = -1
group_ondemand_exclusive = no

use_sacctmgr = yes

[menus]
menu_prefix = "On-Demand - "
menu_prefix = "Applications - "
desktop_entry_prefix = "gfx-"

[vgl]
vgl_bin = /sw/pkg/rviz/vgl/bin/latest
vgl_path = /sw/pkg/rviz/vgl/bin/latest
vgl_bin = /usr/bin/vglconnect
vgl_path = /usr/bin
backend_node = gfx0
vglconnect_template = %s/vglconnect %s %s/%s

Expand All @@ -57,3 +59,4 @@ jupyterlab_module = Anaconda3
[xfreerdp]
xfreerdp_path = /sw/pkg/freerdp/2.0.0-rc4/bin
xfreerdp_cmdline = %s /v:%s /u:$USER /d:ad.lunarc /sec:tls /cert-ignore /audio-mode:1 /gfx +gfx-progressive -bitmap-cache -offscreen-cache -glyph-cache +clipboard /size:1280x1024 /dynamic-resolution /t:"LUNARC HPC Desktop Windows 10 (NVIDA V100)"

14 changes: 7 additions & 7 deletions gfxlaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
under certain conditions; see LICENSE for details.
"""
gfxlaunch_copyright_short = """LUNARC HPC Desktop On-Demand - %s"""
gfxlaunch_version = "0.9.4"
gfxlaunch_version = "0.9.5"

# --- Fix search path for tool

Expand Down Expand Up @@ -230,7 +230,7 @@ def create_light_palette():

# Redirect standard output

redirect = True
redirect = False

# Create Queue and redirect sys.stdout to this queue

Expand All @@ -244,12 +244,12 @@ def create_light_palette():

app = QtWidgets.QApplication(sys.argv)

if dark_mode:
palette = create_dark_palette()
else:
palette = create_light_palette()
#if dark_mode:
# palette = create_dark_palette()
#else:
# palette = create_light_palette()

app.setPalette(palette)
#app.setPalette(palette)

# Show splash

Expand Down
7 changes: 0 additions & 7 deletions gfxusage.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,6 @@ def create_light_palette():

app = QtWidgets.QApplication(sys.argv)

if dark_mode:
palette = create_dark_palette()
else:
palette = create_light_palette()

app.setPalette(palette)

# Show user interface

form = monitor.SessionWindow()
Expand Down
39 changes: 33 additions & 6 deletions lhpcdt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ def _default_props(self):
self.conda_source_env = ""
self.conda_use_env = ""

self.part_groups = {}
self.part_groups_defaults = {}


def print_config(self):
"""Print configuration"""

Expand Down Expand Up @@ -355,18 +359,41 @@ def parse_config_file(self):
# Check for partition groups

self.part_groups = {}
self.part_groups_defaults = {}

try:
slurm_options = config.options("slurm")
for option in slurm_options:
if option.find("group_") != -1:
parts = self._config_get(config, "slurm", option)
group = option.split("_")[1].strip()
partitions = parts.split(",")
self.part_groups[group] = []
for part in partitions:
self.part_groups[group].append(part.strip())

if len(option.split("_"))==2:
group = option.split("_")[1].strip()
partitions = parts.split(",")
self.part_groups[group] = []
for part in partitions:
self.part_groups[group].append(part.strip())
elif len(option.split("_"))==3:
group = option.split("_")[1].strip()
directive = option.split("_")[2].split(" ")[0].strip()

tasks = 1
memory = -1
exclusive = False

if not group in self.part_groups_defaults:
self.part_groups_defaults[group] = {}

if directive == "tasks":
self.part_groups_defaults[group]["tasks"] = int(parts)
if directive == "memory":
self.part_groups_defaults[group]["memory"] = int(parts)
if directive == "exclusive":
if parts.strip() == "yes":
exclusive = True
else:
exclusive = False
self.part_groups_defaults[group]["exclusive"] = exclusive

except configparser.Error as e:
self.print_error(e)
return False
Expand Down
10 changes: 10 additions & 0 deletions lhpcdt/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,15 @@ def __init__(self, parent=None):
if self.silent:
self.enable_silent_ui()

if self.group in self.config.part_groups_defaults:
if "tasks" in self.config.part_groups_defaults[self.group]:
self.tasks_per_node = self.config.part_groups_defaults[self.group]["tasks"]
if "memory" in self.config.part_groups_defaults[self.group]:
if self.config.part_groups_defaults[self.group]["memory"]>0:
self.memory = self.config.part_groups_defaults[self.group]["memory"]
if "exclusive" in self.config.part_groups_defaults[self.group]:
self.exclusive = self.config.part_groups_defaults[self.group]["exclusive"]

# Update controls to reflect parameters

self.update_controls()
Expand Down Expand Up @@ -864,6 +873,7 @@ def on_submit_finished(self):
if self.active_connection is not None:
self.active_connection.terminate()
self.active_connection = remote.VGLConnect()
self.active_connection.vgl_path = self.config.vgl_path
print("Command line:", self.cmd)
self.active_connection.execute(self.job.nodes, self.cmd)

Expand Down
14 changes: 9 additions & 5 deletions lhpcdt/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ def __init__(self, filename=""):
def __parse_metadata(self):
"""Parse run-script for metadata"""

# LDT category = "Post Processing"
# LDT title = "ParaView 5.4.1"
# LDT part = "snic"
# LDT job = "notebook"
# LDT group = "ondemand"
##LDT category = "Post Processing"
##LDT title = "ParaView 5.4.1"
##LDT part = "snic"
##LDT job = "notebook"
##LDT group = "ondemand"
##LDT vgl = "yes"

self.__variables = {}

Expand Down Expand Up @@ -117,6 +118,9 @@ def parse(self, dryrun=False, no_launcher=False):
#print("Found:", script)
filename = os.path.join(script_dir, script)

if os.path.isdir(filename):
continue

run_script = RunScript(filename)
run_script.launcher = self.__launcher

Expand Down
1 change: 0 additions & 1 deletion scripts/paraview_slurm.sh

This file was deleted.

1 change: 1 addition & 0 deletions tests/run_test_paraview_2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../gfxlaunch --vgl --group ondemand --title "ParaView 5.11.1" --cmd /sw/pkg/ondemand-dt/run/paraview-5.11.1.sh

0 comments on commit 5a1778d

Please sign in to comment.