Skip to content

Package:Openfoam Propose new variant for precision #37588

@kjrstory

Description

@kjrstory

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:

  1. Remove the boolean options +float32 and +spdp from the variants section.
  2. Add a new precision variant 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 value

By 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."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions