Tags:
create new tag
view all tags
This page is for information about how to run a contest at UBC using pc2server.

Gotchas

  • If the machine that the judging is happening on is heavily loaded (which can happen to the 011 machines via students ssh'ing in), then there can be TLEs on the judging machine that don't happen on the local machine.
  • There is some file length limit when judging, which can cause incorrect output if you've grabbed a contest from somewhere else.
  • If you need to run the code by hand, look in pc2v87/execute for the currently judged run.

Checklist

On the server (e.g. cascade):
  • Find/make a pc2 executables directory. Let's call that directory $SERVERDIR. Ducky has hers in ~duckys/ubcacm/pc2v87; you can also download the pc2v87 package to whereever you want.
  • Edit $SERVERDIR/pc2v8.ini. We generally use cascade.cs.ubc.ca port 50002; there is a sample ini file at the bottom of this page that has worked in the past.
  • run ./pc2reset
  • run ./pc2server

On the client (e.g. one of the 011 machines; account id/pw are passed on via oral tradition only):

  • Copy the ini file from the server (e.g. scp name@cascade.cs.ubc.ca:ubcacm/pc2v87 .)
  • Copy the input/output data from whatever site you found it on to someplace locally, let's call that $DATADIR. Note that if you are having trouble with disk space, you can put that in /tmp. (You will specify the directory from pc2admin.)
  • Run $SERVERDIR/pc2admin.
    • The user/password at startup is root/root.
    • Go to the Accounts tab.
      • Change the root password; select the "Manage Accounts" radio button, "Admin" from the Account Type dropdown menu, select "root", select Edit.
      • Generate accounts from the Accounts tab. You need at least one judge, one board, and at least one team. If you think you will have N teams show up, you should probably make N+m team accounts -- it doesn't cost anything to make extras. It's nice if you can put the team name in, but not critical. Note that there is a way to batch-import the teams. TODO remember/figure out how and document it.
    • Go to the Problems tab.
      • For each problem, do the following (by hand, ugh):
        • Add
        • enter problem name
        • enter timeout (which should vary; 120 is usually a large upper bound)
        • Put a check in the "Problem Requires Input Data" box
        • For Team Input Reads From... select Stdin
        • Browse for the input data file
        • Put a check in the "Judges Have Provided an Answer File"
        • Browse for the output data file
        • Click on the Validator tab
        • Select "Use PC^2 Validator" radio button
        • Select option 1 - diff from the dropdown menu
        • Make sure "Show Validation to Judges" is selected
        • Press the Update button.
    • Go to the Languages tab.
      • For each of Java, GNU C, and GNU C++
        • Select the language from the pulldown menu
        • Press the Update button.
    • Change the passwords for the judge and board if you so choose.
    • Let pc2admin run.
  • Run $SERVERDIR/pc2judge; the default account/pw is judgeN/judgeN e.g. judge1/judge1.
    • click on the "Enable Autojudge" button
    • click on the "Edit Auto Judge Settings" button
    • Select which problems you want autojudged. Note that before you can autojudge a problem, you have to set a verifier via pc2admin.
      • If one of the output data files is too big (524325 seems to be the limit), the submitted code won't be able to make a file that big, so they will get wrong output. Check the size of the reference/golden/hidden output files.
    • If you need to check a run, look in $SERVERDIR/execute. You can run the submissions by doing something like
      • cd $SERVERDIR/execute
      • ./submissionFile < data.in > /tmp/x
      • diff data.out /tmp/x
      • You can also use the -b option to ignore whitespace
      • You can use dos2unix if the input file has \r (^M) at the end of the file; that will strip off the end character. Do that on a copy of the data.out file.
    • Let pc2judge run.
  • Run $SERVERDIR/pc2board; the default account/pw is boardN/boardN.
    • This will create files in $SERVERDIR/html; the board we usually use is at $SERVERDIR/html/sumtime.html.
    • Let pc2board run.

On a web server (Ducky uses cascade):

  • Copy the problem statement to someplace visible, let's call that $WEBDIR. (Ducky puts them in cascade:~duckys/World/contest/practices/YYYYMMDD.pdf.)
  • Remember to give the problems read access (e.g. chmod a+r foo.pdf) before the contest starts.
  • Optionally edit a web page to make a link to the problems. Ducky puts a link on her programming team page.
  • Optionally do something to get the scoreboard onto a web server, and make a link to it from the contest page.

I installed Boa on acm1; we can use that in the future to serve up the scoreboard and so on. TODO -- document that more thoroughly.

Other sites

Other sites have information on how to run a contest.

Sample pc2v8.ini

[client]
debuglevel=13
consolelevel=5
site=UBC Local
server=cascade.cs.ubc.ca:50002
[server]
debuglevel=13
consolelevel=5
site=UBC Local
remoteServer=cascade.cs.ubc.ca:50002
[team]
[admin]
useTeamAndSchoolName=true

-- DuckySherwood - 19 Jan 2008

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r3 - 2008-02-09 - DuckySherwood
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback