From 3aba821629f5627fc827ffbb1d3c2d8bda828e6d Mon Sep 17 00:00:00 2001 From: Calvin Date: Sun, 8 Jan 2023 11:27:09 +0200 Subject: [PATCH 1/5] Import.py updated for host checking Added in an if/elif/else statement that will check the socket host. - If the socket host is zeus, then it will import the zeus submit script and settings - Else if the socket host is atlas, then it will import the atlas submit script and settings - Else if the socket host is not recognised, then it will just import the general submit script and settings. --- t3/imports.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) mode change 100644 => 100755 t3/imports.py diff --git a/t3/imports.py b/t3/imports.py old mode 100644 new mode 100755 index ec477592..f919c09c --- a/t3/imports.py +++ b/t3/imports.py @@ -4,9 +4,19 @@ import os import sys +import socket -import t3.settings.settings as t3_settings -from t3.settings.t3_submit import submit_scripts + + +if socket.gethostname() == 'zeus.technion.ac.il': + import t3.settings.settings_zeus as t3_settings + from t3.settings.submit_zeus import submit_scripts +elif socket.gethostname() == 'tech-ui02.hep.technion.ac.il': + import t3.settings.settings_atlas as t3_settings + from t3.settings.submit_atlas import submit_scripts +else: + import t3.settings.settings as t3_settings + from t3.settings.t3_submit import submit_scripts # Common imports where the user can optionally put a modified copy of settings.py or t3_submit.py file under ~/.t3 From 08dfb501d08a00ed71fe8d51d86c69132d23e1c6 Mon Sep 17 00:00:00 2001 From: Calvin Date: Sun, 8 Jan 2023 11:28:13 +0200 Subject: [PATCH 2/5] Zeus server submit file File that provides the template for the submission file for zeus --- t3/settings/submit_zeus.py | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 t3/settings/submit_zeus.py diff --git a/t3/settings/submit_zeus.py b/t3/settings/submit_zeus.py new file mode 100755 index 00000000..b0971643 --- /dev/null +++ b/t3/settings/submit_zeus.py @@ -0,0 +1,81 @@ +""" +Submit scripts +""" + +# Submission scripts stored as a dictionary with software as the primary key. +submit_scripts = { +# 'rmg': """#!/bin/bash -l +# #SBATCH -J {name} +# #SBATCH -t 05-00:00:00 +# #SBATCH -o out.txt +# #SBATCH -e err.txt +# #SBATCH --ntasks={cpus} +# #SBATCH --mem-per-cpu={memory / cpus} +# +# +# export PYTHONPATH=$PYTHONPATH:~/Code/RMG-Py/ +# +# conda activate rmg_env +# +# touch initial_time +# +# python-jl ~/Code/RMG-Py/rmg.py -n {cpus} input.py{max_iterations} +# +# touch final_time +# +# """, +# 'rmg': """Universe = vanilla +# +# +JobName = "{name}" +# +# log = job.log +# output = out.txt +# error = err.txt +# +# getenv = True +# +# should_transfer_files = no +# +# executable = job.sh +# +# request_cpus = {cpus} +# request_memory = {memory}MB +# +# queue +# +# """, +# 'rmg_job': """#!/bin/bash -l +# +# touch initial_time +# +# source /srv01/technion/$USER/.bashrc +# +# conda activate rmg_env +# +# python-jl /Local/ce_dana/Code/RMG-Py/rmg.py -n {cpus} input.py{max_iterations} +# +# touch final_time +# +# """, + 'rmg': """#!/bin/bash -l + +#PBS -N {name} +#PBS -q zeus_long_q +#PBS -l walltime=168:00:00 +#PBS -l select=1:ncpus={cpus} +#PBS -o out.txt +#PBS -e err.txt + +PBS_O_WORKDIR={workdir} +cd $PBS_O_WORKDIR + +conda activate rmg_env + +touch initial_time + +python-jl ~/Code/RMG-Py/rmg.py -n {cpus} input.py{max_iterations} + +touch final_time + +""", +} From 04ad8f84fbb0c69823f73a4bb66ebe350f5e784c Mon Sep 17 00:00:00 2001 From: Calvin Date: Sun, 8 Jan 2023 11:28:39 +0200 Subject: [PATCH 3/5] Zeus server settings Provides the settings for Zeus server --- t3/settings/settings_zeus.py | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 t3/settings/settings_zeus.py diff --git a/t3/settings/settings_zeus.py b/t3/settings/settings_zeus.py new file mode 100755 index 00000000..e72418b6 --- /dev/null +++ b/t3/settings/settings_zeus.py @@ -0,0 +1,43 @@ +""" +T3's settings + +You may keep a short version of this file in a local ".t3" folder under your home folder. +Any definitions made to the local file will take precedence over this file. +""" + + +# The execution type can be either 'incore', i.e., executed in the same processor, +# or 'local', i.e., to be submitted to the server queue if running on a server. +# If running on a local server, ARC's settings for ``local`` will be used. +execution_type = { + 'rmg': 'local', + 'arc': 'incore', +} + +servers = { + 'local': { + 'cluster_soft': 'PBS', + 'cpus': 16, + 'max mem': 40, # GB + }, +} + +check_status_command = {'OGE': 'export SGE_ROOT=/opt/sge; /opt/sge/bin/lx24-amd64/qstat -u $USER', + 'Slurm': '/usr/bin/squeue -u $USER', + 'PBS': '/opt/pbs/bin/qstat -u $USER', + 'HTCondor': """condor_q -cons 'Member(Jobstatus,{1,2})' -af:j '{"0","P","R","X","C","H",">","S"}[JobStatus]' RequestCpus RequestMemory JobName '(Time() - EnteredCurrentStatus)'""", + } + +submit_command = {'OGE': 'export SGE_ROOT=/opt/sge; /opt/sge/bin/lx24-amd64/qsub', + 'Slurm': '/usr/bin/sbatch', + 'PBS': '/opt/pbs/bin/qsub', + 'HTCondor': 'condor_submit', + } + +submit_filenames = {'OGE': 'submit.sh', + 'Slurm': 'submit.sl', + 'PBS': 'submit.sh', + 'HTCondor': 'submit.sub', + } + +rmg_initial_memory = 25 # The initial memory for an RMG job when submitted to the queue, in GB From 0bf65ad9efcb8528fc1ba7011f779982e8f938bf Mon Sep 17 00:00:00 2001 From: Calvin Date: Sun, 8 Jan 2023 11:30:47 +0200 Subject: [PATCH 4/5] Atlas server submit file The template for the atlas server submit file --- t3/settings/submit_atlas.py | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 t3/settings/submit_atlas.py diff --git a/t3/settings/submit_atlas.py b/t3/settings/submit_atlas.py new file mode 100755 index 00000000..df4706e4 --- /dev/null +++ b/t3/settings/submit_atlas.py @@ -0,0 +1,60 @@ +""" +Submit scripts +""" + +# Submission scripts stored as a dictionary with software as the primary key. +submit_scripts = { +# 'rmg': """#!/bin/bash -l +# #SBATCH -J {name} +# #SBATCH -t 05-00:00:00 +# #SBATCH -o out.txt +# #SBATCH -e err.txt +# #SBATCH --ntasks={cpus} +# #SBATCH --mem-per-cpu=9500 +# +# +# export PYTHONPATH=$PYTHONPATH:~/Code/RMG-Py/ +# +# conda activate rmg_env +# +# touch initial_time +# +# python-jl ~/Code/RMG-Py/rmg.py -n {cpus} input.py +# +# touch final_time +# +# """, + 'rmg': """Universe = vanilla + ++JobName = "{name}" + +log = job.log +output = out.txt +error = err.txt + +getenv = True + +should_transfer_files = no + +executable = job.sh + +request_cpus = {cpus} +request_memory = {memory}MB + +queue + +""", + 'rmg_job': """#!/bin/bash -l + +touch initial_time + +source /srv01/technion/$USER/.bashrc + +conda activate rmg_env + +python-jl /Local/ce_dana/Code/RMG-Py/rmg.py -n {cpus} input.py{max_iterations} + +touch final_time + +""", +} From fc63bf39f6e14e8ce5522969f767ec9b4470f217 Mon Sep 17 00:00:00 2001 From: Calvin Date: Sun, 8 Jan 2023 11:31:45 +0200 Subject: [PATCH 5/5] Atlas server settings The settings for the atlas server if used --- t3/settings/settings_atlas.py | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 t3/settings/settings_atlas.py diff --git a/t3/settings/settings_atlas.py b/t3/settings/settings_atlas.py new file mode 100755 index 00000000..a4f9b4c0 --- /dev/null +++ b/t3/settings/settings_atlas.py @@ -0,0 +1,43 @@ +""" +T3's settings + +You may keep a short version of this file in a local ".t3" folder under your home folder. +Any definitions made to the local file will take precedence over this file. +""" + + +# The execution type can be either 'incore', i.e., executed in the same processor, +# or 'local', i.e., to be submitted to the server queue if running on a server. +# If running on a local server, ARC's settings for ``local`` will be used. +execution_type = { + 'rmg': 'local', + 'arc': 'incore', +} + +servers = { + 'local': { + 'cluster_soft': 'PBS', + 'cpus': 16, + 'max mem': 40, # GB + }, +} + +check_status_command = {'OGE': 'export SGE_ROOT=/opt/sge; /opt/sge/bin/lx24-amd64/qstat -u $USER', + 'Slurm': '/usr/bin/squeue -u $USER', + 'PBS': '/usr/local/bin/qstat -u $USER', + 'HTCondor': """condor_q -cons 'Member(Jobstatus,{1,2})' -af:j '{"0","P","R","X","C","H",">","S"}[JobStatus]' RequestCpus RequestMemory JobName '(Time() - EnteredCurrentStatus)'""", + } + +submit_command = {'OGE': 'export SGE_ROOT=/opt/sge; /opt/sge/bin/lx24-amd64/qsub', + 'Slurm': '/usr/bin/sbatch', + 'PBS': '/usr/local/bin/qsub', + 'HTCondor': 'condor_submit', + } + +submit_filenames = {'OGE': 'submit.sh', + 'Slurm': 'submit.sl', + 'PBS': 'submit.sh', + 'HTCondor': 'submit.sub', + } + +rmg_initial_memory = 25 # The initial memory for an RMG job when submitted to the queue, in GB