[mpich-discuss] Have constants available in shared library

Balaji, Pavan balaji at anl.gov
Thu Apr 14 23:50:45 CDT 2016


Erik,

I'm curious why you need this to be done in the MPI library (MPICH or Open MPI).  Is creating your own library, that essentially does exactly the same thing (JULIA_MPI_INT_g = MPI_INT), and linking that as well, not an option?

  -- Pavan

> On Apr 14, 2016, at 1:44 PM, Erik Schnetter <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> 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> 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>
>>> http://www.perimeterinstitute.ca/personal/eschnetter/
>>> _______________________________________________
>>> 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
> 
> 
> 
> -- 
> Erik Schnetter <schnetter at gmail.com>
> http://www.perimeterinstitute.ca/personal/eschnetter/
> _______________________________________________
> 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