diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-08-22 14:39:03 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-08-22 14:39:03 +0000 |
| commit | fc7990c62d85fdebef4a438a1fbc9d69a3710d55 (patch) | |
| tree | ba6e1a305b0e63fbeb719e1a682c8e5e578b726e /boca-1.5.0/doc/problemexamples | |
| parent | 059e2fdcf0cef7e3594a66e21b3fd682ac736856 (diff) | |
| download | boca-fc7990c62d85fdebef4a438a1fbc9d69a3710d55.tar.gz boca-fc7990c62d85fdebef4a438a1fbc9d69a3710d55.zip | |
small bug fixes, inclusion of file size limit configurable
Diffstat (limited to 'boca-1.5.0/doc/problemexamples')
7 files changed, 42 insertions, 15 deletions
diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/compile/c b/boca-1.5.0/doc/problemexamples/problemtemplate/compile/c index 4cb7ea8..5376708 100644 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/compile/c +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/compile/c @@ -21,7 +21,7 @@ # $1 source_file # $2 exe_file (default run.exe) # $3 timelimit (optional, limit to run all the repetitions, by default only one repetition) -# $4 maximum allowed memory (in MBytes) +# $4 maximum allowed memory (in MBytes, default 512M) # # the output of the submission should be directed to the standard output # diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/limits/c b/boca-1.5.0/doc/problemexamples/problemtemplate/limits/c index b48a3b7..b5aec73 100644 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/limits/c +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/limits/c @@ -5,6 +5,8 @@ echo 4 echo 10 # and the maximum amount of memory per repetition in the third line (in Mbytes) echo 512 +# and the maximum file size in the fourth line (in kbytes) +echo 1024 # and shall return zero to indicate no failure exit 0 # the idea is that this file will be executed by the autojudge in the first time the autojudge downloads a problem, so as it will be diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/limits/cpp b/boca-1.5.0/doc/problemexamples/problemtemplate/limits/cpp index b48a3b7..b5aec73 100644 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/limits/cpp +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/limits/cpp @@ -5,6 +5,8 @@ echo 4 echo 10 # and the maximum amount of memory per repetition in the third line (in Mbytes) echo 512 +# and the maximum file size in the fourth line (in kbytes) +echo 1024 # and shall return zero to indicate no failure exit 0 # the idea is that this file will be executed by the autojudge in the first time the autojudge downloads a problem, so as it will be diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/limits/java b/boca-1.5.0/doc/problemexamples/problemtemplate/limits/java index b48a3b7..b5aec73 100644 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/limits/java +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/limits/java @@ -5,6 +5,8 @@ echo 4 echo 10 # and the maximum amount of memory per repetition in the third line (in Mbytes) echo 512 +# and the maximum file size in the fourth line (in kbytes) +echo 1024 # and shall return zero to indicate no failure exit 0 # the idea is that this file will be executed by the autojudge in the first time the autojudge downloads a problem, so as it will be diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/run/c b/boca-1.5.0/doc/problemexamples/problemtemplate/run/c index 75720ee..b46e5f9 100755 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/run/c +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/run/c @@ -15,14 +15,15 @@ # // You should have received a copy of the GNU General Public License # // along with this program. If not, see <http://www.gnu.org/licenses/>. # //////////////////////////////////////////////////////////////////////////////// -#Last modified: 21/july/2012 by cassio@ime.usp.br +#Last modified: 22/aug/2012 by cassio@ime.usp.br # # parameters are: # $1 exe_file # $2 input_file # $3 timelimit (limit to run all the repetitions, by default only one repetition) # $4 number_of_repetitions_to_run (optional, can be used for better tuning the timelimit) -# $5 maximum allowed memory (in KBytes) +# $5 maximum allowed memory (in MBytes) +# $6 maximum allowed output size (in KBytes) # # the output of the submission should be directed to the standard output # @@ -98,6 +99,12 @@ if [ "$5" != "" ]; then maxm=${5}000 fi fi +maxf=1024 +if [ "$6" != "" ]; then + if [ "$6" -gt "0" ]; then + maxf=${6} + fi +fi cp "$2" stdin0 2>/dev/null cp "$1" run.exe 2>/dev/null @@ -110,7 +117,7 @@ fi cdir=`pwd` echo "Current directory is $cdir -- chrooting on it" >&2 -$sf -F10 -r$nruns -n1 -R$cdir -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d$maxm -m$maxm -t$time -T$ttime -istdin0 ./run.exe +$sf -F10 -f$maxf -r$nruns -n1 -R$cdir -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d$maxm -m$maxm -t$time -T$ttime -istdin0 ./run.exe ret=$? if [ $ret -gt 10 ]; then ret=0 diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp b/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp index e5c7620..b46e5f9 100755 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/run/cpp @@ -15,14 +15,15 @@ # // You should have received a copy of the GNU General Public License # // along with this program. If not, see <http://www.gnu.org/licenses/>. # //////////////////////////////////////////////////////////////////////////////// -#Last modified: 21/july/2012 by cassio@ime.usp.br +#Last modified: 22/aug/2012 by cassio@ime.usp.br # # parameters are: # $1 exe_file # $2 input_file # $3 timelimit (limit to run all the repetitions, by default only one repetition) # $4 number_of_repetitions_to_run (optional, can be used for better tuning the timelimit) -# $5 maximum allowed memory (in KBytes) +# $5 maximum allowed memory (in MBytes) +# $6 maximum allowed output size (in KBytes) # # the output of the submission should be directed to the standard output # @@ -66,11 +67,11 @@ if [ "$1" == "" -o "$2" == "" -o "$3" == "" ]; then exit 43 fi if [ ! -x "$1" ]; then - echo "$1 not found or it's not executable" + echo "$1 not found (or is not in the current dir) or it's not executable" exit 44 fi if [ ! -r "$2" ]; then - echo "$2 not found or it's not readable" + echo "$2 not found (or is not in the current dir) or it's not readable" exit 45 fi if [ ! -x $sf ]; then @@ -98,6 +99,12 @@ if [ "$5" != "" ]; then maxm=${5}000 fi fi +maxf=1024 +if [ "$6" != "" ]; then + if [ "$6" -gt "0" ]; then + maxf=${6} + fi +fi cp "$2" stdin0 2>/dev/null cp "$1" run.exe 2>/dev/null @@ -110,7 +117,7 @@ fi cdir=`pwd` echo "Current directory is $cdir -- chrooting on it" >&2 -$sf -F10 -r$nruns -n1 -R$cdir -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d$maxm -m$maxm -t$time -T$ttime -istdin0 ./run.exe +$sf -F10 -f$maxf -r$nruns -n1 -R$cdir -C. -U$bocau -G$bocag -ostdout0 -estderr0 -d$maxm -m$maxm -t$time -T$ttime -istdin0 ./run.exe ret=$? if [ $ret -gt 10 ]; then ret=0 diff --git a/boca-1.5.0/doc/problemexamples/problemtemplate/run/java b/boca-1.5.0/doc/problemexamples/problemtemplate/run/java index c24d842..d35818f 100755 --- a/boca-1.5.0/doc/problemexamples/problemtemplate/run/java +++ b/boca-1.5.0/doc/problemexamples/problemtemplate/run/java @@ -15,14 +15,15 @@ # // You should have received a copy of the GNU General Public License # // along with this program. If not, see <http://www.gnu.org/licenses/>. # //////////////////////////////////////////////////////////////////////////////// -#Last modified: 21/july/2012 by cassio@ime.usp.br +#Last modified: 22/aug/2012 by cassio@ime.usp.br # # parameters are: # $1 main_class # $2 input_file # $3 timelimit (limit to run all the repetitions, by default only one repetition) # $4 number_of_repetitions_to_run (optional, can be used for better tuning the timelimit) -# $5 maximum allowed memory (in KBytes) +# $5 maximum allowed memory (in MBytes) +# $6 maximum allowed output size (in KBytes) # # the output of the submission should be directed to the standard output # @@ -108,10 +109,16 @@ if [ "$4" != "" ]; then nruns=$4 fi fi -maxm=512 +maxm=512000 if [ "$5" != "" ]; then if [ "$5" -gt "0" ]; then - maxm=${5} + maxm=${5}000 + fi +fi +maxf=1024 +if [ "$6" != "" ]; then + if [ "$6" -gt "0" ]; then + maxf=${6} fi fi @@ -136,7 +143,7 @@ if [ ! -x \$java ]; then exit 47 fi export CLASSPATH=.:./run.jar:$CLASSPATH -$sf -r$nruns -t$time -T$ttime -istdin0 -F256 -u256 -ostdout0 -estderr0 -U$bocau -G$bocag -n0 -C. -f20000 -d20000000 -m20000000 -- \$java -Xmx${maxm}M -Xms${maxm}M "$name" +$sf -r$nruns -t$time -T$ttime -istdin0 -F256 -u256 -ostdout0 -estderr0 -U$bocau -G$bocag -n0 -C. -f20000 -d20000000 -m20000000 -- \$java -Xmx${maxm}K -Xms${maxm}K "$name" echo \$? > runit.retcode if [ ! -d /bocajail ]; then /bin/umount /proc 2>/dev/null @@ -157,7 +164,7 @@ else echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2 echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2 echo "CODE NOT BEING CHROOTED. DO NOT RUN THIS ON THE MAIN SERVER" >&2 - $sf -r$nruns -t$time -T$ttime -istdin0 -F256 -u256 -U$bocau -G$bocag -ostdout0 -estderr0 -n0 -C. -d20000000 -m20000000 -- $java -cp run.jar -Xmx${maxm}M -Xms${maxm}M "$name" + $sf -r$nruns -t$time -T$ttime -istdin0 -F256 -u256 -U$bocau -G$bocag -ostdout0 -estderr0 -n0 -C. -d20000000 -m20000000 -- $java -cp run.jar -Xmx${maxm}K -Xms${maxm}K "$name" ret=$? fi if [ $ret -gt 10 ]; then |