Skip to content

generic-parallel material properties: load, check and describe the libraries generated by TFEL 5.2 - #321

Open
trsxvz wants to merge 7 commits into
masterfrom
320-generic-parallel-material-properties
Open

trsxvz wants to merge 7 commits into
masterfrom
320-generic-parallel-material-properties

Conversation

@trsxvz

@trsxvz trsxvz commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

[AI-assisted]

/!\ : TO MERGE ONLY AFTER MERGING thelfer/tfel#1088

Fixes #320.

Support of the material properties generated by the generic-parallel interface of MFront (thelfer/tfel#1088). Only additions: the existing API is unchanged.

Types of the generated functions

  • MGIS/MaterialProperty/BatchMaterialPropertyFctPtr.hxx declares copies of the types of TFEL: data of a batch (mgis_mp_BatchData), fields, statistics, output status, pointers to the functions.
  • MGIS_MP_GENERIC_PARALLEL_API_VERSION gives the supported version of those functions: 1.
  • MGIS/BackendExecutionPolicy.h only declares the type of the execution policies. A code creating a policy includes the headers of TFEL and links MFrontGenericParallelRuntime.
  • MGIS does not depend on TFEL, as for the generic interface.

Loading

  • load recognizes a library of the generic-parallel interface by its <name>_generic_parallel_api_version symbol.
  • It checks the version and the memory space, then fills the new members of MaterialProperty: mfront_interface, batch_api_version, backend, memory_space, execution_policy, batch_fct, batch_report_fct.
  • isGenericParallelMaterialProperty tells if those functions are available.
  • Refused: another version, an invalid memory space, a library of an earlier development version of the interface (no version symbol).
  • The libraries of the other interfaces are loaded as before.
  • The member is named mfront_interface, after the <name>_mfront_interface symbol: interface is a macro of the headers of Windows.

Tests

LoadGenericParallelMaterialPropertyTest, with TFEL 5.2 or later and the enable-parallel-stl-algorithms option (check-tbb workflow):

  • sizes and offsets of the members of the copies, compared to the types of TFEL;
  • library generated with the stlpar backend: description, values and statuses compared to the generic interface, report of an evaluation with statistics;
  • refused libraries.

All the tests of MGIS pass on Linux with TFEL built from thelfer/tfel#1088. Windows and macOS are covered by the continuous integration.

Documentation: as in TFEL, the statistics must be accessible by the host and by the device (the report function reads them on the host), not only in the memory space of the library (commit 657866c).

Not included, for a later version: behaviours and models of the generic-parallel interface, helpers creating execution policies or evaluating batches, bindings.

Copies of the types of the functions generated by the `generic-parallel`
interface of `MFront` for material properties (`TFEL` 5.2): data of a
batch, fields, statistics, output status and pointers to the functions
(`MGIS/MaterialProperty/BatchMaterialPropertyFctPtr.hxx`), version 1 of
those functions. The execution policies are defined by `TFEL`: `MGIS`
only declares their type (`MGIS/BackendExecutionPolicy.h`), so that it
does not depend on `TFEL`.
`load` recognizes the libraries generated by the `generic-parallel`
interface by the version of their functions, checks this version and the
memory space, and fills the new members of `MaterialProperty`
(interface, version, backend, memory space, identifier of the expected
execution policy, functions of batches of points). The libraries of the
other interfaces are loaded as before. A library generated by a version
of the `generic-parallel` interface which does not export the version of
its functions is refused.
With `TFEL` 5.2 or later: copies of the types of `TFEL` (sizes and
offsets of the members), loading of a library generated with the
`stlpar` backend, values and statuses compared to the `generic`
interface, report of an evaluation with statistics, refused libraries.
…st and by the device

The statistics are read on the host by the report function (and written on
the host by the stlpar backend): as in TFEL, they must be accessible by the
host and by the device, not only in the memory space of the library.

Review item: M-008
…l-material-properties

# Conflicts:
#	docs/web/release-notes-3.2.md
The generic-parallel material property libraries of the tests were only
built by check, so that make build-tests followed by ctest ran with
missing or stale libraries; they now depend on build-tests, as the other
test targets.

Review item: M-116
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.

generic-parallel material properties: the libraries generated by TFEL 5.2 can't be loaded nor checked

1 participant