Skip to content

Work around MPI_set_attr error#54

Merged
benegee merged 3 commits intomainfrom
workaround_set_attr_error
Jul 14, 2023
Merged

Work around MPI_set_attr error#54
benegee merged 3 commits intomainfrom
workaround_set_attr_error

Conversation

@benegee
Copy link
Collaborator

@benegee benegee commented Jul 14, 2023

Hotfix, that hopefully can be removed again later.

JuliaParallel/MPI.jl#746

@benegee benegee marked this pull request as ready for review July 14, 2023 20:22
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #54 (a50eebd) into main (a5cea7b) will increase coverage by 0.71%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
+ Coverage   70.12%   70.83%   +0.71%     
==========================================
  Files           5        5              
  Lines         164      168       +4     
==========================================
+ Hits          115      119       +4     
  Misses         49       49              
Flag Coverage Δ
unittests 70.83% <100.00%> (+0.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
examples/simple_trixi_controller.c 85.36% <100.00%> (+0.75%) ⬆️
src/trixi.c 66.66% <100.00%> (+0.78%) ⬆️

@benegee benegee merged commit 5b7bf84 into main Jul 14, 2023
@benegee benegee deleted the workaround_set_attr_error branch July 14, 2023 20:56
Copy link
Member

@sloede sloede left a comment

Choose a reason for hiding this comment

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

Thanks a lot for providing this hot fix! Maybe you can also create an issue that lets us track this such that we cannot forget to fix it once there is a canonical solution available from MPI.jl.

// This would better be fixed using some functionality of MPI.jl
const char * call_MPI_run_init_hook =
"using MPI;\n"
"if MPI.Initialized() && MPI.JULIA_TYPE_PTR_ATTR[]==0;\n"
Copy link
Member

Choose a reason for hiding this comment

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

Since we are already tinkering with MPI.jl's internals here, why not use the internal variable that is set in run_init_hooks,

https://github.com/JuliaParallel/MPI.jl/blob/2a2bd68a6dc53660108bbc16690e4972de6318d5/src/MPI.jl#L55

to check if we need to run it again? That is, something like

      "if MPI.Initialized() && !MPI._finished_loading[];\n"

I am just concerned that this check might fail if JULIA_TYPE_PTR_ATTR is left == 0 by some MPI implementation.

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.

2 participants