Skip to content

Update package modules w.r.t. public uses of SysCTypes #14599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2019

Conversation

bradcray
Copy link
Member

@bradcray bradcray commented Dec 6, 2019

This PR updates the set of package modules whose interfaces require
C types as defined in SysCTypes to include a public use SysCTypes
so that clients of the modules will not have to use SysCTypes in
order to make calls into them.

Ideally, it would be nice if any Chapel-facing code in these modules
did not require C types and that any conversion to C took place under
the hood if need be, but that was a bigger change than I was able to take
on here. And arguably, since they're just package modules, it's not so big
of a deal. But we might consider making this an expectation for a given
module before it transition to the standard modules directory. The
HDF5 module was a nice example of this in that the top-level HDF5
module only needed a private use SysCTypes; while the C_HDF5
sub-module needed a public use SysCTypes; for its clients.

These updates were missed in PR #14524 since these modules are not
tested for vanilla linux64 runs. As a separate effort, I may look into
making some .noexec tests that run on linux64 to make sure we get to
the codegen stage for each of these libraries to catch such issues
ealier.

This PR updates the set of package modules whose interfaces require
C types as defined in SysCTypes to include a `public use SysCTypes`
so that clients of the modules will not have to use SysCTypes in
order to make calls into them.  Ideally, it would be nice if any
Chapel-facing code in these modules did not require C types and
that any conversion to C took place under the hood if need be, but
that was a bigger change than I was able to take on here.  And
arguably, since they're just package modules, it's not so big of a
deal.  But we might consider making this an expectation for a given
module before it transition to the standard modules directory.
@bradcray
Copy link
Member Author

bradcray commented Dec 6, 2019

@daviditen, @mppf, @ben-albrecht / @npadmana: If you have time today, would you give a quick look to the modules you've worked within in this PR to make sure the change seems appropriate? (and if not today, maybe after this merges?)

@bradcray
Copy link
Member Author

bradcray commented Dec 6, 2019

Thinking about this PR more over lunch, I wanted to give @daviditen credit for creating an HDF5 module where (unless I missed something) all the Chapel-facing functions use Chapel types and the only C types are in the C_HDF5 module.

@bradcray bradcray merged commit 4cd6098 into chapel-lang:master Dec 6, 2019
@bradcray bradcray changed the title Update package modules w.r.t. public uses of HDFS Update package modules w.r.t. public uses of SysCTypes Dec 6, 2019
bradcray pushed a commit to bradcray/chapel that referenced this pull request Dec 6, 2019
This should've been part of chapel-lang#14599, but it escaped me there.
Here, I'm making the `use` of SysCTypes public since the MPI
package's interface includes C types.  Better would be to
rewrite the package to avoid the need for C types from the
Chapel user and convert under the covers before calling the
external C routines, but that was more than I was able to
take on today.
bradcray added a commit that referenced this pull request Dec 7, 2019
Add public use SysCTypes to MPI module

[trivial, not reviewed]

This should've been part of #14599, but it escaped me there.
Here, I'm making the `use` of SysCTypes public since the MPI
package's interface includes C types.  Better would be to
rewrite the package to avoid the need for C types from the
Chapel user and convert under the covers before calling the
external C routines, but that was more than I was able to
take on today.
ronawho added a commit that referenced this pull request Jan 14, 2020
Switch FFTW package to private SysCTypes

[contributed by @npadmana, reviewed by @ronawho]

Previously FFTW.chpl needed public C types for the FFTW flags and direction.
Remove this by defining type aliases for these. Also update the documentation.

Follow on to #14599
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.

4 participants