This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
- Author: Keith Johnson, kjohns07@my.fit.edu | |
- Course: CSE5400, Spring 2011 | |
- Project: endo1 | |
-} | |
module Main where | |
import Text.Printf | |
main :: IO() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS_GHC -Wall -O2 #-} | |
module Main where | |
main :: IO() | |
main = interact (solve . readTestCases) | |
-- This builds a list of lists representing the problem | |
readTestCases :: String -> [[Int]] | |
readTestCases = parse 1 . map read . words |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling failed with exitcode 134, compiler output: | |
/opt/judgehost/bin/runguard: verbose: watchdog using user ID `999' | |
/opt/judgehost/bin/runguard: verbose: using timelimit of 30.000 seconds | |
/opt/judgehost/bin/runguard: verbose: setting filesize limit to 67108864 bytes | |
/opt/judgehost/bin/runguard: verbose: disabling core dumps | |
/opt/judgehost/bin/runguard: verbose: reset user ID to `999' for command | |
boolfind-test-correct.c: In function 'main': | |
boolfind-test-correct.c:23:7: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] | |
boolfind-test-correct.c:27:8: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] | |
boolfind-test-correct.c:35:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From fa9abfec5db30585f8c5f03e19e3448fc7c7a31b Mon Sep 17 00:00:00 2001 | |
From: Keith Johnson <kj@ubergeek42.com> | |
Date: Sat, 23 Mar 2013 11:24:19 -0400 | |
Subject: [PATCH] Use cgroups to provide memory limits in runguard | |
--- | |
configure.ac | 5 ++- | |
judge/Makefile | 2 +- | |
judge/runguard.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++---- | |
paths.mk.in | 3 ++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/judge/judgedaemon.main.php b/judge/judgedaemon.main.php | |
index e9fefb4..a65b9a4 100644 | |
--- a/judge/judgedaemon.main.php | |
+++ b/judge/judgedaemon.main.php | |
@@ -101,6 +101,8 @@ while( !$exitsignalled ) | |
$row = $DB->q('MAYBETUPLE SELECT * FROM judgehost WHERE hostname = %s' | |
, $myhost); | |
if ( ! $row ) { | |
+ // self register the judgehost | |
+ $DB->q('INSERT INTO judgehost SET hostname = %s, active = 1', $myhost); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ADA compile wrapper-script for 'compile.sh'. | |
# See that script for syntax and more info. | |
DEST="$1" ; shift | |
MEMLIMIT="$1" ; shift | |
MAINSOURCE="$1" | |
# -static: Static link with all libraries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Script to generate a minimal chroot environment with Oracle (Sun) Java | |
# support to allow for Java programs to run in a chroot. | |
# | |
# This script downloads and installs a Ubuntu base system. | |
# Minimum requirements: a Linux system with glibc >= 2.3, wget, ar and | |
# a POSIX shell in /bin/sh. About 250 MB disk space is needed. It must | |
# be run as root and will install the Debian debootstrap package. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 989e3790855bbca25a26dcaca7c0174689d5fd69 Mon Sep 17 00:00:00 2001 | |
From: Keith Johnson <kj@ubergeek42.com> | |
Date: Fri, 24 May 2013 10:44:21 -0400 | |
Subject: [PATCH] Minor bugfixes | |
lib.database needs to handle another error code, it changes based on | |
mysql version. | |
team_affiliation was changed to use a MAYBETUPLE so that the error | |
check that occurs on the next line actually works. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/etc/cgroup-domjudge.conf.in b/etc/cgroup-domjudge.conf.in | |
index 1d6cb42..b7f3415 | |
--- a/etc/cgroup-domjudge.conf.in | |
+++ b/etc/cgroup-domjudge.conf.in | |
@@ -18,4 +18,11 @@ group domjudge { | |
memory { | |
# This section is an empty stub: the limits are set by runguard. | |
} | |
+# Change the cpuset.cpus line to a range specifying the cores you are | |
+# going to use. e.g. if you have a quad core machine, set cpuset.cpus = 0-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 2622a5aedf455abf1e6cbfffd2d7704065923186 Mon Sep 17 00:00:00 2001 | |
From: Keith Johnson <kj@ubergeek42.com> | |
Date: Tue, 18 Jun 2013 12:26:42 -0400 | |
Subject: Allow multiple judgedaemons on a single machine | |
Add support for running multiple judgedaemons at once on a single | |
machine. This allows for better use of multiple cpu cores. To provide | |
for better isolation between the judegdaemons, the cpuset cgroup support | |
is used to limit processes to a single cpu core. | |
--- |
OlderNewer