-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Package:Openfoam Propose new variant for precision #37588
Description
The precision_option in the bashrc file can be checked with the following three options, and we must select only one of them.
# [WM_PRECISION_OPTION] - Floating-point precision:
# = DP | SP | SPDP
export WM_PRECISION_OPTION=DP
However, in the variants section, float32 and spdp are specified as boolean options:
if "+spdp" in spec:
self.precision_option = "SPDP"
elif "+float32" in spec:
self.precision_option = "SP"If the condition +spdp is false and +float32 is false, then the precision_option is "DP"
If I want to ensure that the user selects only one option among "SP", "DP", and "SPDP" for the precision_option, I can make the following changes:
- Remove the boolean options
+float32and+spdpfrom thevariantssection. - Add a new
precisionvariant that allows the user to choose between "SP", "DP", and "SPDP". The default value can be set to "DP".
Here's an updated version of the code snippet:
# WM_PRECISION_OPTION
if "+precision=SP" in spec:
self.precision_option = "SP"
elif "+precision=DP" in spec:
self.precision_option = "DP"
elif "+precision=SPDP" in spec:
self.precision_option = "SPDP"
else:
self.precision_option = "DP" # Default valueBy making these changes, we provide clear options for the precision_option and avoid the possibility of accidentally selecting both "SP" and "DP" options.
However, please note that removing the float32 and spdp variants may cause confusion for existing users who are familiar with those options. It's important to consider the impact on existing configurations and communicate any changes effectively to the users.
I would appreciate it if anyone could give me its opinion."