You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2022/01/05 16:45:57 UTC

[airavata] branch master updated (936c21e -> e351f81)

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git.


    from 936c21e  Ignoring sym links empty directories when building the archive
     new 44ad207  Updating the slurm script to override parmaters with pre job commands
     new e351f81  Prioritizing external parameters when constructing the slurm script

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/resources/SLURM_Groovy.template       | 30 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 4 deletions(-)

[airavata] 02/02: Prioritizing external parameters when constructing the slurm script

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit e351f81d51ad5062411ce615319c5232b34a702d
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Wed Dec 23 19:24:04 2020 -0500

    Prioritizing external parameters when constructing the slurm script
---
 .../configuration/server/src/main/resources/SLURM_Groovy.template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/configuration/server/src/main/resources/SLURM_Groovy.template b/modules/configuration/server/src/main/resources/SLURM_Groovy.template
index 457ceee..c09ae1b 100644
--- a/modules/configuration/server/src/main/resources/SLURM_Groovy.template
+++ b/modules/configuration/server/src/main/resources/SLURM_Groovy.template
@@ -8,25 +8,25 @@
    def rmQueue = checkCommand(preJobCommands, 'RM #SBATCH -p')
    preJobCommands = preJobCommands - extQueue
    preJobCommands = preJobCommands - rmQueue
-   if (queueName != null && queueName != "" && rmQueue == null) out.print extQueue ? extQueue + '\n' : '#SBATCH -p ' + queueName + '\n'
+   if (extQueue) out.print extQueue + '\n' else if (queueName != null && queueName != "" && rmQueue == null) out.print '#SBATCH -p ' + queueName + '\n'
 
    def extNodes = checkCommand(preJobCommands, '#SBATCH -N')
    def rmNodes = checkCommand(preJobCommands, 'RM #SBATCH -N')
    preJobCommands = preJobCommands - extNodes
    preJobCommands = preJobCommands - rmNodes
-   if (nodes != null && nodes != "" && rmNodes == null) out.print extNodes? extNodes + '\n' : '#SBATCH -N ' + nodes + '\n'
+   if (extNodes) out.print extNodes + '\n' else if (nodes != null && nodes != "" && rmNodes == null) out.print '#SBATCH -N ' + nodes + '\n'
 
    def extCpu = checkCommand(preJobCommands, '#SBATCH -n')
    def rmCpu = checkCommand(preJobCommands, 'RM #SBATCH -n')
    preJobCommands = preJobCommands - extCpu
    preJobCommands = preJobCommands - rmCpu
-   if (cpuCount != null && cpuCount != "" && rmCpu == null) out.print extCpu? extCpu + '\n' : '#SBATCH -n ' + cpuCount + '\n'
+   if (extCpu) out.print extCpu + '\n' else if (cpuCount != null && cpuCount != "" && rmCpu == null) out.print '#SBATCH -n ' + cpuCount + '\n'
 
    def extMem = checkCommand(preJobCommands, '#SBATCH --mem=')
    def rmMem = checkCommand(preJobCommands, 'RM #SBATCH --mem=')
    preJobCommands = preJobCommands - extMem
    preJobCommands = preJobCommands - rmMem
-   if (usedMem != null && usedMem != "" && rmMem == null) out.print extMem ? extMem + '\n': '#SBATCH --mem=' + usedMem + 'M\n'
+   if (extMem) out.print extMem + '\n' else if (usedMem != null && usedMem != "" && rmMem == null) out.print '#SBATCH --mem=' + usedMem + 'M\n'
 
    if (mailAddress != null && mailAddress != "") out.print '#SBATCH --mail-user=' + mailAddress + '\n'
    if (accountString != null && accountString != "" ) out.print '#SBATCH -A ' + accountString + '\n'

[airavata] 01/02: Updating the slurm script to override parmaters with pre job commands

Posted by di...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 44ad2071fd3d7ed798d5ebb799a239185a11bf22
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Wed Dec 23 17:36:23 2020 -0500

    Updating the slurm script to override parmaters with pre job commands
---
 .../src/main/resources/SLURM_Groovy.template       | 30 +++++++++++++++++++---
 1 file changed, 26 insertions(+), 4 deletions(-)

diff --git a/modules/configuration/server/src/main/resources/SLURM_Groovy.template b/modules/configuration/server/src/main/resources/SLURM_Groovy.template
index a30cecb..457ceee 100644
--- a/modules/configuration/server/src/main/resources/SLURM_Groovy.template
+++ b/modules/configuration/server/src/main/resources/SLURM_Groovy.template
@@ -2,10 +2,32 @@
 
 # SLURM job submission script generated by Apache Airavata
 <%
-if (queueName != null && queueName != "") out.print '#SBATCH -p ' + queueName + '\n'
-   if (nodes != null && nodes != "") out.print '#SBATCH -N ' + nodes + '\n'
-   if (cpuCount != null && cpuCount != "") out.print '#SBATCH -n ' + cpuCount + '\n'
-   if (usedMem != null && usedMem != "") out.print '#SBATCH --mem=' + usedMem + 'M\n'
+   def checkCommand = {items, prefix -> for (it in items) if (it.startsWith(prefix)) return it}
+
+   def extQueue = checkCommand(preJobCommands, '#SBATCH -p')
+   def rmQueue = checkCommand(preJobCommands, 'RM #SBATCH -p')
+   preJobCommands = preJobCommands - extQueue
+   preJobCommands = preJobCommands - rmQueue
+   if (queueName != null && queueName != "" && rmQueue == null) out.print extQueue ? extQueue + '\n' : '#SBATCH -p ' + queueName + '\n'
+
+   def extNodes = checkCommand(preJobCommands, '#SBATCH -N')
+   def rmNodes = checkCommand(preJobCommands, 'RM #SBATCH -N')
+   preJobCommands = preJobCommands - extNodes
+   preJobCommands = preJobCommands - rmNodes
+   if (nodes != null && nodes != "" && rmNodes == null) out.print extNodes? extNodes + '\n' : '#SBATCH -N ' + nodes + '\n'
+
+   def extCpu = checkCommand(preJobCommands, '#SBATCH -n')
+   def rmCpu = checkCommand(preJobCommands, 'RM #SBATCH -n')
+   preJobCommands = preJobCommands - extCpu
+   preJobCommands = preJobCommands - rmCpu
+   if (cpuCount != null && cpuCount != "" && rmCpu == null) out.print extCpu? extCpu + '\n' : '#SBATCH -n ' + cpuCount + '\n'
+
+   def extMem = checkCommand(preJobCommands, '#SBATCH --mem=')
+   def rmMem = checkCommand(preJobCommands, 'RM #SBATCH --mem=')
+   preJobCommands = preJobCommands - extMem
+   preJobCommands = preJobCommands - rmMem
+   if (usedMem != null && usedMem != "" && rmMem == null) out.print extMem ? extMem + '\n': '#SBATCH --mem=' + usedMem + 'M\n'
+
    if (mailAddress != null && mailAddress != "") out.print '#SBATCH --mail-user=' + mailAddress + '\n'
    if (accountString != null && accountString != "" ) out.print '#SBATCH -A ' + accountString + '\n'
    if (maxWallTime != null && maxWallTime != "") out.print '#SBATCH -t ' + maxWallTime + '\n'