Substitution Variables - pc2ccs/pc2v9 GitHub Wiki

Overview

There are a number of places in PC2 which support the notion of "Substitution Variables". These are variables that are defined as "templates" during configuration, and are replaced (substituted) with specific values at runtime.

Substitution variables consist of a name preceded by a open curly brace and colon and followed by a closing curly brace; for example: {:language}. For this example, in any configuration item which supports variable substitution of languages, the appearance of {:language} would be replaced by the identifier of the currently-specified programming language.

The following table lists the substitution variables supported by PC2. Note that not all substitution variables are supported in all configuration locations; for example, {:teamname} will be substituted with the current team's name in configuration elements related to scoreboard displays, but {:teamname} is meaningless when configuring an Output Validator (and hence would just be treated as a literal string).

Recognized substitution variables.

Note that in all cases the name shown in the following tables must be preceded by {: and followed by } to be recognized as a substitution variable.

Submission execution substitution variables

These variables are substituted on the command line used to execute a submission.

Name Description
ansfile The name of the answer file for the FIRST test case defined for the current problem (a legacy variable).
ansfilename The name of the answer file for the CURRENT test case during execution of repeated test cases ("runs") of a submission.
basename The "basename" of the submission file, with file path and file name extensions removed.
clientid The Id number of the client making the submission; e.g., for Team 3 this will be 3.
clienttype The type of client making the submission; e.g., "Team" or "Administrator".
elapsedms The contest time at which the submission was received, in msec.
elapsedsecs The contest time at which the submission was received, rounded DOWN to the nearest whole second.
elapsedmins The contest time at which the submission was received, rounded DOWN to the nearest whole minute.
executetime The amount of time which a test case took to execute, in msec.
exitvalue The exit code returned by the execution of a test case.
filelist A list of the files included in a submission.
infile The name of the input data file for the FIRST test case defined for the current problem (a legacy variable).
infilename The name of the input data file for the CURRENT test case during execution of repeated test cases ("runs") of a submission.
language The PC2 identifier (number) of the language used in a submission.
languageletter A letter associated with the language for the submission (the first language is "A", the second "B", etc.).
languagename The literal string name of the language used in a submission.
mainfile The name of the submission main file.
options A list of options including -p <problemShortName, -l <languageDisplayName>, -u <submittingClientNumber>, -m <mainfilename., -i <runIdNumber>, -t <elapsedTimeMS>
outfile The name of the output file produced by a test case execution ("run").
pc2home The location of the PC2 installation.
problem The PC2 internal number identifying the problem.
problemletter The letter associated with the problem ("A", "B", ...)
problemshort The "short name" of the problem.
runid The submission Id number.
irunid The internal PC2 submission (run) Id; used when a submission comes from another CCS.
siteid The PC2 site number of the client which submitted a submission.
teamid The Id number of the team making the submission.
timelimit The time limit to be applied to each test case execution ("run"), in seconds.
validator The validator command which is used to validate the output of the submission.

Scoreboard substitution variables

These variables are substituted on scoreboard displays.

Name Description
clientnumber The PC2 client Id; e.g., "3" for Team 3.
countrycode The 3-letter country code for the team (only available if loaded from an external source such as the ICPC Contest Management System).
externalid An external Id associated with the team, for example from the ICPC CMS.
groupname The name of the group with which a team is associated.
groupid The PC2 Id number of the group with which a team is associated.
longschoolname The full name of the school with which a team is associated; e.g. "California State University, Sacramento".
shortschoolname The short name of the school with which a team is associated; e.g. "CSUS".
sitenumber The PC2 site number to which a team is connected (logged in).
teamloginname The PC2 login name for a team, e.g. "team534".
teamname The name of a team, e.g. "Hornet Top Coders".

Note: the preceding tables are currently incomplete (like many projects, the documentation lags behind the code). Some additional keywords which are supported (but not documented in the above tables) include package, keywords to manage "sandboxes" (sandboxprogramname, sandboxcommandline), along with testcase, ensuresuffix=xxx, memlimit, resfile, and executeinfofilename.