diff --git a/form.js b/form.js index f85a70b..e9338c7 100644 --- a/form.js +++ b/form.js @@ -1,67 +1,5 @@ 'use strict' -/** - * Fix num cores, allowing blanks to remain - */ -function fix_num_cores() { - let node_type_input = $('#batch_connect_session_context_node_type'); - let node_type = node_type_input.val(); - let num_cores_input = $('#num_cores'); - - if(num_cores_input.val() === '') { - return; - } - - if(node_type === 'hugemem') { - set_ppn_owens_hugemem(num_cores_input); - } else { - set_ppn_owens_regular(num_cores_input); - } -} - -/** - * Sets the PPN limits available for Owens hugemem nodes. - * - * hugemem reservations are always assigned the full node - * - * @param {element} num_cores_input The input for num_cores - */ -function set_ppn_owens_hugemem(num_cores_input) { - const NUM_CORES = 48; - num_cores_input.attr('max', NUM_CORES); - num_cores_input.attr('min', NUM_CORES); - num_cores_input.val(NUM_CORES); -} - -/** - * Sets the PPN limits available for non hugemem Owens nodes. - * - * @param {element} num_cores_input The input for num_cores - */ -function set_ppn_owens_regular(num_cores_input) { - const NUM_CORES = 28; - num_cores_input.attr('max', NUM_CORES); - num_cores_input.attr('min', 0); - num_cores_input.val(Math.min(NUM_CORES, num_cores_input.val())); -} - -/** - * Toggle the visibilty of a form group - * - * @param {string} form_id The form identifier - * @param {boolean} show Whether to show or hide - */ -function toggle_visibilty_of_form_group(form_id, show) { - let form_element = $(form_id); - let parent = form_element.parent(); - - if(show) { - parent.show(); - } else { - form_element.val(''); - parent.hide(); - } -} /** * Toggle the visibilty of the license fields diff --git a/form.yml.erb b/form.yml.erb index 0d360f5..d512a63 100644 --- a/form.yml.erb +++ b/form.yml.erb @@ -27,9 +27,8 @@ attributes: Number of cores on node type (4 GB per core unless requesting whole node). Leave blank if requesting full node. min: 0 # This is treated as requesting the max allowable - max: 48 # This will be updated by form.js + max: 28 # This will be updated by form.js step: 1 - id: num_cores bc_num_slots: help: | Currently only Fluent and CFX have been tested to support multiple nodes. @@ -63,9 +62,21 @@ attributes: available RAM as well as 48 cores. There are 16 of these nodes on Owens. options: - - "any" - - "vis" - - "hugemem" + - [ + 'any', 'any', + data-max-num-cores: 28, + data-min-num-cores: 1, + ] + - [ + 'vis', 'vis', + data-max-num-cores: 28, + data-min-num-cores: 1, + ] + - [ + 'hugemem', 'hugemem', + data-max-num-cores: 48, + data-min-num-cores: 48, + ] version: widget: select label: "ANSYS Workbench version" @@ -84,8 +95,8 @@ attributes: label: "License provider" help: "Some users are required to provide their own license information" options: - - ["I can use the OSC license", "osc"] - - ["I need to use an external license", "external"] + - ['I can use the OSC license', 'osc'] + - ['I need to use an external license', 'external'] extern_license_server: label: "External License Server" placeholder: port@ip