[petsc-dev] Are there both a function AND a #define to retrieve PETSc version?

Eric Chamberland Eric.Chamberland at giref.ulaval.ca
Sat Aug 27 22:18:21 CDT 2016



Le 2016-08-27 à 15:22, Jed Brown a écrit :
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>     Well in Eric's case he knows he needs a bug fix in sub minor 3 and wants to generate an error if linked against an earlier one that does not have the bug fix. There needs to be a way for users to indicate if they need above something in the sub minor, doesn't there?
> Oh, then we can have PetscVersionGet(&major,&minor,&subminor,&release).
> Or PetscVersionGetMajor(&major), ...
>
> Preference?
Good question!  I am not aware of other libs than MPI, and in MPI the 
returned value is a string containing eventually a lot a things... So 
the user can deeply check what is "included" or not into the lib...

https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node209.htm

OpenMPI code:
https://github.com/open-mpi/ompi/blob/master/ompi/mpi/c/get_library_version.c#L81

Mpich code:
https://github.com/jeffhammond/mpich/blob/master/src/mpi/misc/library_version.c#L71

Maybe it is too much, maybe not... depends of the needs of the user...

For me now, what you proposed is enough... but if the most interesting 
would be to have a function with an API that will not change too much in 
the future, maybe a string is a better choice. If changing the function 
API is not an argument, then I prefer a single call than n calls to 
retreive the complete version.

thanks!

Eric





More information about the petsc-dev mailing list