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

--threads flag doesn't seem to be used. #115

Closed
Icantjuddle opened this issue Sep 20, 2023 · 11 comments
Closed

--threads flag doesn't seem to be used. #115

Icantjuddle opened this issue Sep 20, 2023 · 11 comments

Comments

@Icantjuddle
Copy link

I passed --threads=30 but htop and ps -T -p seem to show only a single thread running. Is this expected?

@Waqar144
Copy link
Collaborator

Yes.

I have a multiprocess script that is not public, will publish it soon.

@Icantjuddle
Copy link
Author

Thanks @Waqar144, much appreciated!

@Icantjuddle
Copy link
Author

@Waqar144 is the general idea to split the compile_commands.json into individual documents and run on each on them separately and point them to the same data dir?

@Waqar144
Copy link
Collaborator

@Icantjuddle yes. But things are a bit more complicated when it comes to writing out to the output folder. The script lives here if you want to try: https://github.com/KDAB/codebrowser/blob/master/scripts/runner.py

@Icantjuddle
Copy link
Author

Sounds good, giving it a try; thanks for pushing it!

@Icantjuddle
Copy link
Author

It mostly worked, the one issue I had was that there were a few files that seemed to be indexed repeatedly despite only showing up once in the compile_commands.json file.

@ogoffart
Copy link
Contributor

But things are a bit more complicated when it comes to writing out to the output folder

I just make a comment to #88 (comment) with some ideas on how to improve things in that respect.

@Waqar144
Copy link
Collaborator

@Icantjuddle please try with latest master, a critical patch to make the runner script work correctly was missing. Should also fix the build issue you had.

@Icantjuddle
Copy link
Author

Icantjuddle commented Sep 27, 2023

Thanks, build is fixed, I'm still having some issues with duplicate entries in the fileIndex but a sort <fileIndex| uniq | sponge fileIndex seems to fix the issues.

Interestingly, only headers end up with duplicate entries, even though I've verified that there are not duplicates in the compile_commands.json.

@Waqar144
Copy link
Collaborator

I'm still having some issues with duplicate entries in the fileIndex

That is expected as multiple processes may end up appending to the file. It is easy to fix, we just need to append to a different file for each process and combine everything at the end.

Interestingly, only headers end up with duplicate entries, even though I've verified that there are not duplicates in the compile_commands.json

Compile commands only contains entries for .cpp files, header files are processed as a result of parsing a .cpp file and two cpp files can have similar headers which is why there are duplicate entries for headers only.

@Icantjuddle
Copy link
Author

Interestingly, only headers end up with duplicate entries, even though I've verified that there are not duplicates in the compile_commands.json

Compile commands only contains entries for .cpp files, header files are processed as a result of parsing a .cpp file and two cpp files can have similar headers which is why there are duplicate entries for headers only.

I do have entries for headers in my compile_commands.json since it helps with header only libraries when used with language servers.

Thank you for all your help with this!

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

No branches or pull requests

3 participants