From d3fe1b620b71d141d8b40929a26155c961ef6a72 Mon Sep 17 00:00:00 2001 From: chn Date: Fri, 3 May 2024 19:54:03 +0800 Subject: [PATCH] use hpcstat --- jykang/.bash_logout | 3 ++ jykang/.bash_profile | 12 -------- jykang/.bashrc | 38 +++++++++++++++++++++++++ jykang/linwei/chn/software/hpcstat/bsub | 2 ++ 4 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 jykang/.bash_logout create mode 100755 jykang/linwei/chn/software/hpcstat/bsub diff --git a/jykang/.bash_logout b/jykang/.bash_logout new file mode 100644 index 0000000..7808fc7 --- /dev/null +++ b/jykang/.bash_logout @@ -0,0 +1,3 @@ +if [ -n "${CHN_DEBUG-}" ]; then + hpcstat logout +fi diff --git a/jykang/.bash_profile b/jykang/.bash_profile index 6abf491..b1b93f7 100644 --- a/jykang/.bash_profile +++ b/jykang/.bash_profile @@ -1,15 +1,3 @@ -if [[ $TERM == chn_unset_ls_colors* ]]; then - export TERM=${TERM#*:} - export CHN_LS_USE_COLOR=1 -fi -if [[ $TERM == chn_cd* ]]; then - export TERM=${TERM#*:} - cd ~/${TERM%%:*} - export TERM=${TERM#*:} -fi - if [ -f ~/.bashrc ]; then . ~/.bashrc fi - -export PATH=$PATH:$HOME/bin:$HOME/linwei/chn/software/scripts diff --git a/jykang/.bashrc b/jykang/.bashrc index d0ef57a..d61acac 100644 --- a/jykang/.bashrc +++ b/jykang/.bashrc @@ -1,5 +1,43 @@ +# This is really FOLLISH but it works +if [ -z "${BASHRC_SOURCED-}" ]; then + if [[ $TERM == chn_unset_ls_colors* ]]; then + export TERM=${TERM#*:} + export CHN_LS_USE_COLOR=1 + fi + if [[ $TERM == chn_cd* ]]; then + export TERM=${TERM#*:} + cd ~/${TERM%%:*} + export TERM=${TERM#*:} + fi + if [[ $TERM == hpcstat_subaccount* ]]; then + export TERM=${TERM#*:} + export HPCSTAT_SUBACCOUNT=${TERM%%:*} + export TERM=${TERM#*:} + fi + if [[ $TERM == chn_debug* ]]; then + export TERM=${TERM#*:} + export CHN_DEBUG=1 + fi +fi + if [ -f /etc/bashrc ]; then . /etc/bashrc fi +if [ -z "${BASHRC_SOURCED-}" ]; then + export BASHRC_SOURCED=1 + export PATH=$PATH:$HOME/bin:$HOME/linwei/chn/software/scripts + + # script in ~/linwei/chn/software/hpcstat should have higher priority + if [ -n "${SSH_AUTH_SOCK-}" ]; then + export PATH=$HOME/linwei/chn/software/hpcstat:$PATH + export HPCSTAT_DATADIR=$HOME/linwei/chn/software/hpcstat + export HPCSTAT_BSUB=/opt/ibm/lsfsuite/lsf/10.1/linux2.6-glibc2.3-x86_64/bin/bsub + hpcstat login + if [ "$?" -ne 0 ]; then + exit 1 + fi + fi +fi + [ -n "$CHN_LS_USE_COLOR" ] && alias ls="ls --color=auto" diff --git a/jykang/linwei/chn/software/hpcstat/bsub b/jykang/linwei/chn/software/hpcstat/bsub new file mode 100755 index 0000000..936d25e --- /dev/null +++ b/jykang/linwei/chn/software/hpcstat/bsub @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +hpcstat submitjob "$@"