-
Notifications
You must be signed in to change notification settings - Fork 505
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
MoveMapGenerator: add proper multithreading support #2827
Conversation
I guess when it’s run from |
@mserajnik can you maybe give it try and confirm that mmap_extract.py now works as expected? |
@schell244 Currently not at home, but I’ll give it a try later today or tomorrow at the latest! |
I'm building Docker images off of this PR right now and will test it tomorrow morning. In the meantime, because it came to my mind: one could make the argument to remove the
|
Yeah, maybe instead of |
The Python script would need to use However, other than that I quite like the idea; so if you pass |
contrib/mmap/mmap_extract.py
Outdated
@@ -115,7 +115,7 @@ def get_subprocess_config() -> SubprocessConfig: | |||
def run_move_map_gen(map_id: int) -> None: | |||
config = get_subprocess_config() | |||
subprocess.check_call( | |||
(config.executable, str(map_id), "--silent", *sys.argv[1:]), | |||
(config.executable, str(map_id), "--silent", "--threads", "1", *sys.argv[3:]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*sys.argv[1:]
has to stay as it is; this has nothing to do with the added --threads 1
, it just passes along the arguments that the Python script itself was invoked with, e.g., when running it like this to select the configuration and offmesh:
/opt/vmangos/bin/Extractors/mmap_extract.py \
--configInputPath /opt/vmangos/bin/Extractors/config.json \
--offMeshInput /opt/vmangos/bin/Extractors/offmesh.txt
First of all, I added a comment (see above) because you cut off the Python script arguments with your change (that should be fixed), but that's probably not the root cause of the following: I just tried it, but unfortunately it's not working when running Can you confirm that |
Thanks a lots for testing it! I'll adapt the Python script arguments accordingly. I just re-checked starting the process from windows cmd with
|
Thanks for confirming, I'll retest this again then (tomorrow probably) with the |
I was finally able to try that now and can see the following output:
So each of the 8
(On a sidenote, it probably shouldn't log anything with the If I remove the
Edit 2: Actually, looking at the code, it seems like it should be done processing here after all and should exit; so maybe my first statement was right after all. I'm just confusing myself at this point, so I'll leave it at that. 😆 So I'm not sure why this is working for you but not for me; it has always worked fine before these changes. |
Thanks a lot for the testing efforts! I am currently also a bit time-constrained, but I will take care of it in the next days and will try to figure out whats causing problems. |
Hi @mserajnik, |
Cool, thanks a lot for your help getting this right! |
🍰 Pullrequest
Allow mmap extraction to run properly multi threaded.
No changes have been made to the extraction logic itself, some funtions where just moved into TileWorker to run asynchronous.
Depending on the cpu, mmaps can now be build in <1 hour.
How2Test
Todo / Checklist