Skip to content

Conversation

@RemiLehe
Copy link
Contributor

By default, when performing several tests with regression_testing.py, the executable is recompiled from scratch for every test. The compilation can therefore dominate the time taken by the tests.

This PR proposes the avoid re-compiling the executable, if it was already compiled with the exact same options in a previous test. We are currently using this feature in order to same time in the Travis CI tests for WarpX.

In practice, this is done by:

  • Creating a new Build folder, where compiled executable are stored.
  • When running a new tests, comparing compiling options to those used in previous tests. If they match, the previous executable is retrieved from the Build folder. Note: this assumes that each executable name is unique ; i.e. that
    two sets of compiling options cannot produce the same executable name.

In order to obtain the string that contains compiling options, parts of the function build_c was extracted as a separate function.

This is done by:
- Storing compiled executable into a new "Build" folder
- When running a new tests, comparing compiling options to those used
in previous tests; it they match, the previous executable is retrieved
from the Build folder.

Note: this assumes that each executable name is unique ; i.e. that
two sets of compiling options cannot produce the same executable name.

In order to obtain the string that contains compiling options, part
of the function `build_c` was extracted as a separate function
@maximumcats
Copy link
Member

Remi, many of the codes require builds that are specific to a given regression test even when the same compiler options are used, since they have problem-specific setup routines. Does this change break that case? If not, great. If so, can it be made an option?

@zingale
Copy link
Member

zingale commented Jul 24, 2020

can this be opt-in? Based on some new flag like executable_names_are_unique? Because it is not the case with our codes that changing options gives a different executable name -- for instance in Castro, the nuclear reaction network, EOS, conductivity, integrator, ... all are not reflected in the executable name.

@RemiLehe
Copy link
Contributor Author

OK, thanks for the feedback!
Yes, I'll update the PR to make this behavior optional (deactivated by default).

@RemiLehe RemiLehe changed the title Avoid recompiling executable if already compiled in previous tests [WIP] Avoid recompiling executable if already compiled in previous tests Jul 24, 2020
@zingale zingale closed this Jul 25, 2020
@zingale
Copy link
Member

zingale commented Jul 25, 2020

oh sorry... I did the change from master to main, but that closed this. Can you reopen, targeting main?

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