Skip to content

Commit

Permalink
Update slurm.sh (#199)
Browse files Browse the repository at this point in the history
modify queryUserInAcct  and queryUser
  • Loading branch information
Ashlee1994 authored Sep 30, 2022
1 parent bbe1525 commit 4c96d87
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions apps/mis-server/scripts/slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,12 @@ queryUser(){
echo "User $2 is not exist!"
exit 7
fi
qos=`sacctmgr show assoc format=user,qos | grep $2 | uniq | awk '{print $2}'`
if [ "$qos" == "block" ] ; then
echo "User $2 is blocked!"
MaxSubmitJobs=`$mysql --skip-column-names slurm_acct_db -e " select distinct max_submit_jobs from $assoc_table where user='$2'"`
if [ "$MaxSubmitJobs" == "NULL" ] ; then
echo "User $2 is allowed!"
exit 0
else
echo "User $2 is allowed!"
echo "User $2 is blocked!"
exit 0
fi
else
Expand Down Expand Up @@ -788,15 +788,15 @@ queryUserInAcct(){
echo "User $3 is not exist in account $2"
exit 4
else
#MaxSubmitJobs=`$mysql --skip-column-names slurm_acct_db -e " select distinct max_submit_jobs from $assoc_table where acct='$2' and user='$3'"`
qos=`sacctmgr show assoc format=user,acct%20,qos | grep -E "$3.*$2" | uniq | awk '{print $3}'`
if [ "$qos" == "block" ] ; then
echo "User $3 is blocked in account $2!"
MaxSubmitJobs=`$mysql --skip-column-names slurm_acct_db -e " select distinct max_submit_jobs from $assoc_table where acct='$2' and user='$3'"`
if [ "$MaxSubmitJobs" == "NULL" ] ; then
echo "User $3 is allowed in account $2!"
exit 0
else
echo "User $3 is allowed in account $2!"
echo "User $3 is blocked in account $2!"
exit 0
fi

fi
else
echo -e "$queryUserInAcct\n"
Expand Down

0 comments on commit 4c96d87

Please sign in to comment.