Skip to content

Hardcoded precision with overwrite in make_ops #1076

@stloufra

Description

@stloufra

Once generated (by default) there is hardcoded:

─────┬───────────────
     │ File: Source/make_opts
─────┼───────────────
   1 │ override FPTYPE=m
   2 │ pdlabel1=
...

which later prevents compiling the check_sa.cc with e.g. make ... FPTYPE=f to be taken into account. However, there is already default option implementation:

─────┬───────────────
     │ File: src/cudacpp_config.mk
─────┼───────────────
...
  18 │ ifeq ($(FPTYPE),)
  19 │   # OLD DEFAULT UP TO v1.00.00 INCLUDED (inconsistent with default
     │  floating_type='m' in run_card.dat)
  20 │   ###override FPTYPE = d
  21 │   # NEW DEFAULT (#995) AS OF v1.00.01 (now consistent with default
     │  floating_type='m' in run_card.dat)
  22 │   override FPTYPE = m
  23 │ endif
...

I traced the source back to:

──────────────────────
     │ File: ./PLUGIN/CUDACPP_SA_OUTPUT/launch_plugin.py
─────┼────────────────
  75 │     def reset_makeopts(self, old_value, new_value, name):
  76 │         if not hasattr(self, 'path'):
  77 │             raise Exception
  78 │         if name == 'floating_type':
  79 │             common_run_interface.CommonRunCmd.update_make_opts_full({'override FPTYPE': new_value})
  80 │         else:
  81 │             raise Exception
  82 │         Sourcedir = pjoin(os.path.dirname(os.path.dirname(self.path)), 'Source')
  83 │         subprocess.call(['make', 'cleanall'], cwd=Sourcedir, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
  84 │
  85 │     def default_setup(self):
  86 │         super().default_setup()
  87 │         self.add_param('floating_type', 'm', include=False, hidden=True,
  88 │                        fct_mod=(self.reset_makeopts,(),{}),
  89 │                        allowed=['m','d','f'],
  90 │                        comment='floating point precision: f (single), d (double), m (mixed: double for amplitudes, single for colors)'
  91 │                        )

This prevents development manually within the check_sa.cc and using make calls.

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