[mpich-discuss] Have constants available in shared library

Kenneth Raffenetti raffenet at mcs.anl.gov
Thu Apr 14 15:06:13 CDT 2016


There will be sufficient warning when the MPICH ABI changes, so Jeff's 
approach should work. The MPICH constant values will also be valid for 
derivatives listed here: http://www.mpich.org/abi/

Ken

On 04/14/2016 02:31 PM, Jeff Hammond wrote:
> Erik:
>
> MPICH ABI is standardized so just parse the header once and forget about it.
>
> Jeff
>
> On Thursday, April 14, 2016, Erik Schnetter <schnetter at gmail.com
> <mailto:schnetter at gmail.com>> wrote:
>
>     Rajeev
>
>     Apologies; I sent an identical request to the OpenMPI developers as
>     well. I meant the MPICH library here.
>
>     In Julia, it is straightforward to call a function in a shared
>     library, but it is not possible to access constants that are defined
>     in a C header file, as this would require parsing C code. It would
>     thus be convenient to access these constant in a different manner,
>     e.g. by looking at the value of a global variable or constant.
>
>     -erik
>
>     On Thu, Apr 14, 2016 at 1:50 PM, Thakur, Rajeev <thakur at mcs.anl.gov
>     <javascript:;>> wrote:
>      >> Could you add similar constants to the OpenMPI shared library?
>      >
>      > This list is for MPICH. Open MPI has a different mailing list.
>      >
>      > In MPICH, these constants are defined in the mpi.h header file.
>      >
>      > Rajeev
>      >
>      >
>      >> On Apr 14, 2016, at 9:04 AM, Erik Schnetter <schnetter at gmail.com
>     <javascript:;>> wrote:
>      >>
>      >> I am one of the maintainers of the MPI wrapper package for Julia
>      >> <https://github.com/JuliaParallel/MPI.jl>. This package provides
>     Julia
>      >> language bindings for MPI, essentially wrapping various MPI
>     functions,
>      >> comparable to what mpi4py <http://pythonhosted.org/mpi4py/> does for
>      >> Python.
>      >>
>      >> It is in Julia straightforward to call C functions in a shared
>      >> library. The MPI API is standardized, so that part is
>     straightforward.
>      >> What is not standardized are the values of various constants,
>     such as
>      >> e.g. MPI_INT, MPI_MAX, or MPI_ANY_TAG.
>      >>
>      >> We currently use a cmake function that builds and runs a small
>      >> executable that outputs the (implementation-specific) values of
>     these
>      >> constants, and auto-generates Julia code that defines these
>     constants.
>      >> We do this when the Julia MPI package is installed or updated. This
>      >> works fine, but I think there could be a better way.
>      >>
>      >> The HDF5 library <https://www.hdfgroup.org/HDF5/> puts global
>      >> constants into the data section of their library, with names derived
>      >> from the preprocessor constants (with a _g suffix, I believe). This
>      >> makes it straightforward to access the values of these constants at
>      >> run time. For example, there exists a constant H5T_NATIVE_INT_g.
>      >>
>      >> Could you add similar constants to the OpenMPI shared library? This
>      >> would simplify wrapping the library.
>      >>
>      >> Thanks,
>      >> -erik
>      >>
>      >> --
>      >> Erik Schnetter <schnetter at gmail.com <javascript:;>>
>      >> http://www.perimeterinstitute.ca/personal/eschnetter/
>      >> _______________________________________________
>      >> discuss mailing list discuss at mpich.org <javascript:;>
>      >> To manage subscription options or unsubscribe:
>      >> https://lists.mpich.org/mailman/listinfo/discuss
>      >
>      > _______________________________________________
>      > discuss mailing list discuss at mpich.org <javascript:;>
>      > To manage subscription options or unsubscribe:
>      > https://lists.mpich.org/mailman/listinfo/discuss
>
>
>
>     --
>     Erik Schnetter <schnetter at gmail.com <javascript:;>>
>     http://www.perimeterinstitute.ca/personal/eschnetter/
>     _______________________________________________
>     discuss mailing list discuss at mpich.org <javascript:;>
>     To manage subscription options or unsubscribe:
>     https://lists.mpich.org/mailman/listinfo/discuss
>
>
>
> --
> Jeff Hammond
> jeff.science at gmail.com <mailto:jeff.science at gmail.com>
> http://jeffhammond.github.io/
>
>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
>
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list