Skip to content

Commit

Permalink
use new Dashboard ERB templating
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
Jeremy Nicklas committed Mar 21, 2018
1 parent 79cb3e8 commit 5d2baae
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 129 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added COMSOL 5.3a to the app.

### Changed
- Modified the `CHANGELOG.md` formatting.
- Updated the date in `LICENSE.txt`.
- Changed the product icon.
- Refactored to use the new Dashboard ERB templating.
[#4](https://github.com/OSC/bc_osc_comsol/issues/4)

## [0.2.0] - 2017-12-15
### Changed
Expand Down
55 changes: 23 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
# Batch Connect - OSC COMSOL Multiphysics

![GitHub Release](https://img.shields.io/github/release/osc/bc_osc_comsol.svg)
![GitHub License](https://img.shields.io/github/license/osc/bc_osc_comsol.svg)
[![GitHub License](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)

A Batch Connect app designed for OSC OnDemand that launches COMSOL Multiphysics
within an Owens batch job.

## Prerequisites

This app requires the following software be installed on the nodes that the
batch job is intended to run on:
This Batch Connect app requires the following software be installed on the
**compute nodes** that the batch job is intended to run on (**NOT** the
OnDemand node):

- [COMSOL Multiphysics](https://www.comsol.com/) 5.1+
- [Lmod](https://www.tacc.utexas.edu/research-development/tacc-projects/lmod) 6.0.1+
- [Fluxbox](http://fluxbox.org/) 1.1.1+
- [COMSOL Multiphysics] 5.1+
- [Fluxbox] 1.1.1+

For VNC server support:

- [TurboVNC](http://www.turbovnc.org/) 2.1+
- [websockify](https://github.com/novnc/websockify) 0.8.0+
- [TurboVNC] 2.1+
- [websockify] 0.8.0+

For hardware rendering support:

- [X server](https://www.x.org/)
- [VirtualGL](http://www.virtualgl.org/) 2.3+
- [X server]
- [VirtualGL] 2.3+

**Optional** software:

- [Lmod] 6.0.1+ or any other `module purge` and `module load <modules>` based
CLI used to load appropriate environments within the batch job

[COMSOL Multiphysics]: https://www.comsol.com
[Fluxbox]: http://fluxbox.org/
[TurboVNC]: http://www.turbovnc.org/
[websockify]: https://github.com/novnc/websockify
[X server]: https://www.x.org/
[VirtualGL]: http://www.virtualgl.org/
[Lmod]: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod

## Install

Expand All @@ -50,28 +63,6 @@ scl enable git19 -- git checkout <tag/branch>

Again, you do not need to restart the app as it isn't a Passenger app.

## Template Specification

### COMSOL_MODULE

This environment variable describes the specific COMSOL version to load. This
also assumes module support through the
[Lmod](https://www.tacc.utexas.edu/research-development/tacc-projects/lmod)
package manager is installed on the running compute node as well as the
requested module in `$COMSOL_MODULE`.

### ENABLE_VIS

*Optional*

If this environment variables is not set (default), then it will run the Abaqus
GUI in software rendering mode.

If this is set, then it will use [VirtualGL](http://www.virtualgl.org/) giving
the COMSOL Multiphysics GUI full 3D hardware acceleration support inside the
VNC session. Note that an `Xorg` server must be running on the compute node
with a GPU for this to be supported.

## Contributing

1. Fork it ( https://github.com/OSC/bc_osc_comsol/fork )
Expand Down
42 changes: 22 additions & 20 deletions form.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
---
title: "COMSOL Multiphysics"
cluster: "owens"
description: |
This app will launch a COMSOL Multiphysics GUI on one or more Owens nodes.
You will be able to interact with the COMSOL GUI through a VNC session.
form:
- version
- bc_account
- bc_num_hours
- bc_num_slots
- node_type
- bc_vnc_resolution
- bc_email_on_started
attributes:
bc_vnc_resolution:
required: true
Expand All @@ -15,23 +19,21 @@ attributes:
help: |
- **any** - (*28 cores*) Use any available Owens node. This reduces the
wait time as there are no node requirements.
- **vis** - (*28 cores*) This node includes an NVIDIA Tesla P100 GPU
with an X server running in the background. This allows for Hardware
Rendering with the GPU typically needed for 3D visualization using
VirtualGL. There are currently only 160 of these nodes on Owens.
- **vis** - (*28 cores*) Use an Owens node that has an [NVIDIA Tesla P100
GPU](http://www.nvidia.com/object/tesla-p100.html) with an X server
running in the background. This utilizes the GPU for hardware
accelerated 3D visualization. There are 160 of these nodes on Owens.
- **hugemem** - (*48 cores*) Use an Owens node that has 1.5TB of
available RAM as well as 48 cores. There are 16 of these nodes on
Owens.
options:
- ["any", ":ppn=28"]
- ["vis", ":ppn=28:vis:gpus=1"]
- ["hugemem", ":ppn=48:hugemem"]
version: "comsol/52a"
form:
- version
- bc_num_hours
- bc_num_slots
- node_type
- bc_account
- bc_vnc_resolution
- bc_email_on_started
- [ "any", ":ppn=28" ]
- [ "vis", ":ppn=28:vis:gpus=1" ]
- [ "hugemem", ":ppn=48:hugemem" ]
version:
widget: select
label: "COMSOL Multiphysics version"
help: "This defines the version of COMSOL Multiphysics you want to load."
options:
- ["5.3a", "comsol/53a"]
- ["5.2a", "comsol/52a"]
8 changes: 5 additions & 3 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ category: Interactive Apps
subcategory: GUIs
role: batch_connect
description: |
This app will launch a [COMSOL Multiphysics](https://www.comsol.com/) GUI on one or more [Oakley
nodes](https://www.osc.edu/resources/technical_support/supercomputers/oakley).
You will be able to interact with the COMSOL GUI through a VNC session.
This app will launch a [COMSOL Multiphysics] GUI on the [Owens cluster]. You
will be able to interact with the COMSOL GUI through a VNC session.
[COMSOL Multiphysics]: https://www.comsol.com
[Owens cluster]: https://www.osc.edu/resources/technical_support/supercomputers/owens
15 changes: 5 additions & 10 deletions submit.yml.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<%-
num_nodes = bc_num_slots.blank? ? 1 : bc_num_slots.to_i
-%>
---
batch_connect:
template: vnc

template: "vnc"
script:
job_environment:
<%- unless version.blank? -%>
COMSOL_MODULE: "<%= version %>"
<%- end -%>
<%- if node_type.include? "vis" -%>
ENABLE_VIS: "1"
<%- end -%>
native:
resources:
nodes: "<%= bc_num_slots %><%= node_type %>"
nodes: "<%= num_nodes %><%= node_type %>"
software: "comsolscript"
2 changes: 2 additions & 0 deletions template/before.sh.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module
6 changes: 6 additions & 0 deletions template/fluxbox.rc.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
session.configVersion: 13
session.screen0.toolbar.widthPercent: 60
session.screen0.toolbar.tools: prevworkspace, workspacename, nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock
session.menuFile: <%= session.staged_root.join("fluxbox", "menu") %>
session.keyFile: <%= session.staged_root.join("fluxbox", "keys") %>
session.styleOverlay: <%= session.staged_root.join("fluxbox", "overlay") %>
64 changes: 0 additions & 64 deletions template/script.sh

This file was deleted.

47 changes: 47 additions & 0 deletions template/script.sh.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env bash

<%- gpu = context.node_type.include?("vis") -%>

# Clean the environment
module purge

# Set working directory to home directory
cd "${HOME}"

#
# Launch Fluxbox
#

# Create Fluxbox root or it will override the below init file
(
umask 077
mkdir -p "${HOME}/.fluxbox"
)

# Start the Fluxbox window manager (it likes to crash on occassion, make it
# persistent)
(
until fluxbox -display "${DISPLAY}.0" -rc "<%= session.staged_root.join("fluxbox.rc") %>"; do
echo "Fluxbox crashed with exit code $?. Respawning..." >&2
sleep 1
done
) &

#
# Start COMSOL Multiphysics
#

# Load the required environment
module load <%= context.version %>

# Launch COMSOL Multiphysics
<%- if gpu -%>
module load intel/16.0.3 virtualgl
module list
set -x
vglrun comsol
<%- else -%>
module list
set -x
comsol -3drend sw
<%- end -%>

0 comments on commit 5d2baae

Please sign in to comment.