aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.0/doc/problemexamples/problemtemplate/run
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2012-08-22 14:39:03 +0000
committercassiopc <cassiopc@gmail.com>2012-08-22 14:39:03 +0000
commitfc7990c62d85fdebef4a438a1fbc9d69a3710d55 (patch)
treeba6e1a305b0e63fbeb719e1a682c8e5e578b726e /boca-1.5.0/doc/problemexamples/problemtemplate/run
parent059e2fdcf0cef7e3594a66e21b3fd682ac736856 (diff)
downloadboca-fc7990c62d85fdebef4a438a1fbc9d69a3710d55.tar.gz
boca-fc7990c62d85fdebef4a438a1fbc9d69a3710d55.zip
small bug fixes, inclusion of file size limit configurable
Diffstat (limited to 'boca-1.5.0/doc/problemexamples/problemtemplate/run')
-rwxr-xr-xboca-1.5.0/doc/problemexamples/problemtemplate/run/c13
-rwxr-xr-xboca-1.5.0/doc/problemexamples/problemtemplate/run/cpp17
-rwxr-xr-xboca-1.5.0/doc/problemexamples/problemtemplate/run/java19
3 files changed, 35 insertions, 14 deletions
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