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

Use ccache for CI #977

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Use ccache for CI #977

wants to merge 11 commits into from

Conversation

davidbeckingsale
Copy link
Member

Summary

  • This PR is a feature, it enables ccache during CI builds to speed up compilation.

@davidbeckingsale
Copy link
Member Author

LGTM

@rhornung67
Copy link
Member

@davidbeckingsale it looks like the issue is related to directory permissions for gitlab ci

@rhornung67
Copy link
Member

LGTM

Copy link
Member

@rhornung67 rhornung67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this. Will it help speedup intel builds?

Copy link
Member

@adrienbernede adrienbernede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some questions.

if [[ ${sys_type} == *toss_3* ]]; then
cmake \
-DENABLE_CCACHE=ON \
-DCCACHE_DIR=/collab/usr/global/tools/ccache/toss_3_x86_64_ib/ccache-4.2/bin/ccache \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does ccache work well with a single location that may be targeted by several builds simultaneously? (Maybe it creates a unique subdir per configuration hash?)
Also, in the log I see:

CMake Warning:
  Manually-specified variables were not used by the project:
    CCACHE_DIR

Are we sure this is taken into account by BLT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that's the binary location, not the location of the data...

Then, where is the data stored? If it's in the working directory, then I'm afraid this won't help much. That's because the working directory changes with the runner hash, the job rank on the runner (0 to 7), and then we have no guarantee that the same target will be rebuilt there.

This is not a lost cause though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a typo in my BLT changes :D and we can change the location via a config file. I am trying to work out the best way to set up the config, I think we will need to it via env var.

@trws
Copy link
Member

trws commented Mar 13, 2021 via email

@trws
Copy link
Member

trws commented Mar 14, 2021

I went through and reminded myself of the usual options. We probably want to play with the sloppiness settings (especially the ctime and mtime sloppiness since files are going to have different times constantly) but for now just adding CCACHE_TEMPDIR=<some temp location> should be a help for performance and easy enough to do. Just point to /tmp is probably fine and we can investigate the rest as we get some data after merging it in.

@adrienbernede
Copy link
Member

/tmp is local to each node right? The node used for CI will change constantly, except if we decide to always use the same for a given job.

@trws
Copy link
Member

trws commented Mar 26, 2021 via email

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.

None yet

4 participants