riebl / artery

OMNeT++ V2X simulation framework for ETSI ITS-G5
GNU General Public License v2.0
203 stars 131 forks source link

Enable opp_runall in Docker container #198

Closed marecabo closed 3 years ago

marecabo commented 3 years ago

Currently, the Docker container can only run one run at a time because it starts OMNet++ with opp_run. This change allows to also use the python script opp_runall (see 11.20.2 Using opp_runall) inside the container to run multiple runs of a config in parallel.

If arguments -j and/or -b are passed to the container, opp_runall is called instead of opp_run with them. Pass --all to use opp_runall without specifying any values for -j or -b (use their defaults, e.g. all available cores).

Example

cd /path/to/artery/

# build image
docker build \
  --tag artery \
  .

# prepare scenario
cp -r extern/veins/examples/veins scenarios/artery/
# remove "../../extern/veins/examples/" from line 14 of omnetpp.ini

# start simulation
docker run -d \
  --name artery \
  --user $(id -u):$(id -g) \
  -v "$(pwd)/scenarios/artery":/scenario \
  -v "$(pwd)/results":/results \
  artery \
  -c envmod -j2  # this will run up to 2 runs of the envmod config in parallel
marecabo commented 3 years ago

opp_runall is a Python script, that generates Makefiles which execute the runs. Thus, we need both in the run stage.

Edit: Just saw your other comments, will address them soon. All answered.

riebl commented 3 years ago

I have slightly revised your commit and merged it as 722de76. Thanks for your contribution!