Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelize MatchRunner #6

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stephenbush-wf
Copy link

@bovard Code Review

Problem

Summary

There were problems when trying to parallelize matches because each match was reading/writing from the same config file which is re-written for each game, so:

  • first thread writes to config file
  • first game begins running with specified settings
  • second thread re-writes config file
  • second game begins running with specified settings
  • first game finishes, reads config file to match winning Team (A/B) to teams playing, but config file has changed since it started, and wrong team is reported as winner.

Areas of Impact

  • Config management
  • Match Running
  • Replay watching
  • General all-around archon functions

Solution

Each thread now runs with its own dedicated config file which (should) remain undisturbed until the match is run, completed and reported, and then it runs the next game with that file.

Also provided a dedicated default config file (no longer bc.conf) so that players are free to manipulate their own default settings without archon changing/overwriting them. Consequently, I also removed the config cleaner, because archon has a dedicated config file now that shouldn't need to be cleaned.

How to QA/+10

  1. Run matches with -p [numThreads] // --processes [numThreads] flag! Verify that games and results appear to run as expected.

@bovard
Copy link
Owner

bovard commented Feb 1, 2016

Looks good! I'll give it some testing tonight/tomorrow.

Glad that we are no longer messing up bc.conf

@stephenbush-wf
Copy link
Author

Me too!! I had to manually back it up and put it back whenever i used archon :)

Only problem i'm seeing now is a big list of config files left around. Might need to add something to delete the files created by the runner before the thread exits. Though there's no guarantee it would run if the user cancels archon early, and the files would be left anyway.... Idk.

@BNoohi
Copy link

BNoohi commented Oct 26, 2016

Will this be merged in? And, on that note, is there intention to maintain this repo for battlecode2017?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants