ESMCI / cime

Common Infrastructure for Modeling the Earth
http://esmci.github.io/cime
Other
161 stars 206 forks source link

BUILD_THREADED or SMP_PRESENT #4544

Closed jedwards4b closed 9 months ago

jedwards4b commented 9 months ago

It seems that there is a confusion in the usage of these two variables and I think that we should remove one of them. A grep of BUILD_THREADED in the CESM source tree reveals that it is used in a number of components and libraries but does not seem to be used in cime, so I propose removing this variable and replacing it with SMP_PRESENT throughout.

billsacks commented 9 months ago

I like the idea of consolidating these into a single variable. Would it be reasonable to keep BUILD_THREADED instead of SMP_PRESENT? I feel like BUILD_THREADED is a much more intuitive variable name – for me anyway.

jedwards4b commented 9 months ago

I can make it BUILD_THREADED.

cacraigucar commented 9 months ago

CAM does not appear to currently use either of these. I do second the current thinking of using BUILD_THREADED as the the variable moving forward.

ekluzek commented 9 months ago

I certainly endorse reducing this to one. The CS side of me thinks that SMP (Shared Memory Parallelism) is more correct and general. But, I think that @cacraigucar and @billsacks are correct in that BUILD_THREADED is more understandable at first glance. I also think that one of the things you want to be able to do is to have BUILD_THREADED==TRUE even with NTHRDS==1, for certain types of debugging. So as long as you can do that.

Is there any history of why there are two? Is there some small difference between them? Not that you shouldn't consolidate, but always good to check if there was some reason for this, so it doesn't come back...

jedwards4b commented 9 months ago

@ekluzek We have another variable for testing with NTHRDS==1, FORCE_BUILD_SMP.

billsacks commented 9 months ago

Part of why I suggested BUILD_THREADED is that I always thought SMP stood for Symmetric MultiProcessing (e.g., see the top hits when you search for "computer science smp"). I don't actually know what that means, but it seems to have something to do with threading, so I convinced myself that there was some connection between Symmetric MultiProcessing and OpenMP-based threading, and never understood why we use this weird term. Erik's spell-out of Shared Memory Parallelism makes so much more sense... but then I'd still argue that this illustrates the problem with using SMP, in that it doesn't really tell you what it is and is open to misinterpretation.

billsacks commented 9 months ago

And thank you @jedwards4b for taking on this cleanup!