From 5e473b940e547a354247ecce97cbad7bce141c7c Mon Sep 17 00:00:00 2001 From: "Michael F. Herbst" Date: Tue, 15 Aug 2023 10:11:01 +0200 Subject: [PATCH 1/2] Add optional io argument to versioninfo() --- src/implementations.jl | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/implementations.jl b/src/implementations.jl index 87d65adf9..1ce4a5415 100644 --- a/src/implementations.jl +++ b/src/implementations.jl @@ -82,41 +82,41 @@ const MPI_VERSION = Get_version() using PkgVersion """ - MPI.versioninfo() + MPI.versioninfo([io::IO=stdout]) Print a summary of the curent MPI configuration. """ -function versioninfo() - println("MPIPreferences:") - println(" binary: ", MPIPreferences.binary) - println(" abi: ", MPIPreferences.abi) +function versioninfo(io::IO=stdout) + println(io, "MPIPreferences:") + println(io, " binary: ", MPIPreferences.binary) + println(io, " abi: ", MPIPreferences.abi) if MPIPreferences.binary == "system" - println(" libmpi: ", MPIPreferences.System.libmpi) - println(" mpiexec: ", MPIPreferences.System.mpiexec_path) + println(io, " libmpi: ", MPIPreferences.System.libmpi) + println(io, " mpiexec: ", MPIPreferences.System.mpiexec_path) end - println() - println("Package versions") - println(" MPI.jl: ", PkgVersion.@Version) - println(" MPIPreferences.jl: ", PkgVersion.Version(MPIPreferences)) + println(io) + println(io, "Package versions") + println(io, " MPI.jl: ", PkgVersion.@Version) + println(io, " MPIPreferences.jl: ", PkgVersion.Version(MPIPreferences)) if MPIPreferences.binary == "MPICH_jll" - println(" MPICH_jll: ", PkgVersion.Version(API.MPICH_jll)) + println(io, " MPICH_jll: ", PkgVersion.Version(API.MPICH_jll)) elseif MPIPreferences.binary == "OpenMPI_jll" - println(" OpenMPI_jll: ", PkgVersion.Version(API.OpenMPI_jll)) + println(io, " OpenMPI_jll: ", PkgVersion.Version(API.OpenMPI_jll)) elseif MPIPreferences.binary == "OpenMPI_jll" - println(" OpenMPI_jll: ", PkgVersion.Version(API.OpenMPI_jll)) + println(io, " OpenMPI_jll: ", PkgVersion.Version(API.OpenMPI_jll)) elseif MPIPreferences.binary == "MicrosoftMPI_jll" - println(" MicrosoftMPI_jll: ", PkgVersion.Version(API.MicrosoftMPI_jll)) + println(io, " MicrosoftMPI_jll: ", PkgVersion.Version(API.MicrosoftMPI_jll)) elseif MPIPreferences.binary == "MPItrampoline_jll" - println(" MPItrampoline_jll ", PkgVersion.Version(API.MPItrampoline_jll)) + println(io, " MPItrampoline_jll ", PkgVersion.Version(API.MPItrampoline_jll)) end - - println() - println("Library information:") - println(" libmpi: ", API.libmpi) - println(" libmpi dlpath: ", Libdl.dlpath(API.libmpi)) - println(" MPI version: ", Get_version()) - println(" Library version: ") + + println(io) + println(io, "Library information:") + println(io, " libmpi: ", API.libmpi) + println(io, " libmpi dlpath: ", Libdl.dlpath(API.libmpi)) + println(io, " MPI version: ", Get_version()) + println(io, " Library version: ") for line in split(Get_library_version(), '\n') - println(" ", line) + println(io, " ", line) end end From 0da5cf8987721ad35625b51a8577e62c57212c6c Mon Sep 17 00:00:00 2001 From: Lucas C Wilcox Date: Tue, 15 Aug 2023 08:40:29 -0700 Subject: [PATCH 2/2] Simplify `versioninfo` docs --- src/implementations.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/implementations.jl b/src/implementations.jl index 1ce4a5415..ad11c6d1e 100644 --- a/src/implementations.jl +++ b/src/implementations.jl @@ -82,7 +82,7 @@ const MPI_VERSION = Get_version() using PkgVersion """ - MPI.versioninfo([io::IO=stdout]) + MPI.versioninfo(io::IO=stdout) Print a summary of the curent MPI configuration. """