Skip to content

Fix the code coverage for mpi error paths#101

Merged
danielhollas merged 1 commit intomasterfrom
mpi-coverage
Mar 31, 2022
Merged

Fix the code coverage for mpi error paths#101
danielhollas merged 1 commit intomasterfrom
mpi-coverage

Conversation

@danielhollas
Copy link
Copy Markdown
Contributor

@danielhollas danielhollas commented Mar 31, 2022

Follow-up on #97. Do not call MPI_Abort() for TC-MPI interface, since it screws up code coverage for some reason (very strange 😱), and it is not needed anyway since we only have one MPI process.

Add a test case for failing REMD.

Also minor cleanup in remd_init().

@danielhollas danielhollas added the testing Any changes to Github Actions or testing scripts. label Mar 31, 2022
@danielhollas danielhollas self-assigned this Mar 31, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 31, 2022

Codecov Report

Merging #101 (f14c422) into master (3d8283b) will increase coverage by 0.82%.
The diff coverage is 53.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #101      +/-   ##
==========================================
+ Coverage   85.24%   86.06%   +0.82%     
==========================================
  Files          42       42              
  Lines        5821     5813       -8     
==========================================
+ Hits         4962     5003      +41     
+ Misses        859      810      -49     
Impacted Files Coverage Δ
src/remd.F90 86.85% <50.00%> (+3.79%) ⬆️
src/mpi_wrapper.F90 83.75% <75.00%> (+7.50%) ⬆️
src/init.F90 77.09% <0.00%> (+2.62%) ⬆️
src/force_tera.F90 95.52% <0.00%> (+2.98%) ⬆️
src/tera_mpi_api.F90 99.41% <0.00%> (+10.52%) ⬆️

Do not call MPI_Abort for TC MPI interface,
since it screws up code coverage, and it is
not needed anyway since we only have one MPI process.

Add a test case for failing REMD.
@danielhollas danielhollas requested a review from suchanj March 31, 2022 01:47
@danielhollas danielhollas changed the title Try to fix the code coverage for mpi error paths Fix the code coverage for mpi error paths Mar 31, 2022
Comment thread src/mpi_wrapper.F90
! For REMD, we need to ensure that all replicas are stopped,
! so MPI_Abort is safer.
if (error_code /= 0 .and. get_mpi_size() > 1) then
call MPI_Abort(MPI_COMM_WORLD, error_code, ierr)
Copy link
Copy Markdown
Contributor Author

@danielhollas danielhollas Mar 31, 2022

Choose a reason for hiding this comment

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

This line is in fact covered by the new REMD test case, but Codecov does not see it. I Guess that MPI_Abort is so aggressive that it somehow stops the code coverage generation prematurely.

@danielhollas danielhollas marked this pull request as ready for review March 31, 2022 01:58
@danielhollas danielhollas merged commit f857ec8 into master Mar 31, 2022
@danielhollas danielhollas deleted the mpi-coverage branch March 31, 2022 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Any changes to Github Actions or testing scripts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants