DSL Element: resource
Every simulation has to manage resources such as a model executable, DLLs, parameter files, climate data input, documentation, etc. The resource element allows the listing of those resources. There are several uses for the resource listings in a simulation.
- All jar files listed in a resource element are added to the classpath for JAVA model execution. Jar files can be referenced as local files or URLs, if the model should be loaded from a remote location. If no Jar files are present, the model will use the default class path for the application.
- All files regardless of which type are used for digest computation to ensure comprehensive hashing of all simulation resources.
- Other tools for remote execution within a cluster can use the resource listing to copy those files to other machines.
A resource section of a simulation might look like:
sim(name:"ceap") {
//
resource "$oms_prj/dist/oms3.prj.ceap.jar"
resource "$oms_prj/dist/oms3.prj.ceap-lib.jar"
resource "$oms_prj/input/climate.csv"
}
The resource values always follow the resource keyword. It also shows the use of string replacement in order to reference a common root directory. Alternatively the files above can be provided as a list to one resource element. Note the required brackets and parenthesis). Both notations do have the same semantics.
...
resource (["$oms_prj/dist/oms3.prj.ceap.jar",
"$oms_prj/dist/oms3.prj.ceap-lib.jar",
"$oms_prj/input/climate.csv"])
...
Element resource
Name |
resource - List all relevant simulation resource files |
Value | Description | Type | Required |
<single file> | A file belonging to this simulation | String (file or URL) | As necessary |
<file list> | All files belonging to this simulation | List of Strings (file or URL) | As necessary |
Notes
- A resource element must have either have a single file value or a list of files.
- The resource element should at least list all .jar, .exe, .dll files that are needed for execution.
- Listed files should provide the full path.
- The resource element of a sim element and a model element are shared.