Compare commits

...

18 commits
1.0 ... main

Author SHA1 Message Date
milfeld2
0ecc274ad5 Merge pull request #9 from milfeld/900_Wfix
900 wfix
2016-02-07 11:33:14 -06:00
Kent Milfeld
5629bdb9e6 900 FIX 2016-02-07 11:17:27 -06:00
milfeld2
e559902c30 Merge pull request #8 from milfeld/800_Wfix
800 fix
2016-02-07 11:13:14 -06:00
Kent Milfeld
1acdc7bcaa 800 fix 2016-02-07 11:10:22 -06:00
milfeld2
1226695223 Merge pull request #7 from milfeld/700_fix100
700 fix100
2016-02-07 11:04:49 -06:00
Kent Milfeld
81d0c5a3ef NOTE ABOUT HOSTNAME 2016-02-07 10:59:47 -06:00
milfeld2
1d1f2083a5 Merge pull request #6 from milfeld2/WORK
pull work into master
2016-02-07 10:50:15 -06:00
milfeld2
2872fd0bc0 Merge pull request #5 from milfeld/500_fix5
ADDED TODO
2016-02-07 10:47:21 -06:00
Kent Milfeld
09ffe5c2a2 ADDED TODO 2016-02-07 10:41:22 -06:00
milfeld2
3937abc673 Merge pull request #4 from milfeld/400_fix4
400 fix4
2016-02-07 10:36:56 -06:00
Kent Milfeld
f226888df2 ADDED GIT MILFELD2 REF 2016-02-07 10:25:02 -06:00
milfeld2
f6414ab0b0 Merge pull request #1 from milfeld/300_fix3
ADDED REFERENCE AT GIT
2016-02-07 09:07:31 -06:00
Kent Milfeld
c95246634b ADDED REFERENCE AT GIT 2016-02-07 08:59:00 -06:00
Kent Milfeld
d22b560fe9 Merge branch '140_text_fix'
Conflicts:
	idev
2016-01-28 12:43:42 -06:00
Kent Milfeld
f6f2eb7011 ADD HISTORY INFO FOR INTERACTIVE GRACE QUEUE LIMIT. 2016-01-28 12:30:27 -06:00
Kent Milfeld
8927cfbef1 UPDATE HISTORY WITH GRACE QUEUE INFO 2016-01-28 11:23:07 -06:00
Kent Milfeld
51a4cbb6fc COMMENT TEXT CHANGE: NOT KNOW TO NOT KNOWN. 2016-01-28 10:37:09 -06:00
Kent Milfeld
995f387f2f ADDED $USER TO ENV. FILE NAME; 1 GRACE INTERACTIVE JOB LIMIT 2016-01-28 10:07:16 -06:00
2 changed files with 47 additions and 12 deletions

56
idev
View file

@ -1,7 +1,7 @@
#!/bin/bash
#set -x
# User is forces to use either SGE or SLURM options, except
# -p and -q can both be used for either batch system
# set -x
# User is forced to use either SGE or SLURM options, except
# -p and -q can both be used for either batch system.
#
# For Stampede the system startup file /etc/profile.d/z95_idev.<csh|sh>
# takes care of sourcing /tmp/idev_<csh|sh>_env.<jobid> if the file
@ -55,16 +55,18 @@
#Hidden grace-serial queue
# Added -p <queue_name> option to squeue (to see queue)
# Allow -n 1 for default for grace-serial queue
# Changed format from 9 to 15 chars for queue name (grace-serial is 12 chars)
# Abort if -N is used in grace-serial queue.
# 01/21/2016 KentM
#
# Changed format from 9 to 15 for queue name (grace-serial is 12 chars)
# grace-serial queue users are allowed only 1 interactive job
# 01/29/2016 KentM
# TODO
# Update version number.
#------------------------------------------------------------------------------
#
# Versions Number
IDEV_VER=1.00
IDEV_SETUP_VER=1.00
#NOTE: use hostname -f
#Determine the system
myhostname=`hostname -f`
if [[ $myhostname =~ nid ]] ; then
@ -73,13 +75,14 @@
MY_SYS=`echo $myhostname | awk 'BEGIN { FS = "." } ; { print $2 }'`
fi
#800 comment her 800_Wfix
srun=off # Don't use srun on Stampede
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT EXIT
did_exit=no
exit_msg=""
#800 comment for 900_Wfix
# Trap Function. Deletes job on exit of this script
function ctrl_c() {
#Job submitted, and job id available.
@ -696,7 +699,7 @@ fi
fi
if [[ $known_option == "no" ]]; then
echo -e "\n ERROR: **The $1 option is not know."
echo -e "\n ERROR: **The $1 option is not known."
echo -e " To see options, execute: idev -help."
do_exit=yes; OPT_ERR=2
@ -749,6 +752,35 @@ if [[ $total_tasks_set == no && $nodes_set == yes ]] ; then
fi
# if grace-serial queue
if [[ $MY_QUEUE =~ grace-serial ]]; then
squeue -p $MY_QUEUE "$squeue_opts" -u $USER | \
awk '$3 ~ /idv[0-9][0-9][0-9][0-9][0-9]/' | \
awk '{print $5}' | grep R >/dev/null
if [ $? = 0 ]; then
using_node=`squeue -p $MY_QUEUE "$squeue_opts" -u $USER | \
awk '$3 ~ /idv[0-9][0-9][0-9][0-9][0-9]/' | \
awk '{print $8}' `
echo ""
echo " ERROR: Only one ONE idev interactive session allowed in $MY_QUEUE queue."
echo ""
echo " You are executing idev again in the $MY_QUEUE queue."
echo " In this queue only 1 idev interactive job is allowed."
echo " You may have multiple windows open to the job (node) for an active"
echo " IDEV session by opening a new window on a login node, and SSHing"
echo " to the node of the job with the command:"
echo ""
echo " ssh -Y $using_node "
echo ""
echo " In a new window you can customize your environment if"
echo " you want to work interactively on different projects."
echo ""
do_exit=yes; OPT_ERR=2
fi
fi
############################################end Dependent options
@ -1395,6 +1427,7 @@ $MY_RESERVATION
$idev_pwd_cmd
$idev_rm_perl5
# Remove old files (needed for grace-serial queue).
rm -rf /tmp/idev_${USER}_${idev_login_shell}_env.[0-9]*
$DIR/idev_utils env_replication ${idev_login_shell} \$SLURM_JOB_ID
$CREATE_NODE_LIST_CMD
@ -1495,7 +1528,7 @@ fi
#####
while [ $found_env_file == 1 ]; do
ssh -o "StrictHostKeyChecking no" $node "ls /tmp/idev_${idev_login_shell}_env.${JOBID}" >& /dev/null
ssh -o "StrictHostKeyChecking no" $node "ls /tmp/idev_${USER}_${idev_login_shell}_env.${JOBID}" >& /dev/null
if [[ $? == 0 ]]; then
found_env_file=0
if [[ $time_waited_env_file > 0 ]]; then
@ -1534,7 +1567,8 @@ fi
fi
fi
#http://github.com/milfeld2/idivx
#trapping
#http://rimuhosting.com/knowledgebase/linux/misc/trapping-ctrl-c-in-bash
#http://www.linuxjournal.com/content/use-bash-trap-statement-cleanup-temporary-files
#http://github.com/milfeld/idivx

View file

@ -157,7 +157,8 @@ sub env_replication(@){
## Changed for 9.2 my_<shell>... --> idev_<shell>...
## $myenv_filename = "/tmp/idev_${my_shell}_env.${my_idev}";
$myenv_filename = "/tmp/idev_${USER}_${my_shell}_env.${my_idev}";
## $myenv_filename = "/tmp/idev_${USER}_${my_shell}_env.${my_idev}";
$myenv_filename = "/tmp/idev_$ENV{USER}_${my_shell}_env.${my_idev}";
if ( $my_shell eq "bash" ){
$CMD = "export ";
$UNCMD = "unset ";