CCS Enhancements

From PC2wiki
Revision as of 17:36, 18 December 2016 by Doug Lane (talk | contribs) (Load Data Files: updated description)
Jump to: navigation, search

The following are PC² additions to the CLICS specification.

Additions to contest.yaml file

The following are additions to the contest.yaml file format described in the CLICS specification .

Sites Section

The sites section defines all fields for each pc2 server/site

sites:
 - number: 1
     name: Site 1
       IP: 130.86.67.202
     port: 50002
 password: siteone

 - number: 2
     name: Site 2
       IP: 130.86.67.201
     port: 50002
number
site number
IP
site host or IP
port
port for server to listen on
password
if not present, then the default Joe password will be created. Ex. login: site2 password site2

Accounts Section

The accounts section defines team accounts, it has equivalent functionality to the Generate Accounts feature.

accounts:
 - account: TEAM
     site: 1
    count: 10
 
 - account: TEAM
     site: 2
    count: 10

- account: JUDGE
     site: 4
    count: 20

 - account: SCOREBOARD
     site: 4
    count: 1


Auto Judge

Automated Judging settings.

auto-judging:
  - account: JUDGE
     site: 1
     number: 2
     letters: A
     enabled: yes

  - account: JUDGE
     number: 4,5,6
     letters: B,C,D

  - account: JUDGE
     site: 2
     number: all
     letters: B,C,D

  - account: JUDGE
     site: 1
     number: 1,3
     letters: F
     enabled: no
site
the site number, default 1
number
the account number(s), use "all" to select all judges.
letters
the letter(s) for the problems to auto judge. Used "all" to select all problems.
enabled
whether auto judging is turned On, default yes

Minimum values are:

auto-judging:
  - account: JUDGE
     number: 7
     letters: E

Timeout

Global Setting.

The run-time execution time limit for all problems can be specified with the timeout key. A time limit can be overridden if a timeout is specified in the problem.yaml file.

# set run time limit for all problems to 20 seconds
timeout: 20


Languages

Example Section

languages:
 - name: Java
   active: true
   compilerCmd: 'javac -encoding UTF-8 -sourcepath . -d . {:mainfile}'
   exemask: '{:basename}.class'
   execCmd: 'java -client -Xss8m -Xmx2048m {:basename}'
   runner: 'java -client -Xss8m -Xmx2048m {:basename}'
   runner-args: 
   judge-exec-cmd: '/usr/bin/wrapper_java {:timelimit} {:basename}'

 - name: 'Perl'
   active: true
   compilerCmd: 'perl -c {:mainfile}'
   exemask: '{:noexe}'
   execCmd: 'perl {:mainfile}'
   runner: 'perl'
   runner-args: '{:mainfile}'
   interpreted: true
   use-judge-cmd: false
   judge-exec-cmd: 'perl {:mainfile}'

 - name: C++
   active: true
   compilerCmd: 'g++ -g -O2 -std=gnu++0x -static {:mainfile} '
   exemask: a.out
   execCmd: ./a.out
   runner: ./a.out
   runner-args: 
   judge-exec-cmd: '/usr/bin/wrapper_c {:timelimit}'

 - name: C
   active: true
   compilerCmd: 'gcc -g -O2 -std=gnu99 -static {:mainfile} -lm'
   exemask: a.out
   execCmd: ./a.out
   runner: ./a.out
   runner-args: 
   judge-exec-cmd: '/usr/bin/wrapper_c {:timelimit}'

 - name: Python
   active: true
   compilerCmd: 'python -m py_compile {:mainfile}'
   exemask: 
   execCmd: 'python {:mainfile}'
   runner: 
   runner-args: 
   interpreted: true
   judge-exec-cmd: '/usr/bin/wrapper_python {:timelimit} {:mainfile}'

 - name: Python 3
   active: true
   compilerCmd: 'python3 -m py_compile {:mainfile}'
   exemask: 
   execCmd: 'python3 {:mainfile}'
   runner: 
   runner-args: 
   interpreted: true
   judge-exec-cmd: '/usr/bin/wrapper_python3 {:timelimit} {:mainfile}'

Load Data Files

PC^2 stores all data files on the server machine by default. Storing the data files on the server is known as storing "internally".

A contest configuration package CDP can be loaded, and the config files can be copied to the judge machines. Not storing the data files on the server is called storing the files "external".

By default when a CDP (contest.yaml) is loaded the files are stored internally.

The load-data-files setting can be used to have pc2 load the files externally by setting the value to false. For example:

load-data-files: false

If files are external then all CDP files must by copied to the judge machine.

Example of load-data-files in contest.yaml

# Contest Configuration, version 1.0
#
# PC^2 Version: Version 9.3 20151021 (Wednesday, October 21st 2015 03:55 UTC) Java ver 1.7.0_51 build 3230 Windows 7 6.1 (amd64)
#
# Created: 2015-10-22 21:46:00 PDT

name: '2015 CSUS Fall Contest'
short-name: '2015 Fall Contest'
start-time: 2015-10-23 17:00
duration: 4:00:00
# freeze time before end of contest
scoreboard-freeze: 1:00:00

# use external CDP files
load-data-files: false
# by default store file internally 
# load-data-files: true

# Judge CDP config path
judge-config-path: /home/team/cdp/config


(One other way to specify external files is in the admin pc2v9.ini file, set [server] externalfiles=yes, but using load-data-files is preferable.

Judge CDP Path

For files that are external to pc2 a Judge's path may be needed.

Under some circumstances the external CDP files will be under a different directory on the judge than the admin. To specify a different directory use:

judge-config-path: /home/pc2/cdp/config

Via the Admin UI specify the value in the field Location for Judge CDP Config on the Problems tab.

Example of load-data-files in contest.yaml

# Contest Configuration, version 1.0
#
# PC^2 Version: Version 9.3 20151021 (Wednesday, October 21st 2015 03:55 UTC) Java ver 1.7.0_51 build 3230 Windows 7 6.1 (amd64)
#
# Created: 2015-10-22 21:46:00 PDT

name: '2015 CSUS Fall Contest'
short-name: '2015 Fall Contest'
start-time: 2015-10-23 17:00
duration: 4:00:00
# freeze time before end of contest
scoreboard-freeze: 1:00:00

# use external CDP files
load-data-files: false

# Judge CDP config path
judge-config-path: /home/team/cdp/config

Judgements

Use the judgements to load allowed judgement into the system.

Example section and values.

accepted-judgement:
 - Accepted

judgements:
 - Compilation Error
 - Run-time Error
 - Time-limit Exceeded - No output
 - Time-limit Exceeded - Wrong output
 - Time-limit Exceeded - Insufficient output
 - Time-limit Exceeded
 - Wrong Output
 - No Output
 - Incomplete Output
 - Excessive Output
 - Output Format Error
 - Other - Contest Staff
 - Illegal Function

Judging Types

Judging Settings

computer-judged: true
manual-review: false
send-prelim-judgement: false

The acceptable values are: true, false, yes and no. These values are case in-sensitive.

By default a CDP load will mark a problem as computer judged.

thus:

computer-judged: true

Additions to problem.yaml file

Problem Title / Name

In the CCS the Problem name (full name) is in the LaTex problem description (see problem.tex).

In PC^2 the problem name is added as a key/value pair name in the problem.yaml file. For example:

name: A - Good or Bad?

Limits Section

For each problem a Run Time Limit can be specified in the limits section

# use 15 seconds for this problem definition
limits: 
   timeout: 15

Input Section

PC² has the option for a team solution (Run) to send data to the team's stdin or the team solution reads from file.

input: 
  readFromSTDIN: false
readFromSTDIN
team solution reads from stdin, default is true

pc2submit script

Additional command and command line options can be used, they are:

  1. --help lists options and command line syntax
  2. --check check parameters, list filename, problem and language, do not submit.
  3. --list list contest problem and languages
  4. --listruns list run info for the user

See pc2submit for more details.

Run Submission Interface

A command line method to submit runs into pc2 that retains the run id and elapsed time

See Also