-
Notifications
You must be signed in to change notification settings - Fork 8
Add option for inequal distributions of workload #74
Conversation
I've been busy and will check this next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.
I'm fine with the changes but the MR contains many unrelated changes that need to go before merging
@@ -1,28 +1,52 @@ | |||
#! /bin/bash | |||
|
|||
# partition ALL SUBDIRECTORIES in equal parts into the folders given as arguments | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated line gone
echo "dir: $1" | ||
shift | ||
echo "val: $1" | ||
distribution[$((i++%N))]=$(echo "$1*$numFolders" | bc | mawk '{print int($1+0.5)}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this really need mawk? or can bc or any awk do this?
until [ -z "$1" ]; do | ||
# temporarily hide the folders we are sorting into | ||
test -d "$1" && mv "$1" ".$1" | ||
mkdir -p ".$1" | ||
dir[$((i++%N))]="$1" | ||
dir[$((i%N))]="$1" | ||
echo "dir: $1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these prints necessary
@@ -1,6 +1,6 @@ | |||
#! /bin/bash | |||
|
|||
# TODO: | |||
# TODO: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary change
email[marc]="[email protected]" | ||
#email[ko]="[email protected]" | ||
#email[pol]="[email protected]" | ||
typeset -A distribution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's keep using the marc/ko/pol example graders, they deserve it:')
@@ -120,7 +123,7 @@ if [ "$CSV" ]; then | |||
"$MYDIR"/identify.sh "$CSV" */ | |||
fi | |||
|
|||
echo | |||
echo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated change
@@ -186,8 +208,8 @@ do | |||
echo Mailing "$ta" | |||
pkt="$ta-${zip%.zip}.7z" | |||
7za a -ms=on -mx=9 "$pkt" "$ta" > /dev/null | |||
#echo "$humor" | mailx -n -s "${SUBJECT} ${zip%.zip}" -a "$pkt" "${email[$ta]}" | |||
echo "$humor" | mutt -s "${SUBJECT}: ${zip%.zip}" -a "$pkt" -- "${email[$ta]}" | |||
#echo "$humor" | mailx -n -s "${SUBJECT} ${zip%.zip}" -a "$pkt" "${email[$ta]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated change
Oh yeah, thats my bad. |
Hi, I'm currently working as a TA for functional programming for AI.
We had an issue that one of the TAs should have a higher workload than the others.
Our quick fix was of course to add the TAs multiple times which is very annoying because everyone would get multiple emails etc.
Anyway long story short, I made some changes to introduce an (optional) distribution array which allows the script to partition the work. It works perfectly in my tests but I haven't done much bash scripting before so it might have some bugs that I missed.
Hope it's something you guys approve of