From 50db8365983ecd66b7645abf13a82ceadf199a36 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 17 Dec 2021 10:45:21 -0500 Subject: [PATCH 01/53] Add a lightweight MPIABI sub-package that controls the MPI ABI --- lib/MPIABI/Project.toml | 7 ++++ lib/MPIABI/UNLICENSE | 25 +++++++++++++ lib/MPIABI/src/MPIABI.jl | 79 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 lib/MPIABI/Project.toml create mode 100644 lib/MPIABI/UNLICENSE create mode 100644 lib/MPIABI/src/MPIABI.jl diff --git a/lib/MPIABI/Project.toml b/lib/MPIABI/Project.toml new file mode 100644 index 000000000..6a9e851b2 --- /dev/null +++ b/lib/MPIABI/Project.toml @@ -0,0 +1,7 @@ +name = "MPIABI" +uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" +authors = [] +version = "0.1.0" + +[deps] +Preferences = "21216c6a-2e73-6563-6e65-726566657250" diff --git a/lib/MPIABI/UNLICENSE b/lib/MPIABI/UNLICENSE new file mode 100644 index 000000000..6d9eabbb7 --- /dev/null +++ b/lib/MPIABI/UNLICENSE @@ -0,0 +1,25 @@ +This is free and unencumbered software released into the public +domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/lib/MPIABI/src/MPIABI.jl b/lib/MPIABI/src/MPIABI.jl new file mode 100644 index 000000000..2c1c474d3 --- /dev/null +++ b/lib/MPIABI/src/MPIABI.jl @@ -0,0 +1,79 @@ +module MPIABI + +using Preferences + +function known_abis() + return (:MicrosoftMPI, :MPICH, :OpenMPI, :MPItrampoline) +end + +# const abi = begin +# _abi = @load_preference("abi", nothing) +# if isnothing(_abi) +# _abi = find_abi() +# @set_preference!("abi" => _abi) +# end +# _abi +# end + +const abi = @load_preference("abi", Sys.iswindows() ? :MicrosoftMPI : :MPICH) + +function __init__() + if Sys.iswindows() + if abi != :MicrosoftMPI + @error """ + The MPI ABI is not compatible with the current platform. + Please set the MPI ABI to :MicrosoftMPI. + """ + end + end +end + +function set_abi(abi) + if abi ∉ known_abis() + error(""" + The MPI ABI $abi is not supported. + Please set the MPI ABI to one of the following: + $(known_abis()) + """) + end + @set_preferences!("abi" => abi) + @warn "The MPI abi has changed, you will need to restart Julia for the change to take effect" abi + + if VERSION <= v"1.6.5" || VERSION == v"1.7.0" + @warn """ + Due to a bug in Julia (until 1.6.5 and 1.7.1), setting preferences in transitive dependencies + is broken (https://github.com/JuliaPackaging/Preferences.jl/issues/24). As a workaround, we + will now add MPIABI as a direct dependency in your current project. + """ + + uuid = Preferences.get_uuid(@__MODULE__) + project_toml, pkg_name = Preferences.find_first_project_with_uuid(uuid) + + if project_toml === nothing && pkg_name === nothing + # If we couldn't find one, we're going to use `active_project()` + project_toml = Base.active_project() + + # And we're going to need to add this UUID as an "extras" dependency: + # We're going to assume you want to name this this dependency in the + # same way as it's been loaded: + pkg_uuid_matches = filter(d -> d.uuid == uuid, keys(Base.loaded_modules)) + if isempty(pkg_uuid_matches) + error("Cannot set preferences of an unknown package that is not loaded!") + end + pkg_name = first(pkg_uuid_matches).name + + # Read in the project, add the deps, write it back out! + project = Base.parsed_toml(project_toml) + if !haskey(project, "deps") + project["deps"] = Dict{String,Any}() + end + project["deps"][pkg_name] = string(uuid) + open(project_toml, "w") do io + TOML.print(io, project; sorted=true) + end + end + end + return abi +end + +end # module From deff2902862ee9c5c93983d2e01a42e8ee689771 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Sun, 13 Feb 2022 13:51:00 -0800 Subject: [PATCH 02/53] MPIABI => MPIPreferences --- lib/MPIABI/src/MPIABI.jl | 79 ---------- lib/{MPIABI => MPIPreferences}/Project.toml | 3 +- lib/{MPIABI => MPIPreferences}/UNLICENSE | 0 lib/MPIPreferences/src/MPIPreferences.jl | 161 ++++++++++++++++++++ 4 files changed, 163 insertions(+), 80 deletions(-) delete mode 100644 lib/MPIABI/src/MPIABI.jl rename lib/{MPIABI => MPIPreferences}/Project.toml (66%) rename lib/{MPIABI => MPIPreferences}/UNLICENSE (100%) create mode 100644 lib/MPIPreferences/src/MPIPreferences.jl diff --git a/lib/MPIABI/src/MPIABI.jl b/lib/MPIABI/src/MPIABI.jl deleted file mode 100644 index 2c1c474d3..000000000 --- a/lib/MPIABI/src/MPIABI.jl +++ /dev/null @@ -1,79 +0,0 @@ -module MPIABI - -using Preferences - -function known_abis() - return (:MicrosoftMPI, :MPICH, :OpenMPI, :MPItrampoline) -end - -# const abi = begin -# _abi = @load_preference("abi", nothing) -# if isnothing(_abi) -# _abi = find_abi() -# @set_preference!("abi" => _abi) -# end -# _abi -# end - -const abi = @load_preference("abi", Sys.iswindows() ? :MicrosoftMPI : :MPICH) - -function __init__() - if Sys.iswindows() - if abi != :MicrosoftMPI - @error """ - The MPI ABI is not compatible with the current platform. - Please set the MPI ABI to :MicrosoftMPI. - """ - end - end -end - -function set_abi(abi) - if abi ∉ known_abis() - error(""" - The MPI ABI $abi is not supported. - Please set the MPI ABI to one of the following: - $(known_abis()) - """) - end - @set_preferences!("abi" => abi) - @warn "The MPI abi has changed, you will need to restart Julia for the change to take effect" abi - - if VERSION <= v"1.6.5" || VERSION == v"1.7.0" - @warn """ - Due to a bug in Julia (until 1.6.5 and 1.7.1), setting preferences in transitive dependencies - is broken (https://github.com/JuliaPackaging/Preferences.jl/issues/24). As a workaround, we - will now add MPIABI as a direct dependency in your current project. - """ - - uuid = Preferences.get_uuid(@__MODULE__) - project_toml, pkg_name = Preferences.find_first_project_with_uuid(uuid) - - if project_toml === nothing && pkg_name === nothing - # If we couldn't find one, we're going to use `active_project()` - project_toml = Base.active_project() - - # And we're going to need to add this UUID as an "extras" dependency: - # We're going to assume you want to name this this dependency in the - # same way as it's been loaded: - pkg_uuid_matches = filter(d -> d.uuid == uuid, keys(Base.loaded_modules)) - if isempty(pkg_uuid_matches) - error("Cannot set preferences of an unknown package that is not loaded!") - end - pkg_name = first(pkg_uuid_matches).name - - # Read in the project, add the deps, write it back out! - project = Base.parsed_toml(project_toml) - if !haskey(project, "deps") - project["deps"] = Dict{String,Any}() - end - project["deps"][pkg_name] = string(uuid) - open(project_toml, "w") do io - TOML.print(io, project; sorted=true) - end - end - end - return abi -end - -end # module diff --git a/lib/MPIABI/Project.toml b/lib/MPIPreferences/Project.toml similarity index 66% rename from lib/MPIABI/Project.toml rename to lib/MPIPreferences/Project.toml index 6a9e851b2..bf8446e0b 100644 --- a/lib/MPIABI/Project.toml +++ b/lib/MPIPreferences/Project.toml @@ -1,7 +1,8 @@ -name = "MPIABI" +name = "MPIPreferences" uuid = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" authors = [] version = "0.1.0" [deps] +Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Preferences = "21216c6a-2e73-6563-6e65-726566657250" diff --git a/lib/MPIABI/UNLICENSE b/lib/MPIPreferences/UNLICENSE similarity index 100% rename from lib/MPIABI/UNLICENSE rename to lib/MPIPreferences/UNLICENSE diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl new file mode 100644 index 000000000..ccd5ebba1 --- /dev/null +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -0,0 +1,161 @@ +module MPIPreferences + +using Preferences, Libdl + +const binary = @load_preference("binary", Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll") + +const abi = if binary == "system" + @load_preference("abi") +elseif binary == "MicrosoftMPI_jll" + "MicrosoftMPI" +elseif binary == "MPICH_jll" + "MPICH" +elseif binary == "OpenMPI_jll" + "OpenMPI" +elseif binary == "MPItrampoline_jll" + "MPItrampoline" +else + error("Unknown binary: $binary") +end + +module System + using Preferences + const libmpi = @load_preference("libmpi") + const mpiexec_path = @load_preference("mpiexec") + mpiexec() = `$mpiexec_path` + mpiexec(f) = f(`$mpiexec_path`) +end + +function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll") + binary in ["MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll"] || + error("Unknown jll: $binary") + @set_preferences!( + "binary" => binary, + "libmpi" => nothing, + "abi" => nothing, + "mpiexec" => nothing + ) +end + +function use_system_binary(; + library=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"], + mpiexec="mpiexec", + abi=nothing, + ) + + libmpi = find_library(library) + if libmpi == "" + error("MPI library could not be found") + end + if isnothing(abi) + versionstring = Get_library_version(libmpi) + impl, version = identify_implementation(versionstring) + abi = identify_abi(impl, version) + end + if mpiexec isa Cmd + mpiexec = collect(mpiexec) + end + @set_preferences!( + "binary" => "system", + "libmpi" => libmpi, + "abi" => abi, + "mpiexec" => mpiexec, + ) +end + + +function Get_library_version(libmpi) + # There is no way to query at runtime what the length of the buffer should be. + # https://github.com/mpi-forum/mpi-issues/issues/159 + # 8192 is the maximum value of MPI_MAX_LIBRARY_VERSION_STRING across known + # implementations. + buf = Array{UInt8}(undef, 8192) + buflen = Ref{Cint}() + dlopen(libmpi) do hdl + ptr = dlsym(hdl, :MPI_Get_library_version) + ccall(ptr, Cint, (Ptr{UInt8}, Ref{Cint}), buf, buflen) + end + + @assert buflen[] < 8192 + resize!(buf, buflen[]) + return String(buf) +end + + +""" + identify_abi(version_string) + +Identify the MPI implementation from the library version string +""" +function identify_abi(version_string::String) + impl = "unknown" + version = v"0" + + if startswith(version_string, "MPICH") + impl = "MPICH" + # "MPICH Version:\t%s\n" / "MPICH2 Version:\t%s\n" + if (m = match(r"^MPICH2? Version:\t(\d+.\d+(?:.\d+)?\w*)\n", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif startswith(version_string, "Open MPI") + # Open MPI / Spectrum MPI + impl = occursin("IBM Spectrum MPI", version_string) ? "IBMSpectrumMPI" : "OpenMPI" + + if (m = match(r"^Open MPI v(\d+.\d+.\d+\w*)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif startswith(version_string, "Microsoft MPI") + impl = "MicrosoftMPI" + # "Microsoft MPI %u.%u.%u.%u%S" + # ignore last 2 (build numbers) + if (m = match(r"^Microsoft MPI (\d+.\d+)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif startswith(version_string, "Intel") + impl = "IntelMPI" + + # "Intel(R) MPI Library 2019 Update 4 for Linux* OS" + if (m = match(r"^Intel\(R\) MPI Library (\d+)(?: Update (\d+))?", version_string)) !== nothing + if m.captures[2] === nothing + version = VersionNumber(m.captures[1]) + else + version = VersionNumber(m.captures[1]*"."*m.captures[2]) + end + end + + elseif startswith(version_string, "MVAPICH2") + impl = "MVAPICH" + # "MVAPICH2 Version :\t%s\n") + if (m = match(r"^MVAPICH2? Version\s*:\t(\S*)\n", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + + elseif occursin("CRAY MPICH", version_string) + impl = "CrayMPICH" + # "MPI VERSION : CRAY MPICH version 7.7.10 (ANL base 3.2)\n" + if (m = match(r"CRAY MPICH version (\d+.\d+.\d+)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end + end + + # determine the abi from the implementation + version + if (impl == "MPICH" && version >= v"3.1" || + impl == "IntelMPI" && version > v"2014" || + impl == "MVAPICH" && version >= v"2" || + impl == "CrayMPICH" && version >= v"7") + # https://www.mpich.org/abi/ + abi = "MPICH" + elseif impl == "OpenMPI" || impl == "IBMSpectrumMPI" + abi = "OpenMPI" + elseif impl == "MicrosoftMPI" + abi = "MicrosoftMPI" + else + abi = "unknown" + end + return abi +end + +end # module From 0fdaaed9c5a83ba680f2582fd2b125f398c18335 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Mon, 14 Feb 2022 12:48:06 -0800 Subject: [PATCH 03/53] add msmpi support --- Project.toml | 1 + lib/MPIPreferences/src/MPIPreferences.jl | 4 + src/MPI.jl | 40 ++- src/consts/consts.jl | 46 +++ src/consts/microsoftmpi.jl | 334 ++++++++++++++++++++++ src/consts/mpich.jl | 341 +++++++++++++++++++++++ src/datatypes.jl | 4 +- src/error.jl | 2 +- src/info.jl | 8 +- 9 files changed, 762 insertions(+), 18 deletions(-) create mode 100644 src/consts/consts.jl create mode 100644 src/consts/microsoftmpi.jl create mode 100644 src/consts/mpich.jl diff --git a/Project.toml b/Project.toml index 8492f3ab7..ca2762fea 100644 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,7 @@ Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" MPICH_jll = "7cb0a576-ebde-5e09-9194-50597f1243b4" +MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" MicrosoftMPI_jll = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" OpenMPI_jll = "fe0851c0-eecd-5654-98d4-656369965a5c" diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl index ccd5ebba1..37f6457b5 100644 --- a/lib/MPIPreferences/src/MPIPreferences.jl +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -63,7 +63,11 @@ function use_system_binary(; ) end +""" + Get_library_version(libmpi) +Get the version string of the MPI library. +""" function Get_library_version(libmpi) # There is no way to query at runtime what the length of the buffer should be. # https://github.com/mpi-forum/mpi-issues/issues/159 diff --git a/src/MPI.jl b/src/MPI.jl index 3c502b26c..dc751229d 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -33,14 +33,36 @@ function _doc_external(fname) """ end -try - include(joinpath(dirname(@__DIR__), "deps", "deps.jl")) - include(joinpath(dirname(@__DIR__), "deps", "compile_time_mpi_constants.jl")) -catch e - error("MPI.jl not properly configured, please run `Pkg.build(\"MPI\")`.") + +import MPIPreferences + +@static if MPIPreferences.binary == "MPICH_jll" + import MPICH_jll: libmpi, mpiexec +else + error("Unknown MPI binarys") +end + +include("consts/consts.jl") +using .Consts + +# These functions are run after reading the values of the constants above) +const _mpi_load_time_hooks = Any[] +const _finished_loading = Ref(false) +function add_load_time_hook!(f) + @assert !_finished_loading[] + push!(_mpi_load_time_hooks, f) end -include("define_load_time_mpi_constants.jl") -include("read_load_time_mpi_constants.jl") +function run_load_time_hooks() + @assert !_finished_loading[] + _finished_loading[] = true + for hook in _mpi_load_time_hooks + hook() + end + empty!(_mpi_load_time_hooks) + nothing +end + + include("implementations.jl") include("error.jl") include("info.jl") @@ -75,10 +97,6 @@ function __init__() Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL) end - __init__deps() - - read_load_time_mpi_constants() - # disable UCX memory cache, since it doesn't work correctly # https://github.com/openucx/ucx/issues/5061 if !haskey(ENV, "UCX_MEMTYPE_CACHE") diff --git a/src/consts/consts.jl b/src/consts/consts.jl new file mode 100644 index 000000000..421a8e254 --- /dev/null +++ b/src/consts/consts.jl @@ -0,0 +1,46 @@ +module Consts + +export MPI_Aint, MPI_Count, MPI_Offset, MPI_Status, + MPI_Comm, MPI_Datatype, MPI_Errhandler, MPI_File, MPI_Group, + MPI_Info, MPI_Message, MPI_Op, MPI_Request, MPI_Win + +import MPIPreferences +import ..libmpi + +const initexprs = Any[] + +""" + @const_ref name T expr + +Defines an constant binding +```julia +const name = Ref{T}() +``` +and adds a hook to execute +```julia +name[] = expr +``` +at module initialization time. +""" +macro const_ref(name, T, expr) + push!(initexprs, :($name[] = $expr)) + :(const $(esc(name)) = Ref{$T}()) +end + +@static if MPIPreferences.abi == "MPICH" + include("mpich.jl") +elseif MPIPreferences.abi == "OpenMPI" + include("openmpi.jl") +elseif MPIPreferences.abi == "MicrosofMPI" + include("microsoftmpi.jl") +elseif MPIPreferences.abi == "MPItrampoline" + include("mpitrampoline.jl") +else + error("Unknown MPI ABI") +end + +@eval function __init__() + $(Expr(:block, initexprs...)) +end + +end \ No newline at end of file diff --git a/src/consts/microsoftmpi.jl b/src/consts/microsoftmpi.jl new file mode 100644 index 000000000..3bed55ede --- /dev/null +++ b/src/consts/microsoftmpi.jl @@ -0,0 +1,334 @@ +# Compile-time constants + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(512) +const MPI_MAX_INFO_KEY = Cint(255) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(256) +const MPI_MAX_PROCESSOR_NAME = Cint(128) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int +const MPI_Fint = Int32 +const MPI_Count = Int64 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + _private0::Cint + _private1::Cint + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint +end + +# Opaque handles: +const MPI_Comm = UInt32 +const MPI_Datatype = UInt32 +const MPI_Errhandler = UInt32 +const MPI_File = UInt32 +const MPI_Group = UInt32 +const MPI_Info = UInt32 +const MPI_Message = UInt32 +const MPI_Op = UInt32 +const MPI_Request = UInt32 +const MPI_Win = UInt32 + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + + +# Run-time constants + +@const_ref MPI_ANY_SOURCE Cint -2 +@const_ref MPI_ANY_TAG Cint -1 +@const_ref MPI_PROC_NULL Cint -1 +@const_ref MPI_ROOT Cint -3 + +@const_ref MPI_GRAPH Cint 1 +@const_ref MPI_CART Cint 2 +@const_ref MPI_DIST_GRAPH Cint 3 + +@const_ref MPI_IDENT Cint 0 +@const_ref MPI_CONGRUENT Cint 1 +@const_ref MPI_SIMILAR Cint 2 +@const_ref MPI_UNEQUAL Cint 3 + +@const_ref MPI_KEYVAL_INVALID Cint 0x24000000 +@const_ref MPI_UNDEFINED Cint -32766 + +@const_ref MPI_TAG_UB Cint 0x64400001 +@const_ref MPI_HOST Cint 0x64400003 +@const_ref MPI_IO Cint 0x64400005 +@const_ref MPI_WTIME_IS_GLOBAL Cint 0x64400007 +@const_ref MPI_UNIVERSE_SIZE Cint 0x64400009 +@const_ref MPI_LASTUSEDCODE Cint 0x6440000b +@const_ref MPI_APPNUM Cint 0x6440000d + +@const_ref MPI_WIN_BASE Cint 0x66000001 +@const_ref MPI_WIN_SIZE Cint 0x66000003 +@const_ref MPI_WIN_DISP_UNIT Cint 0x66000005 +@const_ref MPI_WIN_CREATE_FLAVOR Cint 0x66000007 +@const_ref MPI_WIN_MODEL Cint 0x66000009 + +@const_ref MPI_COMBINER_NAMED Cint 1 +@const_ref MPI_COMBINER_DUP Cint 2 +@const_ref MPI_COMBINER_CONTIGUOUS Cint 3 +@const_ref MPI_COMBINER_VECTOR Cint 4 +@const_ref MPI_COMBINER_HVECTOR_INTEGER Cint 5 +@const_ref MPI_COMBINER_HVECTOR Cint 6 +@const_ref MPI_COMBINER_INDEXED Cint 7 +@const_ref MPI_COMBINER_HINDEXED_INTEGER Cint 8 +@const_ref MPI_COMBINER_HINDEXED Cint 9 +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint 10 +@const_ref MPI_COMBINER_STRUCT_INTEGER Cint 11 +@const_ref MPI_COMBINER_STRUCT Cint 12 +@const_ref MPI_COMBINER_SUBARRAY Cint 13 +@const_ref MPI_COMBINER_DARRAY Cint 14 +@const_ref MPI_COMBINER_F90_REAL Cint 15 +@const_ref MPI_COMBINER_F90_COMPLEX Cint 16 +@const_ref MPI_COMBINER_F90_INTEGER Cint 17 +@const_ref MPI_COMBINER_RESIZED Cint 18 +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint 19 + +@const_ref MPI_COMM_TYPE_SHARED Cint 1 + +@const_ref MPI_DISTRIBUTE_BLOCK Cint 121 +@const_ref MPI_DISTRIBUTE_CYCLIC Cint 122 +@const_ref MPI_DISTRIBUTE_NONE Cint 123 + +@const_ref MPI_SUCCESS Cint 0 +@const_ref MPI_ERR_BUFFER Cint 1 +@const_ref MPI_ERR_COUNT Cint 2 +@const_ref MPI_ERR_TYPE Cint 3 +@const_ref MPI_ERR_TAG Cint 4 +@const_ref MPI_ERR_COMM Cint 5 +@const_ref MPI_ERR_RANK Cint 6 +@const_ref MPI_ERR_ROOT Cint 7 +@const_ref MPI_ERR_TRUNCATE Cint 14 +@const_ref MPI_ERR_GROUP Cint 8 +@const_ref MPI_ERR_OP Cint 9 +@const_ref MPI_ERR_REQUEST Cint 19 +@const_ref MPI_ERR_TOPOLOGY Cint 10 +@const_ref MPI_ERR_DIMS Cint 11 +@const_ref MPI_ERR_ARG Cint 12 +@const_ref MPI_ERR_OTHER Cint 15 +@const_ref MPI_ERR_UNKNOWN Cint 13 +@const_ref MPI_ERR_INTERN Cint 16 +@const_ref MPI_ERR_IN_STATUS Cint 17 +@const_ref MPI_ERR_PENDING Cint 18 +@const_ref MPI_ERR_ACCESS Cint 20 +@const_ref MPI_ERR_AMODE Cint 21 +@const_ref MPI_ERR_BAD_FILE Cint 22 +@const_ref MPI_ERR_CONVERSION Cint 23 +@const_ref MPI_ERR_DUP_DATAREP Cint 24 +@const_ref MPI_ERR_FILE_EXISTS Cint 25 +@const_ref MPI_ERR_FILE_IN_USE Cint 26 +@const_ref MPI_ERR_FILE Cint 27 +@const_ref MPI_ERR_IO Cint 32 +@const_ref MPI_ERR_NO_SPACE Cint 36 +@const_ref MPI_ERR_NO_SUCH_FILE Cint 37 +@const_ref MPI_ERR_READ_ONLY Cint 40 +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint 43 +@const_ref MPI_ERR_INFO Cint 28 +@const_ref MPI_ERR_INFO_KEY Cint 29 +@const_ref MPI_ERR_INFO_VALUE Cint 30 +@const_ref MPI_ERR_INFO_NOKEY Cint 31 +@const_ref MPI_ERR_NAME Cint 33 +@const_ref MPI_ERR_NO_MEM Cint 34 +@const_ref MPI_ERR_NOT_SAME Cint 35 +@const_ref MPI_ERR_PORT Cint 38 +@const_ref MPI_ERR_QUOTA Cint 39 +@const_ref MPI_ERR_SERVICE Cint 41 +@const_ref MPI_ERR_SPAWN Cint 42 +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint 44 +@const_ref MPI_ERR_WIN Cint 45 +@const_ref MPI_ERR_BASE Cint 46 +@const_ref MPI_ERR_LOCKTYPE Cint 47 +@const_ref MPI_ERR_KEYVAL Cint 48 +@const_ref MPI_ERR_RMA_CONFLICT Cint 49 +@const_ref MPI_ERR_RMA_SYNC Cint 50 +@const_ref MPI_ERR_SIZE Cint 51 +@const_ref MPI_ERR_DISP Cint 52 +@const_ref MPI_ERR_ASSERT Cint 53 + + +@const_ref MPI_LOCK_EXCLUSIVE Cint 234 +@const_ref MPI_LOCK_SHARED Cint 235 + + +@const_ref MPI_MODE_CREATE Cint 0x00000001 +@const_ref MPI_MODE_RDONLY Cint 0x00000002 +@const_ref MPI_MODE_WRONLY Cint 0x00000004 +@const_ref MPI_MODE_RDWR Cint 0x00000008 +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint 0x00000010 +@const_ref MPI_MODE_UNIQUE_OPEN Cint 0x00000020 +@const_ref MPI_MODE_EXCL Cint 0x00000040 +@const_ref MPI_MODE_APPEND Cint 0x00000080 +@const_ref MPI_MODE_SEQUENTIAL Cint 0x00000100 + + +@const_ref MPI_MODE_NOCHECK Cint 1024 +@const_ref MPI_MODE_NOSTORE Cint 2048 +@const_ref MPI_MODE_NOPUT Cint 4096 +@const_ref MPI_MODE_NOPRECEDE Cint 8192 +@const_ref MPI_MODE_NOSUCCEED Cint 16384 + +@const_ref MPI_ORDER_C Cint 56 +@const_ref MPI_ORDER_FORTRAN Cint 57 + + +@const_ref MPI_SEEK_SET Cint 600 +@const_ref MPI_SEEK_CUR Cint 602 +@const_ref MPI_SEEK_END Cint 604 + +@const_ref MPI_THREAD_SINGLE Cint 0 +@const_ref MPI_THREAD_FUNNELED Cint 1 +@const_ref MPI_THREAD_SERIALIZED Cint 2 +@const_ref MPI_THREAD_MULTIPLE Cint 3 + +@const_ref MPI_TYPECLASS_REAL Cint 1 +@const_ref MPI_TYPECLASS_INTEGER Cint 2 +@const_ref MPI_TYPECLASS_COMPLEX Cint 3 + +@const_ref MPI_ARGV_NULL Ptr{Cvoid} C_NULL +@const_ref MPI_ARGVS_NULL Ptr{Cvoid} C_NULL + +@const_ref MPI_UNWEIGHTED Ptr{Cvoid} 1 +@const_ref MPI_WEIGHTS_EMPTY Ptr{Cvoid} 2 +@const_ref MPI_BOTTOM Ptr{Cvoid} 0 +@const_ref MPI_IN_PLACE Ptr{Cvoid} -1 + +@const_ref MPI_COMM_NULL MPI_Comm 0x04000000 +@const_ref MPI_COMM_SELF MPI_Comm 0x44000001 +@const_ref MPI_COMM_WORLD MPI_Comm 0x44000000 + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function C_NULL +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function C_NULL + +@const_ref MPI_DATATYPE_NULL MPI_Datatype 0x0c000000 + +# Only define C constants, as we don't need the Fortran or C++ ones (and Fortran ones are compiler-dependent). + +@const_ref MPI_CHAR MPI_Datatype 0x4c000101 +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype 0x4c000102 +@const_ref MPI_SHORT MPI_Datatype 0x4c000203 +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype 0x4c000204 +@const_ref MPI_INT MPI_Datatype 0x4c000405 +@const_ref MPI_UNSIGNED MPI_Datatype 0x4c000406 +@const_ref MPI_LONG MPI_Datatype 0x4c000407 +@const_ref MPI_UNSIGNED_LONG MPI_Datatype 0x4c000408 +@const_ref MPI_LONG_LONG_INT MPI_Datatype 0x4c000809 +const MPI_LONG_LONG = MPI_LONG_LONG_INT +@const_ref MPI_FLOAT MPI_Datatype 0x4c00040a +@const_ref MPI_DOUBLE MPI_Datatype 0x4c00080b +@const_ref MPI_LONG_DOUBLE MPI_Datatype 0x4c00080c +@const_ref MPI_BYTE MPI_Datatype 0x4c00010d +@const_ref MPI_WCHAR MPI_Datatype 0x4c00020e + +@const_ref MPI_PACKED MPI_Datatype 0x4c00010f +@const_ref MPI_LB MPI_Datatype 0x4c000010 +@const_ref MPI_UB MPI_Datatype 0x4c000011 + +@const_ref MPI_C_COMPLEX MPI_Datatype 0x4c000812 +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype 0x4c000813 +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype 0x4c001014 +@const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype 0x4c001015 + +@const_ref MPI_2INT MPI_Datatype 0x4c000816 +@const_ref MPI_C_BOOL MPI_Datatype 0x4c000117 +@const_ref MPI_SIGNED_CHAR MPI_Datatype 0x4c000118 +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype 0x4c000819 + +@const_ref MPI_INT8_T MPI_Datatype 0x4c000133 +@const_ref MPI_INT16_T MPI_Datatype 0x4c000234 +@const_ref MPI_INT32_T MPI_Datatype 0x4c000435 +@const_ref MPI_INT64_T MPI_Datatype 0x4c000836 +@const_ref MPI_UINT8_T MPI_Datatype 0x4c000137 +@const_ref MPI_UINT16_T MPI_Datatype 0x4c000238 +@const_ref MPI_UINT32_T MPI_Datatype 0x4c000439 +@const_ref MPI_UINT64_T MPI_Datatype 0x4c00083a + +@const_ref MPI_AINT MPI_Datatype MPI_Aint == Int64 ? 0x4c00083b : 0x4c00043b +@const_ref MPI_OFFSET MPI_Datatype 0x4c00083c +@const_ref MPI_COUNT MPI_Datatype 0x4c00083d + +@const_ref MPI_FLOAT_INT MPI_Datatype 0x8c000000 +@const_ref MPI_DOUBLE_INT MPI_Datatype 0x8c000001 +@const_ref MPI_LONG_INT MPI_Datatype 0x8c000002 +@const_ref MPI_SHORT_INT MPI_Datatype 0x8c000003 +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype 0x8c000004 + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler 0x14000000 +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler 0x54000000 +@const_ref MPI_ERRORS_RETURN MPI_Errhandler 0x54000001 +#@const_ref MPI_ERRORS_ABORT MPI_Errhandler 0x54000003 + +@const_ref MPI_FILE_NULL MPI_File 0 + +@const_ref MPI_GROUP_EMPTY MPI_Group 0x48000000 +@const_ref MPI_GROUP_NULL MPI_Group 0x08000000 + +# @const_ref MPI_INFO_ENV MPI_Info 0x5c00000 +@const_ref MPI_INFO_NULL MPI_Info 0x1c000000 + +@const_ref MPI_MESSAGE_NULL MPI_Message 0x30000000 +@const_ref MPI_MESSAGE_NO_PROC MPI_Message 0x70000000 + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset -54278278 + +@const_ref MPI_OP_NULL MPI_Op 0x18000000 +@const_ref MPI_MAX MPI_Op 0x58000001 +@const_ref MPI_MIN MPI_Op 0x58000002 +@const_ref MPI_SUM MPI_Op 0x58000003 +@const_ref MPI_PROD MPI_Op 0x58000004 +@const_ref MPI_LAND MPI_Op 0x58000005 +@const_ref MPI_BAND MPI_Op 0x58000006 +@const_ref MPI_LOR MPI_Op 0x58000007 +@const_ref MPI_BOR MPI_Op 0x58000008 +@const_ref MPI_LXOR MPI_Op 0x58000009 +@const_ref MPI_BXOR MPI_Op 0x5800000a +@const_ref MPI_MINLOC MPI_Op 0x5800000b +@const_ref MPI_MAXLOC MPI_Op 0x5800000c +@const_ref MPI_REPLACE MPI_Op 0x5800000d +@const_ref MPI_NO_OP MPI_Op 0x5800000e + +@const_ref MPI_REQUEST_NULL MPI_Request 0x2c000000 + +@const_ref MPI_STATUS_IGNORE Ptr{Cvoid} 1 +@const_ref MPI_STATUSES_IGNORE Ptr{Cvoid} 1 + +@const_ref MPI_TYPE_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function C_NULL +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function C_NULL + +@const_ref MPI_WIN_NULL MPI_Win 0x20000000 + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function C_NULL +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function C_NULL diff --git a/src/consts/mpich.jl b/src/consts/mpich.jl new file mode 100644 index 000000000..7778580a8 --- /dev/null +++ b/src/consts/mpich.jl @@ -0,0 +1,341 @@ +# Compile-time constants +# logic derived from +# https://github.com/pmodels/mpich/blob/main/configure.ac +# https://github.com/pmodels/mpich/blob/main/src/include/mpi.h.in +# https://github.com/pmodels/mpich/blob/main/src/mpi/romio/include/mpio.h.in + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(512) +const MPI_MAX_INFO_KEY = Cint(255) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(256) +const MPI_MAX_PROCESSOR_NAME = Cint(128) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int +const MPI_Fint = Int32 +const MPI_Count = Int64 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + _private0::Cint + _private1::Cint + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint +end + +# Opaque handles: +const MPI_Comm = UInt32 +const MPI_Datatype = UInt32 +const MPI_Errhandler = UInt32 +const MPI_File = Ptr{Cvoid} +const MPI_Group = UInt32 +const MPI_Info = UInt32 +const MPI_Message = UInt32 +const MPI_Op = UInt32 +const MPI_Request = UInt32 +const MPI_Win = UInt32 + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + +# Run-time constants + +@const_ref MPI_ANY_SOURCE Cint -2 +@const_ref MPI_ANY_TAG Cint -1 +@const_ref MPI_PROC_NULL Cint -1 +@const_ref MPI_ROOT Cint -3 + +@const_ref MPI_GRAPH Cint 1 +@const_ref MPI_CART Cint 2 +@const_ref MPI_DIST_GRAPH Cint 3 + +@const_ref MPI_IDENT Cint 0 +@const_ref MPI_CONGRUENT Cint 1 +@const_ref MPI_SIMILAR Cint 2 +@const_ref MPI_UNEQUAL Cint 3 + +@const_ref MPI_KEYVAL_INVALID Cint 0x24000000 +@const_ref MPI_UNDEFINED Cint -32766 + +@const_ref MPI_TAG_UB Cint 0x64400001 +@const_ref MPI_HOST Cint 0x64400003 +@const_ref MPI_IO Cint 0x64400005 +@const_ref MPI_WTIME_IS_GLOBAL Cint 0x64400007 +@const_ref MPI_UNIVERSE_SIZE Cint 0x64400009 +@const_ref MPI_LASTUSEDCODE Cint 0x6440000b +@const_ref MPI_APPNUM Cint 0x6440000d + +@const_ref MPI_WIN_BASE Cint 0x66000001 +@const_ref MPI_WIN_SIZE Cint 0x66000003 +@const_ref MPI_WIN_DISP_UNIT Cint 0x66000005 +@const_ref MPI_WIN_CREATE_FLAVOR Cint 0x66000007 +@const_ref MPI_WIN_MODEL Cint 0x66000009 + +@const_ref MPI_COMBINER_NAMED Cint 1 +@const_ref MPI_COMBINER_DUP Cint 2 +@const_ref MPI_COMBINER_CONTIGUOUS Cint 3 +@const_ref MPI_COMBINER_VECTOR Cint 4 +@const_ref MPI_COMBINER_HVECTOR_INTEGER Cint 5 +@const_ref MPI_COMBINER_HVECTOR Cint 6 +@const_ref MPI_COMBINER_INDEXED Cint 7 +@const_ref MPI_COMBINER_HINDEXED_INTEGER Cint 8 +@const_ref MPI_COMBINER_HINDEXED Cint 9 +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint 10 +@const_ref MPI_COMBINER_STRUCT_INTEGER Cint 11 +@const_ref MPI_COMBINER_STRUCT Cint 12 +@const_ref MPI_COMBINER_SUBARRAY Cint 13 +@const_ref MPI_COMBINER_DARRAY Cint 14 +@const_ref MPI_COMBINER_F90_REAL Cint 15 +@const_ref MPI_COMBINER_F90_COMPLEX Cint 16 +@const_ref MPI_COMBINER_F90_INTEGER Cint 17 +@const_ref MPI_COMBINER_RESIZED Cint 18 +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint 19 + +@const_ref MPI_COMM_TYPE_SHARED Cint 1 + +@const_ref MPI_DISTRIBUTE_BLOCK Cint 121 +@const_ref MPI_DISTRIBUTE_CYCLIC Cint 122 +@const_ref MPI_DISTRIBUTE_NONE Cint 123 + +@const_ref MPI_SUCCESS Cint 0 +@const_ref MPI_ERR_BUFFER Cint 1 +@const_ref MPI_ERR_COUNT Cint 2 +@const_ref MPI_ERR_TYPE Cint 3 +@const_ref MPI_ERR_TAG Cint 4 +@const_ref MPI_ERR_COMM Cint 5 +@const_ref MPI_ERR_RANK Cint 6 +@const_ref MPI_ERR_ROOT Cint 7 +@const_ref MPI_ERR_TRUNCATE Cint 14 +@const_ref MPI_ERR_GROUP Cint 8 +@const_ref MPI_ERR_OP Cint 9 +@const_ref MPI_ERR_REQUEST Cint 19 +@const_ref MPI_ERR_TOPOLOGY Cint 10 +@const_ref MPI_ERR_DIMS Cint 11 +@const_ref MPI_ERR_ARG Cint 12 +@const_ref MPI_ERR_OTHER Cint 15 +@const_ref MPI_ERR_UNKNOWN Cint 13 +@const_ref MPI_ERR_INTERN Cint 16 +@const_ref MPI_ERR_IN_STATUS Cint 17 +@const_ref MPI_ERR_PENDING Cint 18 +@const_ref MPI_ERR_ACCESS Cint 20 +@const_ref MPI_ERR_AMODE Cint 21 +@const_ref MPI_ERR_BAD_FILE Cint 22 +@const_ref MPI_ERR_CONVERSION Cint 23 +@const_ref MPI_ERR_DUP_DATAREP Cint 24 +@const_ref MPI_ERR_FILE_EXISTS Cint 25 +@const_ref MPI_ERR_FILE_IN_USE Cint 26 +@const_ref MPI_ERR_FILE Cint 27 +@const_ref MPI_ERR_IO Cint 32 +@const_ref MPI_ERR_NO_SPACE Cint 36 +@const_ref MPI_ERR_NO_SUCH_FILE Cint 37 +@const_ref MPI_ERR_READ_ONLY Cint 40 +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint 43 +@const_ref MPI_ERR_INFO Cint 28 +@const_ref MPI_ERR_INFO_KEY Cint 29 +@const_ref MPI_ERR_INFO_VALUE Cint 30 +@const_ref MPI_ERR_INFO_NOKEY Cint 31 +@const_ref MPI_ERR_NAME Cint 33 +@const_ref MPI_ERR_NO_MEM Cint 34 +@const_ref MPI_ERR_NOT_SAME Cint 35 +@const_ref MPI_ERR_PORT Cint 38 +@const_ref MPI_ERR_QUOTA Cint 39 +@const_ref MPI_ERR_SERVICE Cint 41 +@const_ref MPI_ERR_SPAWN Cint 42 +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint 44 +@const_ref MPI_ERR_WIN Cint 45 +@const_ref MPI_ERR_BASE Cint 46 +@const_ref MPI_ERR_LOCKTYPE Cint 47 +@const_ref MPI_ERR_KEYVAL Cint 48 +@const_ref MPI_ERR_RMA_CONFLICT Cint 49 +@const_ref MPI_ERR_RMA_SYNC Cint 50 +@const_ref MPI_ERR_SIZE Cint 51 +@const_ref MPI_ERR_DISP Cint 52 +@const_ref MPI_ERR_ASSERT Cint 53 +@const_ref MPI_ERR_RMA_RANGE Cint 55 +@const_ref MPI_ERR_RMA_ATTACH Cint 56 +@const_ref MPI_ERR_RMA_SHARED Cint 57 +@const_ref MPI_ERR_RMA_FLAVOR Cint 58 + + +@const_ref MPI_LOCK_EXCLUSIVE Cint 234 +@const_ref MPI_LOCK_SHARED Cint 235 + + +@const_ref MPI_MODE_RDONLY Cint 2 +@const_ref MPI_MODE_RDWR Cint 8 +@const_ref MPI_MODE_WRONLY Cint 4 +@const_ref MPI_MODE_CREATE Cint 1 +@const_ref MPI_MODE_EXCL Cint 64 +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint 16 +@const_ref MPI_MODE_UNIQUE_OPEN Cint 32 +@const_ref MPI_MODE_APPEND Cint 128 +@const_ref MPI_MODE_SEQUENTIAL Cint 256 + +@const_ref MPI_MODE_NOCHECK Cint 1024 +@const_ref MPI_MODE_NOSTORE Cint 2048 +@const_ref MPI_MODE_NOPUT Cint 4096 +@const_ref MPI_MODE_NOPRECEDE Cint 8192 +@const_ref MPI_MODE_NOSUCCEED Cint 16384 + +@const_ref MPI_ORDER_C Cint 56 +@const_ref MPI_ORDER_FORTRAN Cint 57 + + +@const_ref MPI_SEEK_SET Cint 600 +@const_ref MPI_SEEK_CUR Cint 602 +@const_ref MPI_SEEK_END Cint 604 + +@const_ref MPI_THREAD_SINGLE Cint 0 +@const_ref MPI_THREAD_FUNNELED Cint 1 +@const_ref MPI_THREAD_SERIALIZED Cint 2 +@const_ref MPI_THREAD_MULTIPLE Cint 3 + +@const_ref MPI_TYPECLASS_REAL Cint 1 +@const_ref MPI_TYPECLASS_INTEGER Cint 2 +@const_ref MPI_TYPECLASS_COMPLEX Cint 3 + +@const_ref MPI_ARGV_NULL Ptr{Cvoid} C_NULL +@const_ref MPI_ARGVS_NULL Ptr{Cvoid} C_NULL + +@const_ref MPI_UNWEIGHTED Ptr{Cvoid} cglobal((:MPI_UNWEIGHTED, libmpi), Ptr{Cvoid}) +@const_ref MPI_WEIGHTS_EMPTY Ptr{Cvoid} cglobal((:MPI_WEIGHTS_EMPTY, libmpi), Ptr{Cvoid}) +@const_ref MPI_BOTTOM Ptr{Cvoid} C_NULL +@const_ref MPI_IN_PLACE Ptr{Cvoid} -1 + +@const_ref MPI_COMM_NULL MPI_Comm 0x04000000 +@const_ref MPI_COMM_SELF MPI_Comm 0x44000001 +@const_ref MPI_COMM_WORLD MPI_Comm 0x44000000 + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function C_NULL +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function C_NULL + +@const_ref MPI_DATATYPE_NULL MPI_Datatype 0x0c000000 + +# Only define C constants, as we don't need the Fortran or C++ ones (and Fortran ones are compiler-dependent). +@const_ref MPI_CHAR MPI_Datatype 0x4c000001 + 0x100 * sizeof(Cchar) +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype 0x4c000002 + 0x100 * sizeof(Cuchar) +@const_ref MPI_SHORT MPI_Datatype 0x4c000003 + 0x100 * sizeof(Cshort) +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype 0x4c000004 + 0x100 * sizeof(Cushort) +@const_ref MPI_INT MPI_Datatype 0x4c000005 + 0x100 * sizeof(Cint) +@const_ref MPI_UNSIGNED MPI_Datatype 0x4c000006 + 0x100 * sizeof(Cuint) +@const_ref MPI_LONG MPI_Datatype 0x4c000007 + 0x100 * sizeof(Clong) +@const_ref MPI_UNSIGNED_LONG MPI_Datatype 0x4c000008 + 0x100 * sizeof(Culong) +@const_ref MPI_LONG_LONG_INT MPI_Datatype 0x4c000009 + 0x100 * sizeof(Clonglong) +@const_ref MPI_FLOAT MPI_Datatype 0x4c00000a + 0x100 * sizeof(Cfloat) +@const_ref MPI_DOUBLE MPI_Datatype 0x4c00000b + 0x100 * sizeof(Cdouble) +# @const_ref MPI_LONG_DOUBLE MPI_Datatype 0x4c00000c + 0x100 * sizeof(Clongdouble) +@const_ref MPI_BYTE MPI_Datatype 0x4c00000d + 0x100 * 1 +@const_ref MPI_WCHAR MPI_Datatype 0x4c00000e + 0x100 * sizeof(Cwchar_t) +@const_ref MPI_PACKED MPI_Datatype 0x4c00000f + 0x100 * 1 + +@const_ref MPI_LB MPI_Datatype 0x4c000010 +@const_ref MPI_UB MPI_Datatype 0x4c000011 + +@const_ref MPI_FLOAT_INT MPI_Datatype 0x8c000000 +@const_ref MPI_DOUBLE_INT MPI_Datatype 0x8c000001 +@const_ref MPI_LONG_INT MPI_Datatype 0x8c000002 +@const_ref MPI_SHORT_INT MPI_Datatype 0x8c000003 +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype 0x8c000004 + +@const_ref MPI_2INT MPI_Datatype 0x4c000016 + +@const_ref MPI_SIGNED_CHAR MPI_Datatype 0x4c000018 + 0x100 * sizeof(Cchar) +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype 0x4c000019 + 0x100 * sizeof(Culonglong) + +@const_ref MPI_INT8_T MPI_Datatype 0x4c000037 + 0x100 * sizeof(Int8) +@const_ref MPI_INT16_T MPI_Datatype 0x4c000038 + 0x100 * sizeof(Int16) +@const_ref MPI_INT32_T MPI_Datatype 0x4c000039 + 0x100 * sizeof(Int32) +@const_ref MPI_INT64_T MPI_Datatype 0x4c00003a + 0x100 * sizeof(Int64) +@const_ref MPI_UINT8_T MPI_Datatype 0x4c00003b + 0x100 * sizeof(UInt8) +@const_ref MPI_UINT16_T MPI_Datatype 0x4c00003c + 0x100 * sizeof(UInt16) +@const_ref MPI_UINT32_T MPI_Datatype 0x4c00003d + 0x100 * sizeof(UInt32) +@const_ref MPI_UINT64_T MPI_Datatype 0x4c00003e + 0x100 * sizeof(UInt64) +@const_ref MPI_C_BOOL MPI_Datatype 0x4c00003f + 0x100 * sizeof(UInt8) +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype 0x4c000040 + 0x100 * sizeof(Complex{Cfloat}) +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype 0x4c000041 + 0x100 * sizeof(Complex{Cdouble}) +# @const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype 0x4c000042 + 0x100 * sizeof(Complex{Clongdouble}) +@const_ref MPI_AINT MPI_Datatype 0x4c000043 + 0x100 * sizeof(MPI_Aint) +@const_ref MPI_OFFSET MPI_Datatype 0x4c000044 + 0x100 * sizeof(MPI_Offset) +@const_ref MPI_COUNT MPI_Datatype 0x4c000045 + 0x100 * sizeof(MPI_Count) +@const_ref MPIX_C_FLOAT16 MPI_Datatype 0x4c000046 + 0x100 * sizeof(Float16) + +# aliases +const MPI_LONG_LONG = MPI_LONG_LONG_INT +const MPI_C_COMPLEX = MPI_C_FLOAT_COMPLEX + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler 0x14000000 +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler 0x54000000 +@const_ref MPI_ERRORS_RETURN MPI_Errhandler 0x54000001 +@const_ref MPI_ERRORS_ABORT MPI_Errhandler 0x54000003 + +@const_ref MPI_FILE_NULL MPI_File C_NULL + +@const_ref MPI_GROUP_EMPTY MPI_Group 0x48000000 +@const_ref MPI_GROUP_NULL MPI_Group 0x08000000 + +@const_ref MPI_INFO_ENV MPI_Info 0x5c000001 +@const_ref MPI_INFO_NULL MPI_Info 0x1c000000 + +@const_ref MPI_MESSAGE_NO_PROC MPI_Message 0x6c000000 +@const_ref MPI_MESSAGE_NULL MPI_Message 0x2c000000 + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset -54278278 + +@const_ref MPI_OP_NULL MPI_Op 0x18000000 +@const_ref MPI_MAX MPI_Op 0x58000001 +@const_ref MPI_MIN MPI_Op 0x58000002 +@const_ref MPI_SUM MPI_Op 0x58000003 +@const_ref MPI_PROD MPI_Op 0x58000004 +@const_ref MPI_LAND MPI_Op 0x58000005 +@const_ref MPI_BAND MPI_Op 0x58000006 +@const_ref MPI_LOR MPI_Op 0x58000007 +@const_ref MPI_BOR MPI_Op 0x58000008 +@const_ref MPI_LXOR MPI_Op 0x58000009 +@const_ref MPI_BXOR MPI_Op 0x5800000a +@const_ref MPI_MINLOC MPI_Op 0x5800000b +@const_ref MPI_MAXLOC MPI_Op 0x5800000c +@const_ref MPI_REPLACE MPI_Op 0x5800000d +@const_ref MPI_NO_OP MPI_Op 0x5800000e + +@const_ref MPI_REQUEST_NULL MPI_Request 0x2c000000 + +@const_ref MPI_STATUS_IGNORE Ptr{Cvoid} 1 +@const_ref MPI_STATUSES_IGNORE Ptr{Cvoid} 1 + +@const_ref MPI_TYPE_DUP_FN MPI_Comm_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function C_NULL +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function C_NULL + +@const_ref MPI_WIN_NULL MPI_Win 0x20000000 + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function cglobal((:MPIR_Dup_fn, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function C_NULL +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function C_NULL diff --git a/src/datatypes.jl b/src/datatypes.jl index 9dc077fe4..dec8f4f2c 100644 --- a/src/datatypes.jl +++ b/src/datatypes.jl @@ -71,7 +71,7 @@ end # names function get_name(datatype::Datatype) - buffer = Array{UInt8}(undef, MPI_MAX_OBJECT_NAME) + buffer = Array{UInt8}(undef, Consts.MPI_MAX_OBJECT_NAME) lenref = Ref{Cint}() @mpichk ccall((:MPI_Type_get_name, libmpi), Cint, (MPI_Datatype, Ptr{UInt8}, Ptr{Cint}), @@ -118,7 +118,7 @@ for (mpiname, T) in [ :UNSIGNED => Cuint :LONG => Clong :UNSIGNED_LONG => Culong - :LONG_LONG => Clonglong + :LONG_LONG_INT => Clonglong :UNSIGNED_LONG_LONG => Culonglong :CHAR => Cchar :SIGNED_CHAR => Cchar diff --git a/src/error.jl b/src/error.jl index 0a181c77e..43aa71f58 100644 --- a/src/error.jl +++ b/src/error.jl @@ -11,7 +11,7 @@ end function error_string(err::MPIError) len_ref = Ref{Cint}() - str_buf = Vector{UInt8}(undef, MPI_MAX_ERROR_STRING) + str_buf = Vector{UInt8}(undef, Consts.MPI_MAX_ERROR_STRING) # int MPI_Error_string(int errorcode, char *string, int *resultlen) @mpichk ccall((:MPI_Error_string, libmpi), Cint, (Cint, Ptr{UInt8}, Ref{Cint}), err.code, str_buf, len_ref) diff --git a/src/info.jl b/src/info.jl index 3f593d139..bbb60423b 100644 --- a/src/info.jl +++ b/src/info.jl @@ -56,7 +56,7 @@ end function Base.setindex!(info::Info, value::AbstractString, key::Symbol) skey = String(key) @assert isascii(skey) && isascii(value) && - length(skey) <= MPI_MAX_INFO_KEY && length(value) <= MPI_MAX_INFO_VAL + length(skey) <= Consts.MPI_MAX_INFO_KEY && length(value) <= Consts.MPI_MAX_INFO_VAL @mpichk ccall((:MPI_Info_set, libmpi), Cint, (MPI_Info, Cstring, Cstring), info, skey, value) end @@ -87,7 +87,7 @@ end function Base.getindex(info::Info, key::Symbol) skey = String(key) - @assert isascii(skey) && length(skey) <= MPI_MAX_INFO_KEY + @assert isascii(skey) && length(skey) <= Consts.MPI_MAX_INFO_KEY valuelen = Ref{Cint}() flag = Ref{Cint}() # int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen, int *flag) @@ -115,7 +115,7 @@ end function Base.delete!(info::Info,key::Symbol) skey = String(key) - @assert isascii(skey) && length(skey) <= MPI_MAX_INFO_KEY + @assert isascii(skey) && length(skey) <= Consts.MPI_MAX_INFO_KEY @mpichk ccall((:MPI_Info_delete, libmpi), Cint, (MPI_Info, Cstring), info, skey) end @@ -131,7 +131,7 @@ function Base.length(info::Info) end function nthkey(info::Info, n::Integer) - buffer = Vector{UInt8}(undef, MPI_MAX_INFO_KEY+1) + buffer = Vector{UInt8}(undef, Consts.MPI_MAX_INFO_KEY+1) @mpichk ccall((:MPI_Info_get_nthkey, libmpi), Cint, (MPI_Info, Cint, Ptr{UInt8}), info, n, buffer) i = findfirst(isequal(UInt8(0)), buffer) From 186bb4c527cb8a0485024c938465914f5d6b041d Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Mon, 14 Feb 2022 14:35:37 -0800 Subject: [PATCH 04/53] get OpenMPI working --- src/MPI.jl | 6 + src/consts/openmpi.jl | 355 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 361 insertions(+) create mode 100644 src/consts/openmpi.jl diff --git a/src/MPI.jl b/src/MPI.jl index dc751229d..b166e8cf2 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -38,6 +38,10 @@ import MPIPreferences @static if MPIPreferences.binary == "MPICH_jll" import MPICH_jll: libmpi, mpiexec +elseif MPIPreferences.binary == "OpenMPI_jll" + import OpenMPI_jll: libmpi, mpiexec +elseif MPIPreferences.binary == "MicrosofMPI_jll" + import MicrosofMPI_jll: libmpi, mpiexec else error("Unknown MPI binarys") end @@ -111,6 +115,8 @@ function __init__() ENV["UCX_ERROR_SIGNALS"] = "SIGILL,SIGBUS,SIGFPE" end + run_load_time_hooks() + @require CUDA="052768ef-5323-5732-b1bb-66c8b64840ba" include("cuda.jl") end diff --git a/src/consts/openmpi.jl b/src/consts/openmpi.jl new file mode 100644 index 000000000..ffda35066 --- /dev/null +++ b/src/consts/openmpi.jl @@ -0,0 +1,355 @@ +# Compile-time constants +# logic derived from +# https://github.com/open-mpi/ompi/blob/master/ompi/include/mpi.h.in + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(512) +const MPI_MAX_INFO_KEY = Cint(255) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(256) +const MPI_MAX_PROCESSOR_NAME = Cint(128) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int +const MPI_Fint = Int32 +const MPI_Count = Int64 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint + _private0::Cint + _private1::Cint + _private2::Cint +end + +# Opaque handles: +const MPI_Comm = Ptr{Cvoid} +const MPI_Datatype = Ptr{Cvoid} +const MPI_Errhandler = Ptr{Cvoid} +const MPI_File = Ptr{Cvoid} +const MPI_Group = Ptr{Cvoid} +const MPI_Info = Ptr{Cvoid} +const MPI_Message = Ptr{Cvoid} +const MPI_Op = Ptr{Cvoid} +const MPI_Request = Ptr{Cvoid} +const MPI_Win = Ptr{Cvoid} + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + +# Run-time constants + +@const_ref MPI_ANY_SOURCE Cint -1 +@const_ref MPI_ANY_TAG Cint -1 +@const_ref MPI_PROC_NULL Cint -2 +@const_ref MPI_ROOT Cint -4 + +@const_ref MPI_CART Cint 1 +@const_ref MPI_GRAPH Cint 2 +@const_ref MPI_DIST_GRAPH Cint 3 + +@const_ref MPI_IDENT Cint 0 +@const_ref MPI_CONGRUENT Cint 1 +@const_ref MPI_SIMILAR Cint 2 +@const_ref MPI_UNEQUAL Cint 3 + +@const_ref MPI_KEYVAL_INVALID Cint -1 +@const_ref MPI_UNDEFINED Cint -32766 + +@const_ref MPI_TAG_UB Cint 0 +@const_ref MPI_HOST Cint 1 +@const_ref MPI_IO Cint 2 +@const_ref MPI_WTIME_IS_GLOBAL Cint 3 +@const_ref MPI_APPNUM Cint 4 +@const_ref MPI_LASTUSEDCODE Cint 5 +@const_ref MPI_UNIVERSE_SIZE Cint 6 + +@const_ref MPI_WIN_BASE Cint 7 +@const_ref MPI_WIN_SIZE Cint 8 +@const_ref MPI_WIN_DISP_UNIT Cint 9 +@const_ref MPI_WIN_CREATE_FLAVOR Cint 10 +@const_ref MPI_WIN_MODEL Cint 11 + +@const_ref MPI_COMBINER_NAMED Cint 0 +@const_ref MPI_COMBINER_DUP Cint 1 +@const_ref MPI_COMBINER_CONTIGUOUS Cint 2 +@const_ref MPI_COMBINER_VECTOR Cint 3 +@const_ref MPI_COMBINER_HVECTOR_INTEGER Cint 4 +@const_ref MPI_COMBINER_HVECTOR Cint 5 +@const_ref MPI_COMBINER_INDEXED Cint 6 +@const_ref MPI_COMBINER_HINDEXED_INTEGER Cint 7 +@const_ref MPI_COMBINER_HINDEXED Cint 8 +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint 9 +@const_ref MPI_COMBINER_STRUCT_INTEGER Cint 10 +@const_ref MPI_COMBINER_STRUCT Cint 11 +@const_ref MPI_COMBINER_SUBARRAY Cint 12 +@const_ref MPI_COMBINER_DARRAY Cint 13 +@const_ref MPI_COMBINER_F90_REAL Cint 14 +@const_ref MPI_COMBINER_F90_COMPLEX Cint 15 +@const_ref MPI_COMBINER_F90_INTEGER Cint 16 +@const_ref MPI_COMBINER_RESIZED Cint 17 +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint 18 + +@const_ref MPI_COMM_TYPE_SHARED Cint 0 + +@const_ref MPI_DISTRIBUTE_BLOCK Cint 0 +@const_ref MPI_DISTRIBUTE_CYCLIC Cint 1 +@const_ref MPI_DISTRIBUTE_NONE Cint 2 + +@const_ref MPI_SUCCESS Cint 0 +@const_ref MPI_ERR_BUFFER Cint 1 +@const_ref MPI_ERR_COUNT Cint 2 +@const_ref MPI_ERR_TYPE Cint 3 +@const_ref MPI_ERR_TAG Cint 4 +@const_ref MPI_ERR_COMM Cint 5 +@const_ref MPI_ERR_RANK Cint 6 +@const_ref MPI_ERR_REQUEST Cint 7 +@const_ref MPI_ERR_ROOT Cint 8 +@const_ref MPI_ERR_GROUP Cint 9 +@const_ref MPI_ERR_OP Cint 10 +@const_ref MPI_ERR_TOPOLOGY Cint 11 +@const_ref MPI_ERR_DIMS Cint 12 +@const_ref MPI_ERR_ARG Cint 13 +@const_ref MPI_ERR_UNKNOWN Cint 14 +@const_ref MPI_ERR_TRUNCATE Cint 15 +@const_ref MPI_ERR_OTHER Cint 16 +@const_ref MPI_ERR_INTERN Cint 17 +@const_ref MPI_ERR_IN_STATUS Cint 18 +@const_ref MPI_ERR_PENDING Cint 19 +@const_ref MPI_ERR_ACCESS Cint 20 +@const_ref MPI_ERR_AMODE Cint 21 +@const_ref MPI_ERR_ASSERT Cint 22 +@const_ref MPI_ERR_BAD_FILE Cint 23 +@const_ref MPI_ERR_BASE Cint 24 +@const_ref MPI_ERR_CONVERSION Cint 25 +@const_ref MPI_ERR_DISP Cint 26 +@const_ref MPI_ERR_DUP_DATAREP Cint 27 +@const_ref MPI_ERR_FILE_EXISTS Cint 28 +@const_ref MPI_ERR_FILE_IN_USE Cint 29 +@const_ref MPI_ERR_FILE Cint 30 +@const_ref MPI_ERR_INFO_KEY Cint 31 +@const_ref MPI_ERR_INFO_NOKEY Cint 32 +@const_ref MPI_ERR_INFO_VALUE Cint 33 +@const_ref MPI_ERR_INFO Cint 34 +@const_ref MPI_ERR_IO Cint 35 +@const_ref MPI_ERR_KEYVAL Cint 36 +@const_ref MPI_ERR_LOCKTYPE Cint 37 +@const_ref MPI_ERR_NAME Cint 38 +@const_ref MPI_ERR_NO_MEM Cint 39 +@const_ref MPI_ERR_NOT_SAME Cint 40 +@const_ref MPI_ERR_NO_SPACE Cint 41 +@const_ref MPI_ERR_NO_SUCH_FILE Cint 42 +@const_ref MPI_ERR_PORT Cint 43 +@const_ref MPI_ERR_QUOTA Cint 44 +@const_ref MPI_ERR_READ_ONLY Cint 45 +@const_ref MPI_ERR_RMA_CONFLICT Cint 46 +@const_ref MPI_ERR_RMA_SYNC Cint 47 +@const_ref MPI_ERR_SERVICE Cint 48 +@const_ref MPI_ERR_SIZE Cint 49 +@const_ref MPI_ERR_SPAWN Cint 50 +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint 51 +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint 52 +@const_ref MPI_ERR_WIN Cint 53 +@const_ref MPI_T_ERR_MEMORY Cint 54 +@const_ref MPI_T_ERR_NOT_INITIALIZED Cint 55 +@const_ref MPI_T_ERR_CANNOT_INIT Cint 56 +@const_ref MPI_T_ERR_INVALID_INDEX Cint 57 +@const_ref MPI_T_ERR_INVALID_ITEM Cint 58 +@const_ref MPI_T_ERR_INVALID_HANDLE Cint 59 +@const_ref MPI_T_ERR_OUT_OF_HANDLES Cint 60 +@const_ref MPI_T_ERR_OUT_OF_SESSIONS Cint 61 +@const_ref MPI_T_ERR_INVALID_SESSION Cint 62 +@const_ref MPI_T_ERR_CVAR_SET_NOT_NOW Cint 63 +@const_ref MPI_T_ERR_CVAR_SET_NEVER Cint 64 +@const_ref MPI_T_ERR_PVAR_NO_STARTSTOP Cint 65 +@const_ref MPI_T_ERR_PVAR_NO_WRITE Cint 66 +@const_ref MPI_T_ERR_PVAR_NO_ATOMIC Cint 67 +@const_ref MPI_ERR_RMA_RANGE Cint 68 +@const_ref MPI_ERR_RMA_ATTACH Cint 69 +@const_ref MPI_ERR_RMA_FLAVOR Cint 70 +@const_ref MPI_ERR_RMA_SHARED Cint 71 +@const_ref MPI_T_ERR_INVALID Cint 72 +@const_ref MPI_T_ERR_INVALID_NAME Cint 73 +@const_ref MPI_ERR_PROC_ABORTED Cint 74 +@const_ref MPI_ERR_PROC_FAILED Cint 75 +@const_ref MPI_ERR_PROC_FAILED_PENDING Cint 76 +@const_ref MPI_ERR_REVOKED Cint 77 + + +@const_ref MPI_LOCK_EXCLUSIVE Cint 1 +@const_ref MPI_LOCK_SHARED Cint 2 + + +@const_ref MPI_MODE_CREATE Cint 1 +@const_ref MPI_MODE_RDONLY Cint 2 +@const_ref MPI_MODE_WRONLY Cint 4 +@const_ref MPI_MODE_RDWR Cint 8 +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint 16 +@const_ref MPI_MODE_UNIQUE_OPEN Cint 32 +@const_ref MPI_MODE_EXCL Cint 64 +@const_ref MPI_MODE_APPEND Cint 128 +@const_ref MPI_MODE_SEQUENTIAL Cint 256 + +@const_ref MPI_MODE_NOCHECK Cint 1 +@const_ref MPI_MODE_NOPRECEDE Cint 2 +@const_ref MPI_MODE_NOPUT Cint 4 +@const_ref MPI_MODE_NOSTORE Cint 8 +@const_ref MPI_MODE_NOSUCCEED Cint 16 + +@const_ref MPI_ORDER_C Cint 0 +@const_ref MPI_ORDER_FORTRAN Cint 1 + + +@const_ref MPI_SEEK_SET Cint 600 +@const_ref MPI_SEEK_CUR Cint 602 +@const_ref MPI_SEEK_END Cint 604 + +@const_ref MPI_THREAD_SINGLE Cint 0 +@const_ref MPI_THREAD_FUNNELED Cint 1 +@const_ref MPI_THREAD_SERIALIZED Cint 2 +@const_ref MPI_THREAD_MULTIPLE Cint 3 + +@const_ref MPI_TYPECLASS_INTEGER Cint 1 +@const_ref MPI_TYPECLASS_REAL Cint 2 +@const_ref MPI_TYPECLASS_COMPLEX Cint 3 + +@const_ref MPI_ARGV_NULL Ptr{Cvoid} C_NULL +@const_ref MPI_ARGVS_NULL Ptr{Cvoid} C_NULL + +@const_ref MPI_UNWEIGHTED Ptr{Cvoid} 2 +@const_ref MPI_WEIGHTS_EMPTY Ptr{Cvoid} 3 +@const_ref MPI_BOTTOM Ptr{Cvoid} 0 +@const_ref MPI_IN_PLACE Ptr{Cvoid} 1 + +@const_ref MPI_COMM_NULL MPI_Comm cglobal((:ompi_mpi_comm_null, libmpi)) +@const_ref MPI_COMM_SELF MPI_Comm cglobal((:ompi_mpi_comm_self, libmpi)) +@const_ref MPI_COMM_WORLD MPI_Comm cglobal((:ompi_mpi_comm_world, libmpi)) + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function cglobal((:OMPI_C_MPI_COMM_DUP_FN, libmpi)) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function cglobal((:OMPI_C_MPI_COMM_NULL_COPY_FN, libmpi)) +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function cglobal((:OMPI_C_MPI_COMM_NULL_DELETE_FN, libmpi)) + +@const_ref MPI_DATATYPE_NULL MPI_Datatype cglobal((:ompi_mpi_datatype_null, libmpi)) + +@const_ref MPI_BYTE MPI_Datatype cglobal((:ompi_mpi_byte, libmpi)) +@const_ref MPI_PACKED MPI_Datatype cglobal((:ompi_mpi_packed, libmpi)) +@const_ref MPI_CHAR MPI_Datatype cglobal((:ompi_mpi_char, libmpi)) +@const_ref MPI_SHORT MPI_Datatype cglobal((:ompi_mpi_short, libmpi)) +@const_ref MPI_INT MPI_Datatype cglobal((:ompi_mpi_int, libmpi)) +@const_ref MPI_LONG MPI_Datatype cglobal((:ompi_mpi_long, libmpi)) +@const_ref MPI_FLOAT MPI_Datatype cglobal((:ompi_mpi_float, libmpi)) +@const_ref MPI_DOUBLE MPI_Datatype cglobal((:ompi_mpi_double, libmpi)) +# @const_ref MPI_LONG_DOUBLE MPI_Datatype cglobal((:ompi_mpi_long_double, libmpi)) +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype cglobal((:ompi_mpi_unsigned_char, libmpi)) +@const_ref MPI_SIGNED_CHAR MPI_Datatype cglobal((:ompi_mpi_signed_char, libmpi)) +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype cglobal((:ompi_mpi_unsigned_short, libmpi)) +@const_ref MPI_UNSIGNED_LONG MPI_Datatype cglobal((:ompi_mpi_unsigned_long, libmpi)) +@const_ref MPI_UNSIGNED MPI_Datatype cglobal((:ompi_mpi_unsigned, libmpi)) +@const_ref MPI_FLOAT_INT MPI_Datatype cglobal((:ompi_mpi_float_int, libmpi)) +@const_ref MPI_DOUBLE_INT MPI_Datatype cglobal((:ompi_mpi_double_int, libmpi)) +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype cglobal((:ompi_mpi_longdbl_int, libmpi)) +@const_ref MPI_LONG_INT MPI_Datatype cglobal((:ompi_mpi_long_int, libmpi)) +@const_ref MPI_SHORT_INT MPI_Datatype cglobal((:ompi_mpi_short_int, libmpi)) +@const_ref MPI_2INT MPI_Datatype cglobal((:ompi_mpi_2int, libmpi)) +@const_ref MPI_UB MPI_Datatype cglobal((:ompi_mpi_ub, libmpi)) +@const_ref MPI_LB MPI_Datatype cglobal((:ompi_mpi_lb, libmpi)) +@const_ref MPI_WCHAR MPI_Datatype cglobal((:ompi_mpi_wchar, libmpi)) +@const_ref MPI_LONG_LONG_INT MPI_Datatype cglobal((:ompi_mpi_long_long_int, libmpi)) +const MPI_LONG_LONG = MPI_LONG_LONG_INT +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype cglobal((:ompi_mpi_unsigned_long_long, libmpi)) +@const_ref MPI_2COMPLEX MPI_Datatype cglobal((:ompi_mpi_2cplex, libmpi)) +@const_ref MPI_2DOUBLE_COMPLEX MPI_Datatype cglobal((:ompi_mpi_2dblcplex, libmpi)) + +@const_ref MPI_INT8_T MPI_Datatype cglobal((:ompi_mpi_int8_t, libmpi)) +@const_ref MPI_UINT8_T MPI_Datatype cglobal((:ompi_mpi_uint8_t, libmpi)) +@const_ref MPI_INT16_T MPI_Datatype cglobal((:ompi_mpi_int16_t, libmpi)) +@const_ref MPI_UINT16_T MPI_Datatype cglobal((:ompi_mpi_uint16_t, libmpi)) +@const_ref MPI_INT32_T MPI_Datatype cglobal((:ompi_mpi_int32_t, libmpi)) +@const_ref MPI_UINT32_T MPI_Datatype cglobal((:ompi_mpi_uint32_t, libmpi)) +@const_ref MPI_INT64_T MPI_Datatype cglobal((:ompi_mpi_int64_t, libmpi)) +@const_ref MPI_UINT64_T MPI_Datatype cglobal((:ompi_mpi_uint64_t, libmpi)) +@const_ref MPI_AINT MPI_Datatype cglobal((:ompi_mpi_aint, libmpi)) +@const_ref MPI_OFFSET MPI_Datatype cglobal((:ompi_mpi_offset, libmpi)) +@const_ref MPI_C_BOOL MPI_Datatype cglobal((:ompi_mpi_c_bool, libmpi)) +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype cglobal((:ompi_mpi_c_float_complex, libmpi)) +const MPI_C_COMPLEX = MPI_C_FLOAT_COMPLEX +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype cglobal((:ompi_mpi_c_double_complex, libmpi)) +# @const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype cglobal((:ompi_mpi_c_long_double_complex, libmpi)) +@const_ref MPI_COUNT MPI_Datatype cglobal((:ompi_mpi_count, libmpi)) + + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler cglobal((:ompi_mpi_errhandler_null, libmpi)) +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler cglobal((:ompi_mpi_errors_are_fatal, libmpi)) +@const_ref MPI_ERRORS_RETURN MPI_Errhandler cglobal((:ompi_mpi_errors_return, libmpi)) +# @const_ref MPI_ERRORS_ABORT MPI_Errhandler cglobal((:ompi_mpi_errors_abort, libmpi)) + +@const_ref MPI_FILE_NULL MPI_File cglobal((:ompi_mpi_file_null, libmpi)) + +@const_ref MPI_GROUP_EMPTY MPI_Group cglobal((:ompi_mpi_group_empty, libmpi)) +@const_ref MPI_GROUP_NULL MPI_Group cglobal((:ompi_mpi_group_null, libmpi)) + +@const_ref MPI_INFO_ENV MPI_Info cglobal((:ompi_mpi_info_env, libmpi)) +@const_ref MPI_INFO_NULL MPI_Info cglobal((:ompi_mpi_info_null, libmpi)) + +@const_ref MPI_MESSAGE_NO_PROC MPI_Message cglobal((:ompi_message_no_proc, libmpi)) +@const_ref MPI_MESSAGE_NULL MPI_Message cglobal((:ompi_message_null, libmpi)) + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset -54278278 + +@const_ref MPI_OP_NULL MPI_Op cglobal((:ompi_mpi_op_null, libmpi)) +@const_ref MPI_MAX MPI_Op cglobal((:ompi_mpi_op_max, libmpi)) +@const_ref MPI_MIN MPI_Op cglobal((:ompi_mpi_op_min, libmpi)) +@const_ref MPI_SUM MPI_Op cglobal((:ompi_mpi_op_sum, libmpi)) +@const_ref MPI_PROD MPI_Op cglobal((:ompi_mpi_op_prod, libmpi)) +@const_ref MPI_LAND MPI_Op cglobal((:ompi_mpi_op_land, libmpi)) +@const_ref MPI_BAND MPI_Op cglobal((:ompi_mpi_op_band, libmpi)) +@const_ref MPI_LOR MPI_Op cglobal((:ompi_mpi_op_lor, libmpi)) +@const_ref MPI_BOR MPI_Op cglobal((:ompi_mpi_op_bor, libmpi)) +@const_ref MPI_LXOR MPI_Op cglobal((:ompi_mpi_op_lxor, libmpi)) +@const_ref MPI_BXOR MPI_Op cglobal((:ompi_mpi_op_bxor, libmpi)) +@const_ref MPI_MINLOC MPI_Op cglobal((:ompi_mpi_op_minloc, libmpi)) +@const_ref MPI_MAXLOC MPI_Op cglobal((:ompi_mpi_op_maxloc, libmpi)) +@const_ref MPI_REPLACE MPI_Op cglobal((:ompi_mpi_op_replace, libmpi)) +@const_ref MPI_NO_OP MPI_Op cglobal((:ompi_mpi_op_no_op, libmpi)) + +@const_ref MPI_REQUEST_NULL MPI_Request cglobal((:ompi_request_null, libmpi)) + +@const_ref MPI_STATUS_IGNORE Ptr{MPI_Status} C_NULL +@const_ref MPI_STATUSES_IGNORE Ptr{MPI_Status} C_NULL + +@const_ref MPI_TYPE_DUP_FN MPI_Comm_copy_attr_function cglobal((:OMPI_C_MPI_TYPE_DUP_FN, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function cglobal((:OMPI_C_MPI_TYPE_NULL_COPY_FN, libmpi), MPI_Comm_copy_attr_function) +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function cglobal((:OMPI_C_MPI_TYPE_NULL_DELETE_FN, libmpi), MPI_Type_delete_attr_function) + +@const_ref MPI_WIN_NULL MPI_Win cglobal((:ompi_mpi_win_null, libmpi)) + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function cglobal((:OMPI_C_MPI_WIN_DUP_FN, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function cglobal((:OMPI_C_MPI_WIN_NULL_COPY_FN, libmpi), MPI_Win_copy_attr_function) +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function cglobal((:OMPI_C_MPI_WIN_NULL_DELETE_FN, libmpi), MPI_Win_delete_attr_function) From a83a830db5c062704f7f5d2cb224edac535567d3 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 08:30:28 -0800 Subject: [PATCH 05/53] update some unit tests --- .github/workflows/UnitTests.yml | 70 +++++++++++++++------------------ .gitignore | 1 + 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 3ac91439d..615a993c4 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -17,11 +17,8 @@ jobs: - ubuntu-latest - windows-latest julia_version: - # Unsupported - "1.3" - # Unsupported - "1.4" - # Unsupported - "1.5" - "1.6" - - "1.7" + - "1" - "nightly" julia_arch: [x64, x86] exclude: @@ -61,6 +58,8 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- + - name: "add MPIPreferences" + run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences") - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -73,10 +72,7 @@ jobs: #BROKEN - mpich - openmpi julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false @@ -117,6 +113,10 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- + - name: "add MPIPreferences" + run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences") + - name: "Use system binary" + run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary() - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: @@ -132,10 +132,7 @@ jobs: - libmpich-dev - libopenmpi-dev julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false @@ -176,7 +173,10 @@ jobs: ${{ runner.os }}-test-${{ env.cache-name }}- ${{ runner.os }}-test- ${{ runner.os }}- - + - name: "add MPIPreferences" + run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences") + - name: "Use system binary" + run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary() - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -186,10 +186,7 @@ jobs: strategy: matrix: julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false @@ -220,7 +217,7 @@ jobs: run: wget https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17263/l_mpi_2019.9.304.tgz - name: Install Intel MPI - run: | + run: | tar -xzf l_mpi_2019.9.304.tgz pushd l_mpi_2019.9.304 cat << EOF > intel.conf @@ -253,7 +250,7 @@ jobs: ${{ runner.os }}- # we can't use the usual actions here as we need to ensure the environment variables are set - - name: "Build package" + - name: "Build package" run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release julia --project -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)' @@ -268,10 +265,7 @@ jobs: strategy: matrix: julia_version: - - "1.6" - # We don't need to test all combinations - # - "1.7" - # - "nightly" + - "1" fail-fast: false @@ -387,31 +381,31 @@ jobs: # - "1.6" # - "1.7" # - "nightly" -# +# # fail-fast: false -# +# # runs-on: macos-latest -# +# # env: # JULIA_MPI_BINARY: MPItrampoline_jll # MPITRAMPOLINE_VERBOSE: 1 #TODO # MPITRAMPOLINE_LIB: /usr/local/lib/libmpiwrapper.so # MPITRAMPOLINE_MPIEXEC: /usr/local/bin/mpiexec -# +# # steps: # - name: Cancel Previous Runs # uses: styfle/cancel-workflow-action@0.4.0 # with: # access_token: ${{ github.token }} -# +# # - name: Checkout # uses: actions/checkout@v2.2.0 -# +# # - name: Install Homebrew packages # run: brew install autoconf automake # env: # MPI: ${{ matrix.mpi }} -# +# # # We cannot install MPICH or OpenMPI via Homebrew or MacPorts, # # since the MPI libraries there use a flat namespace, which means # # that they cannot be loaded as plugin. We need to build the @@ -433,7 +427,7 @@ jobs: # FC=gfortran-11 \ # FFLAGS=-fallow-argument-mismatch \ # FCFLAGS=-fallow-argument-mismatch -# make -j$(nproc) +# make -j$(nproc) # sudo make -j$(nproc) install # ;; # openmpi) @@ -447,13 +441,13 @@ jobs: # CC=gcc-11 \ # CXX=g++-11 \ # FC=gfortran-11 -# make -j$(nproc) +# make -j$(nproc) # sudo make -j$(nproc) install # ;; # esac # env: # MPI: ${{ matrix.mpi }} -# +# # - name: Build MPIwrapper # run: | # wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz @@ -484,11 +478,11 @@ jobs: # # . # cmake --build . # sudo cmake --install . -# +# # - uses: julia-actions/setup-julia@latest # with: # version: ${{ matrix.julia_version }} -# +# # # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 # - name: Cache artifacts # uses: actions/cache@v1 @@ -501,7 +495,7 @@ jobs: # ${{ runner.os }}-test-${{ env.cache-name }}- # ${{ runner.os }}-test- # ${{ runner.os }}- -# +# # - uses: julia-actions/julia-buildpkg@latest # - uses: julia-actions/julia-runtest@latest @@ -613,7 +607,7 @@ jobs: run: wget https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/17263/l_mpi_2019.9.304.tgz - name: Install Intel MPI - run: | + run: | tar -xzf l_mpi_2019.9.304.tgz pushd l_mpi_2019.9.304 cat << EOF > intel.conf @@ -660,7 +654,7 @@ jobs: ${{ runner.os }}- # We can't use the usual actions here as we need to ensure the environment variables are set - - name: "Build package" + - name: "Build package" run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release julia --project -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)' diff --git a/.gitignore b/.gitignore index 2fdbf4663..783882eea 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ libjuliampi.dylib *.mem *.so Manifest.toml +LocalPreferences.toml \ No newline at end of file From de426cd19c710c2229b80c08cffef58235855573 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 08:34:09 -0800 Subject: [PATCH 06/53] update Open MPI constants --- src/consts/openmpi.jl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/consts/openmpi.jl b/src/consts/openmpi.jl index ffda35066..aeff38e24 100644 --- a/src/consts/openmpi.jl +++ b/src/consts/openmpi.jl @@ -4,13 +4,13 @@ # Implementation limits: const MPI_MAX_DATAREP_STRING = Cint(128) -const MPI_MAX_ERROR_STRING = Cint(512) -const MPI_MAX_INFO_KEY = Cint(255) -const MPI_MAX_INFO_VAL = Cint(1024) -const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) -const MPI_MAX_OBJECT_NAME = Cint(128) -const MPI_MAX_PORT_NAME = Cint(256) -const MPI_MAX_PROCESSOR_NAME = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(256) +const MPI_MAX_INFO_KEY = Cint(36) +const MPI_MAX_INFO_VAL = Cint(256) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(256) +const MPI_MAX_OBJECT_NAME = Cint(64) +const MPI_MAX_PORT_NAME = Cint(1024) +const MPI_MAX_PROCESSOR_NAME = Cint(256) # Types From e02b93f70ecabcce1ea32296545264b272f5f95a Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 08:35:35 -0800 Subject: [PATCH 07/53] fix unit tests --- .github/workflows/UnitTests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 615a993c4..29b96f2c4 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -59,7 +59,7 @@ jobs: ${{ runner.os }}- - name: "add MPIPreferences" - run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences") + run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences")' - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -114,9 +114,9 @@ jobs: ${{ runner.os }}- - name: "add MPIPreferences" - run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences") + run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences")' - name: "Use system binary" - run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary() + run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()' - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: @@ -174,9 +174,9 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- - name: "add MPIPreferences" - run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences") + run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences")' - name: "Use system binary" - run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary() + run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()' - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest From ad165d71c11af48a261b5c125f08b1387cfed877 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 09:02:28 -0800 Subject: [PATCH 08/53] fix identify_abi --- lib/MPIPreferences/src/MPIPreferences.jl | 37 ++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl index 37f6457b5..ee97af844 100644 --- a/lib/MPIPreferences/src/MPIPreferences.jl +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -48,9 +48,7 @@ function use_system_binary(; error("MPI library could not be found") end if isnothing(abi) - versionstring = Get_library_version(libmpi) - impl, version = identify_implementation(versionstring) - abi = identify_abi(impl, version) + abi = identify_abi(libmpi) end if mpiexec isa Cmd mpiexec = collect(mpiexec) @@ -63,12 +61,14 @@ function use_system_binary(; ) end + """ - Get_library_version(libmpi) + identify_abi(libmpi) -Get the version string of the MPI library. +Identify the MPI implementation from the library version string """ -function Get_library_version(libmpi) +function identify_abi(libmpi) + # 1) query MPI_Get_version # There is no way to query at runtime what the length of the buffer should be. # https://github.com/mpi-forum/mpi-issues/issues/159 # 8192 is the maximum value of MPI_MAX_LIBRARY_VERSION_STRING across known @@ -82,16 +82,9 @@ function Get_library_version(libmpi) @assert buflen[] < 8192 resize!(buf, buflen[]) - return String(buf) -end - + version_string = String(buf) -""" - identify_abi(version_string) - -Identify the MPI implementation from the library version string -""" -function identify_abi(version_string::String) + # 2) try to identify the MPI implementation impl = "unknown" version = v"0" @@ -143,22 +136,30 @@ function identify_abi(version_string::String) if (m = match(r"CRAY MPICH version (\d+.\d+.\d+)", version_string)) !== nothing version = VersionNumber(m.captures[1]) end + elseif startswith(version_string, "FUJITSU MPI") + impl = "FujitsuMPI" + # "FUJITSU MPI Library 4.0.0 (4.0.1fj4.0.0)\0" + if (m = match(r"^FUJITSU MPI Library (\d+.\d+.\d+)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end end - - # determine the abi from the implementation + version + # 3) determine the abi from the implementation + version if (impl == "MPICH" && version >= v"3.1" || impl == "IntelMPI" && version > v"2014" || impl == "MVAPICH" && version >= v"2" || impl == "CrayMPICH" && version >= v"7") # https://www.mpich.org/abi/ abi = "MPICH" - elseif impl == "OpenMPI" || impl == "IBMSpectrumMPI" + elseif impl == "OpenMPI" || impl == "IBMSpectrumMPI" || impl == "FujitsuMPI" abi = "OpenMPI" elseif impl == "MicrosoftMPI" abi = "MicrosoftMPI" else abi = "unknown" end + + @info "MPI implementation" libmpi version_string impl version abi + return abi end From 2962c775dea5dc245dfc3b0855f934308534c64d Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 09:08:13 -0800 Subject: [PATCH 09/53] fix github actions on windows --- .github/workflows/UnitTests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 29b96f2c4..171ace0df 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -58,8 +58,11 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- - - name: "add MPIPreferences" - run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences")' + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest From cbf99772598ce6178625e20a21472db9625e5efc Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 09:32:12 -0800 Subject: [PATCH 10/53] better error messages --- .github/workflows/UnitTests.yml | 46 ++++++++++----------------------- src/MPI.jl | 2 +- 2 files changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 171ace0df..404f95d96 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -28,8 +28,6 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} - env: - JULIA_MPIEXEC_ARGS: ${{ matrix.mpiexec_args }} steps: - name: Cancel Previous Runs @@ -44,25 +42,14 @@ jobs: with: arch: ${{ matrix.julia_arch }} version: ${{ matrix.julia_version }} - - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - name: add MPIPreferences shell: julia --color=yes --project=. {0} run: | using Pkg Pkg.develop(path="lib/MPIPreferences") + - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -164,26 +151,21 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - name: "add MPIPreferences" - run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences")' - - name: "Use system binary" - run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()' + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + - name: Use system binary + shell: julia --color=yes --project=. {0} + run: | + using MPIPreferences + MPIPreferences.use_system_binary() - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest - test-intel-linux: timeout-minutes: 20 strategy: diff --git a/src/MPI.jl b/src/MPI.jl index b166e8cf2..529d33f27 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -43,7 +43,7 @@ elseif MPIPreferences.binary == "OpenMPI_jll" elseif MPIPreferences.binary == "MicrosofMPI_jll" import MicrosofMPI_jll: libmpi, mpiexec else - error("Unknown MPI binarys") + error("Unknown MPI binary: $(MPIPreferences.binary)") end include("consts/consts.jl") From bfe175372a8b6f36b33935199a9b8d3cb1cdfa4b Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Tue, 15 Feb 2022 09:46:33 -0800 Subject: [PATCH 11/53] typo --- src/MPI.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MPI.jl b/src/MPI.jl index 529d33f27..1f43d40bd 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -40,8 +40,8 @@ import MPIPreferences import MPICH_jll: libmpi, mpiexec elseif MPIPreferences.binary == "OpenMPI_jll" import OpenMPI_jll: libmpi, mpiexec -elseif MPIPreferences.binary == "MicrosofMPI_jll" - import MicrosofMPI_jll: libmpi, mpiexec +elseif MPIPreferences.binary == "MicrosoftMPI_jll" + import MicrosoftMPI_jll: libmpi, mpiexec else error("Unknown MPI binary: $(MPIPreferences.binary)") end From ed662e5452bdafc045212594ad5c2f0311d603ee Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 17 Feb 2022 22:05:07 -0800 Subject: [PATCH 12/53] fix tests --- .github/workflows/UnitTests.yml | 47 +++++++----------------- Project.toml | 8 ---- lib/MPIPreferences/src/MPIPreferences.jl | 24 +++++++++--- src/MPI.jl | 3 ++ src/consts/consts.jl | 4 +- test/Project.toml | 5 +++ test/runtests.jl | 4 ++ 7 files changed, 46 insertions(+), 49 deletions(-) create mode 100644 test/Project.toml diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 404f95d96..3736deb29 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -90,23 +90,15 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - - name: "add MPIPreferences" - run: julia --project -e 'using Pkg; Pkg.develop(path="lib/MPIPreferences")' - - name: "Use system binary" - run: julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary()' + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(export_prefs=true) - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: @@ -153,16 +145,14 @@ jobs: - uses: julia-actions/cache@v1 - - name: add MPIPreferences - shell: julia --color=yes --project=. {0} + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} run: | using Pkg Pkg.develop(path="lib/MPIPreferences") - - name: Use system binary - shell: julia --color=yes --project=. {0} - run: | using MPIPreferences - MPIPreferences.use_system_binary() + MPIPreferences.use_system_binary(export_prefs=true) + - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -221,18 +211,7 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 # we can't use the usual actions here as we need to ensure the environment variables are set - name: "Build package" diff --git a/Project.toml b/Project.toml index ca2762fea..c70b634b0 100644 --- a/Project.toml +++ b/Project.toml @@ -22,11 +22,3 @@ Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" DocStringExtensions = "0.8" Requires = "~0.5, 1.0" julia = "1.6" - -[extras] -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" -DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["CUDA", "DoubleFloats", "Test"] diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl index ee97af844..fa1ca2594 100644 --- a/lib/MPIPreferences/src/MPIPreferences.jl +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -13,7 +13,7 @@ elseif binary == "MPICH_jll" elseif binary == "OpenMPI_jll" "OpenMPI" elseif binary == "MPItrampoline_jll" - "MPItrampoline" + "MPIwrapper" else error("Unknown binary: $binary") end @@ -26,14 +26,16 @@ module System mpiexec(f) = f(`$mpiexec_path`) end -function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll") +function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_jll";export_prefs=false, force=true) binary in ["MicrosoftMPI_jll", "MPICH_jll", "OpenMPI_jll", "MPItrampoline_jll"] || error("Unknown jll: $binary") - @set_preferences!( + set_preferences!(MPIPreferences, "binary" => binary, "libmpi" => nothing, "abi" => nothing, - "mpiexec" => nothing + "mpiexec" => nothing; + export_prefs=export_prefs, + force=force ) end @@ -41,6 +43,8 @@ function use_system_binary(; library=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"], mpiexec="mpiexec", abi=nothing, + export_prefs=false, + force=true, ) libmpi = find_library(library) @@ -53,11 +57,13 @@ function use_system_binary(; if mpiexec isa Cmd mpiexec = collect(mpiexec) end - @set_preferences!( + set_preferences!(MPIPreferences, "binary" => "system", "libmpi" => libmpi, "abi" => abi, "mpiexec" => mpiexec, + export_prefs=export_prefs, + force=force ) end @@ -142,6 +148,12 @@ function identify_abi(libmpi) if (m = match(r"^FUJITSU MPI Library (\d+.\d+.\d+)", version_string)) !== nothing version = VersionNumber(m.captures[1]) end + elseif startswith(version_string, "MPIwrapper") + impl = "MPIwrapper" + # MPIwrapper 2.2.2 + if (m = match(r"^MPIwrapper Version:\t(\d+.\d+.\d+\w*)", version_string)) !== nothing + version = VersionNumber(m.captures[1]) + end end # 3) determine the abi from the implementation + version if (impl == "MPICH" && version >= v"3.1" || @@ -154,6 +166,8 @@ function identify_abi(libmpi) abi = "OpenMPI" elseif impl == "MicrosoftMPI" abi = "MicrosoftMPI" + elseif impl == "MPIwrapper" + abi = "MPIwrapper" else abi = "unknown" end diff --git a/src/MPI.jl b/src/MPI.jl index 1f43d40bd..115394572 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -42,6 +42,9 @@ elseif MPIPreferences.binary == "OpenMPI_jll" import OpenMPI_jll: libmpi, mpiexec elseif MPIPreferences.binary == "MicrosoftMPI_jll" import MicrosoftMPI_jll: libmpi, mpiexec +elseif MPIPreferences.binary == "MPItrampoline_jll" + import MPItrampoline_jll: libmpi, mpiexec + const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path else error("Unknown MPI binary: $(MPIPreferences.binary)") end diff --git a/src/consts/consts.jl b/src/consts/consts.jl index 421a8e254..8259abcce 100644 --- a/src/consts/consts.jl +++ b/src/consts/consts.jl @@ -33,8 +33,8 @@ elseif MPIPreferences.abi == "OpenMPI" include("openmpi.jl") elseif MPIPreferences.abi == "MicrosofMPI" include("microsoftmpi.jl") -elseif MPIPreferences.abi == "MPItrampoline" - include("mpitrampoline.jl") +elseif MPIPreferences.abi == "MPIwrapper" + include("mpiwrapper.jl") else error("Unknown MPI ABI") end diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 000000000..f15551b1c --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,5 @@ +[deps] +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" diff --git a/test/runtests.jl b/test/runtests.jl index 302d2a222..de52ebd23 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,9 @@ using Test, MPI +using MPIPreferences + +@show MPIPreferences.abi MPIPreferences.binary + # load test packages to trigger precompilation using DoubleFloats if get(ENV, "JULIA_MPI_TEST_ARRAYTYPE", "") == "CuArray" From 7999dede24c0a647ba4b18b0b80aa1e9037919b0 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 17 Feb 2022 22:15:22 -0800 Subject: [PATCH 13/53] add Pkg to test deps --- Project.toml | 1 - test/Project.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index c70b634b0..cadf55018 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" MicrosoftMPI_jll = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" OpenMPI_jll = "fe0851c0-eecd-5654-98d4-656369965a5c" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Requires = "ae029012-a4dd-5104-9daa-d747884805df" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" diff --git a/test/Project.toml b/test/Project.toml index f15551b1c..3af2eafd0 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -3,3 +3,4 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" From b2d91ccd5c029d149225189862d7edbb0272f2e7 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 17 Feb 2022 22:17:49 -0800 Subject: [PATCH 14/53] remove deps --- deps/.gitignore | 6 - .../.github/workflows/CI.yml | 164 ------ deps/MPIconstants-1.4.0/CMakeLists.txt | 31 - deps/MPIconstants-1.4.0/LICENSE.md | 7 - deps/MPIconstants-1.4.0/README.md | 43 -- .../generate_compile_time_mpi_constants.c | 144 ----- .../load_time_mpi_constants.c | 536 ------------------ deps/build.jl | 281 --------- deps/compile_time_mpi_constants_msmpi_i686.jl | 73 --- ...compile_time_mpi_constants_msmpi_x86_64.jl | 73 --- deps/prepare_mpi_constants.jl | 33 -- 11 files changed, 1391 deletions(-) delete mode 100644 deps/.gitignore delete mode 100644 deps/MPIconstants-1.4.0/.github/workflows/CI.yml delete mode 100644 deps/MPIconstants-1.4.0/CMakeLists.txt delete mode 100644 deps/MPIconstants-1.4.0/LICENSE.md delete mode 100644 deps/MPIconstants-1.4.0/README.md delete mode 100644 deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c delete mode 100644 deps/MPIconstants-1.4.0/load_time_mpi_constants.c delete mode 100644 deps/build.jl delete mode 100644 deps/compile_time_mpi_constants_msmpi_i686.jl delete mode 100644 deps/compile_time_mpi_constants_msmpi_x86_64.jl delete mode 100644 deps/prepare_mpi_constants.jl diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index a57b5a1c6..000000000 --- a/deps/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -deps.jl -build.log -generate_compile_time_mpi_constants -compile_time_mpi_constants.jl -load_time_mpi_constants.dylib -load_time_mpi_constants.so diff --git a/deps/MPIconstants-1.4.0/.github/workflows/CI.yml b/deps/MPIconstants-1.4.0/.github/workflows/CI.yml deleted file mode 100644 index 8279e42b9..000000000 --- a/deps/MPIconstants-1.4.0/.github/workflows/CI.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - branches: [main] - -env: - BUILD_TYPE: Debug - -jobs: - build: - strategy: - matrix: - os: - - ubuntu-20.04 - - macos-11 - #TODO - windows-2019 - mpi: [MPICH, OpenMPI, MSMPI] - exclude: - - os: ubuntu-20.04 - mpi: MSMPI - - os: macos-11 - mpi: MSMPI - - os: windows-2019 - mpi: MPICH - - os: windows-2019 - mpi: OpenMPI - - runs-on: ${{matrix.os}} - - steps: - - uses: actions/checkout@v2 - - - name: Install ${{matrix.mpi}} - shell: bash - run: | - case $RUNNER_OS in - Linux) - case "${{matrix.mpi}}" in - MPICH) packages=libmpich-dev;; - OpenMPI) packages=libopenmpi-dev;; - esac - sudo apt-get install $packages - ;; - macOS) - # The Homebrew MPICH doesn't have the `mpi-f08` Fortran - # module, but cmake insists on it. We thus use MacPorts - # instead. - - # case "${{matrix.mpi}}" in - # MPICH) packages=mpich;; - # OpenMPI) packages=open-mpi;; - # esac - # brew install $packages - - # Install MacPorts - wget https://github.com/macports/macports-base/releases/download/v2.7.1/MacPorts-2.7.1-11-BigSur.pkg - sudo /usr/sbin/installer -pkg MacPorts-2.7.1-11-BigSur.pkg -target / - rm MacPorts-2.7.1-11-BigSur.pkg - echo /opt/local/bin >> $GITHUB_PATH - echo /opt/local/sbin >> $GITHUB_PATH - export "PATH=/opt/local/bin:/opt/local/sbin:$PATH" - sudo port sync - - case "${{matrix.mpi}}" in - MPICH) packages='mpich-gcc10 +fortran';; - OpenMPI) packages='openmpi-gcc11 +fortran';; - esac - sudo port install $packages - ;; - Windows) - # wget https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe - # See - # Should we use instead? - echo AAA - curl -L -O https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe - echo BBB - ./msmpisetup.exe -unattend -force - echo CCC - Test-Path "C:/Program Files/Microsoft MPI/Bin/mpiexec.exe" -PathType leaf - echo DDD - echo "C:/Program Files/Microsoft MPI/Bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - echo EEE - ;; - esac - - - name: Configure - shell: bash - run: | - case $RUNNER_OS in - Linux) - cmake -B ${{github.workspace}}/build \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - macOS) - case ${{matrix.mpi}} in - MPICH) - # The compiler wrappers have non-standard names - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=mpicc-mpich-gcc10 \ - -DMPIEXEC_EXECUTABLE=/opt/local/bin/mpiexec-mpich-gcc10 \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - OpenMPI) - # The compiler wrappers have non-standard names - cmake -B ${{github.workspace}}/build \ - -DCMAKE_C_COMPILER=mpicc-openmpi-gcc11 \ - -DMPIEXEC_EXECUTABLE=/opt/local/bin/mpiexec-openmpi-gcc11 \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - esac - ;; - Windows) - cmake -B ${{github.workspace}}/build \ - -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ - -DCMAKE_INSTALL_PREFIX=${HOME}/mpiconstants - ;; - esac - - - name: Build - shell: bash - run: | - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - shell: bash - run: ctest -C ${{env.BUILD_TYPE}} - - - name: Install - shell: bash - run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - shell: bash - run: | - # Test generating compile-time constants - ${HOME}/mpiconstants/bin/generate_compile_time_mpi_constants - test -f compile_time_mpi_constants.jl - grep -q 'MPI_MAX_LIBRARY_VERSION_STRING' compile_time_mpi_constants.jl - grep -q 'MPI_Status' compile_time_mpi_constants.jl - grep -q 'MPI_Comm' compile_time_mpi_constants.jl - # Examine load-time constants - if [ $(uname) = Darwin ]; then - dlsuffix='dylib' - symprefix='_' - symtype='[DS]' - else - dlsuffix='so' - symprefix='' - symtype='[BDR]' - fi - test -e ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} - nm ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} | - grep -q " ${symtype} ${symprefix}MPICONSTANTS_COMM_WORLD\$" - nm ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} | - grep -q " ${symtype} ${symprefix}MPICONSTANTS_INT\$" - nm ${HOME}/mpiconstants/lib/libload_time_mpi_constants.${dlsuffix} | - grep -q " ${symtype} ${symprefix}MPICONSTANTS_STATUS_IGNORE\$" diff --git a/deps/MPIconstants-1.4.0/CMakeLists.txt b/deps/MPIconstants-1.4.0/CMakeLists.txt deleted file mode 100644 index 9ae9f68e1..000000000 --- a/deps/MPIconstants-1.4.0/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -cmake_minimum_required(VERSION 3.12...3.20) -project( - MPIwrapper - VERSION 1.4.0 - DESCRIPTION "MPI constants" - LANGUAGES C - ) - -set(CMAKE_C_STANDARD 11) - -find_package(MPI REQUIRED) - -add_library(load_time_mpi_constants SHARED - load_time_mpi_constants.c - ) -target_link_libraries(load_time_mpi_constants PRIVATE MPI::MPI_C) -install( - TARGETS load_time_mpi_constants - LIBRARY - DESTINATION lib - ) - -add_executable(generate_compile_time_mpi_constants - generate_compile_time_mpi_constants.c - ) -target_link_libraries(generate_compile_time_mpi_constants PRIVATE MPI::MPI_C) -install( - TARGETS generate_compile_time_mpi_constants - RUNTIME - DESTINATION bin - ) diff --git a/deps/MPIconstants-1.4.0/LICENSE.md b/deps/MPIconstants-1.4.0/LICENSE.md deleted file mode 100644 index b6485213b..000000000 --- a/deps/MPIconstants-1.4.0/LICENSE.md +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2021 Erik Schnetter - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/MPIconstants-1.4.0/README.md b/deps/MPIconstants-1.4.0/README.md deleted file mode 100644 index 8b1541012..000000000 --- a/deps/MPIconstants-1.4.0/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# MPIconstants - -* [![GitHub - CI](https://github.com/eschnett/MPIconstants/actions/workflows/CI.yml/badge.svg)](https://github.com/eschnett/MPIconstants/actions) - -Extract compile-time and load-time constants from and MPI library. -This is useful for libraries or applications that are not written in -C, C++, or Fortran, and want to link against an MPI library as a -binary dependency. - -For the compile-time constants (e.g. `MPI_VERSION`), an executable -`generate_compile_time_mpi_constants` is created that outputs their -definitions. - -For the load-time constants (e.g. `MPI_COMM_WORLD`), a shared library -`libload_time_mpi_constants.so` is created that defines global -variables holding the respective values. - -Example output from `generate_compile_time_mpi_constants`: -```Julia - const MPI_VERSION_ = Cint(3) - const MPI_SUBVERSION_ = Cint(1) -``` -(This output is actually Julia code.) - -Example definition in `libload_time_mpi_constants.so`: -```C -const MPI_Comm MPICONSTANTS_COMM_NULL; -const MPI_Comm MPICONSTANTS_COMM_SELF; -const MPI_Comm MPICONSTANTS_COMM_WORLD; -``` -This shared library can be loaded via `dlopen`, and the constants -`MPICONSTANTS_COMM_NULL` etc. can be read to determine the respective -values. - -# Using `cmake` to build this library - -```sh -rm -rf build $HOME/src/c/MPIstuff/mpiconstants-openmpi -cmake -S . -B build -G Ninja -DMPIEXEC_EXECUTABLE=$(which mpiexec-openmpi-gcc11) -DCMAKE_C_COMPILER=mpicc-openmpi-gcc11 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$HOME/src/c/MPIstuff/mpiconstants-openmpi -cmake --build build -cmake --install build -``` diff --git a/deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c b/deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c deleted file mode 100644 index 17cae2b2c..000000000 --- a/deps/MPIconstants-1.4.0/generate_compile_time_mpi_constants.c +++ /dev/null @@ -1,144 +0,0 @@ -#include -#include -#include -#include - -#include - -// This should be defined in in C11, but some older compilers don't -#ifndef static_assert -#define static_assert(cond, msg) _Static_assert(cond, msg) -#endif - -int main(int argc, char **argv) { - MPI_Init(&argc, &argv); - - FILE *file = fopen("compile_time_mpi_constants.jl", "w"); - - fprintf(file, "# This file has been generated automatically by " - "`generate_compile_time_mpi_constants`.\n"); - fprintf(file, "# Do not edit.\n"); - fprintf(file, "\n"); - - fprintf( - file, - "# MPI library version (for reference only; this is not a constant)\n"); - int len; - char library_version[MPI_MAX_LIBRARY_VERSION_STRING]; - MPI_Get_library_version(library_version, &len); - fprintf(file, "const MPI_LIBRARY_VERSION_ = \""); - for (const char *restrict p = library_version; *p; ++p) { - switch (*p) { - case '\t': - fprintf(file, "\\t"); - break; - case '\n': - fprintf(file, "\\n"); - break; - case '"': - case '$': - case '\\': - fprintf(file, "\\%c", *p); - break; - default: - // Omit non-printable characters for safety - if (isprint(*p)) - fprintf(file, "%c", *p); - } - } - fprintf(file, "\"\n"); - fprintf(file, "\n"); - - fprintf(file, "# Compile-time constants\n"); - fprintf(file, "\n"); - fprintf(file, "# Version:\n"); - fprintf(file, - "# (We add an underscore to avoid a name conflict with `MPI.jl`)\n"); - fprintf(file, "const MPI_VERSION_ = Cint(%d)\n", MPI_VERSION); - fprintf(file, "const MPI_SUBVERSION_ = Cint(%d)\n", MPI_SUBVERSION); - fprintf(file, "\n"); - fprintf(file, "# Implementation limits:\n"); - fprintf(file, "const MPI_MAX_DATAREP_STRING = Cint(%d)\n", - MPI_MAX_DATAREP_STRING); - fprintf(file, "const MPI_MAX_ERROR_STRING = Cint(%d)\n", - MPI_MAX_ERROR_STRING); - fprintf(file, "const MPI_MAX_INFO_KEY = Cint(%d)\n", MPI_MAX_INFO_KEY); - fprintf(file, "const MPI_MAX_INFO_VAL = Cint(%d)\n", MPI_MAX_INFO_VAL); - fprintf(file, "const MPI_MAX_LIBRARY_VERSION_STRING = Cint(%d)\n", - MPI_MAX_LIBRARY_VERSION_STRING); - fprintf(file, "const MPI_MAX_OBJECT_NAME = Cint(%d)\n", MPI_MAX_OBJECT_NAME); - fprintf(file, "const MPI_MAX_PORT_NAME = Cint(%d)\n", MPI_MAX_PORT_NAME); - fprintf(file, "const MPI_MAX_PROCESSOR_NAME = Cint(%d)\n", - MPI_MAX_PROCESSOR_NAME); - - fprintf(file, "\n"); - fprintf(file, "# Types\n"); - fprintf(file, "\n"); - fprintf(file, "# Various (signed) integer types:\n"); - fprintf(file, "const MPI_Aint = Int%zu\n", 8 * sizeof(MPI_Aint)); - fprintf(file, "const MPI_Count = Int%zu\n", 8 * sizeof(MPI_Count)); - fprintf(file, "const MPI_Fint = Int%zu\n", 8 * sizeof(MPI_Fint)); - fprintf(file, "const MPI_Offset = Int%zu\n", 8 * sizeof(MPI_Offset)); - fprintf(file, "\n"); - fprintf(file, "# Status:\n"); - static_assert(sizeof(MPI_Status) % sizeof(int) == 0, - "MPI_Status is not made of `int` fields"); - static_assert(offsetof(MPI_Status, MPI_ERROR) % sizeof(int) == 0, - "MPI_Status field MPI_ERROR is not aligned to `int`"); - static_assert(offsetof(MPI_Status, MPI_SOURCE) % sizeof(int) == 0, - "MPI_Status field MPI_SOURCE is not aligned to `int`"); - static_assert(offsetof(MPI_Status, MPI_TAG) % sizeof(int) == 0, - "MPI_Status field MPI_TAG is not aligned to `int`"); - fprintf(file, "struct MPI_Status\n"); - for (size_t n = 0; n < sizeof(MPI_Status) / sizeof(int); ++n) { - if (n == offsetof(MPI_Status, MPI_ERROR) / sizeof(int)) - fprintf(file, " MPI_ERROR::Cint\n"); - else if (n == offsetof(MPI_Status, MPI_SOURCE) / sizeof(int)) - fprintf(file, " MPI_SOURCE::Cint\n"); - else if (n == offsetof(MPI_Status, MPI_TAG) / sizeof(int)) - fprintf(file, " MPI_TAG::Cint\n"); - else - fprintf(file, " private%zu::Cint\n", n); - } - fprintf(file, "end\n"); - fprintf(file, "\n"); - fprintf(file, "# Opaque handles:\n"); - fprintf(file, "const MPI_Comm = UInt%zu\n", 8 * sizeof(MPI_Comm)); - fprintf(file, "const MPI_Datatype = UInt%zu\n", 8 * sizeof(MPI_Datatype)); - fprintf(file, "const MPI_Errhandler = UInt%zu\n", 8 * sizeof(MPI_Errhandler)); - fprintf(file, "const MPI_File = UInt%zu\n", 8 * sizeof(MPI_File)); - fprintf(file, "const MPI_Group = UInt%zu\n", 8 * sizeof(MPI_Group)); - fprintf(file, "const MPI_Info = UInt%zu\n", 8 * sizeof(MPI_Info)); - fprintf(file, "const MPI_Message = UInt%zu\n", 8 * sizeof(MPI_Message)); - fprintf(file, "const MPI_Op = UInt%zu\n", 8 * sizeof(MPI_Op)); - fprintf(file, "const MPI_Request = UInt%zu\n", 8 * sizeof(MPI_Request)); - fprintf(file, "const MPI_Win = UInt%zu\n", 8 * sizeof(MPI_Win)); - fprintf(file, "\n"); - fprintf(file, "# Function pointers:\n"); - fprintf(file, "const MPI_Comm_copy_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Comm_delete_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Comm_errhandler_function = Ptr{Cvoid}\n"); - fprintf(file, - "const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function\n"); - fprintf(file, "const MPI_Copy_function = MPI_Comm_copy_attr_function\n"); - fprintf(file, "const MPI_Datarep_conversion_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Datarep_extent_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Delete_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_File_errhandler_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_File_errhandler_fn = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Grequest_cancel_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Grequest_free_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Grequest_query_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Type_copy_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Type_delete_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_User_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_copy_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_delete_attr_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_errhandler_function = Ptr{Cvoid}\n"); - fprintf(file, "const MPI_Win_errhandler_fn = MPI_Win_errhandler_function\n"); - - fclose(file); - - MPI_Finalize(); - return 0; -} diff --git a/deps/MPIconstants-1.4.0/load_time_mpi_constants.c b/deps/MPIconstants-1.4.0/load_time_mpi_constants.c deleted file mode 100644 index a00e45649..000000000 --- a/deps/MPIconstants-1.4.0/load_time_mpi_constants.c +++ /dev/null @@ -1,536 +0,0 @@ -#include - -// Load-time constants -int MPICONSTANTS_ANY_SOURCE; -int MPICONSTANTS_ANY_TAG; -int MPICONSTANTS_PROC_NULL; -int MPICONSTANTS_ROOT; -int MPICONSTANTS_CART; -int MPICONSTANTS_DIST_GRAPH; -int MPICONSTANTS_GRAPH; -int MPICONSTANTS_CONGRUENT; -int MPICONSTANTS_IDENT; -int MPICONSTANTS_SIMILAR; -int MPICONSTANTS_UNEQUAL; -int MPICONSTANTS_BSEND_OVERHEAD; -int MPICONSTANTS_KEYVAL_INVALID; -int MPICONSTANTS_UNDEFINED; -int MPICONSTANTS_APPNUM; -int MPICONSTANTS_HOST; -int MPICONSTANTS_IO; -int MPICONSTANTS_LASTUSEDCODE; -int MPICONSTANTS_TAG_UB; -int MPICONSTANTS_UNIVERSE_SIZE; -int MPICONSTANTS_WIN_BASE; -int MPICONSTANTS_WIN_CREATE_FLAVOR; -int MPICONSTANTS_WIN_DISP_UNIT; -int MPICONSTANTS_WIN_MODEL; -int MPICONSTANTS_WIN_SIZE; -int MPICONSTANTS_WTIME_IS_GLOBAL; -int MPICONSTANTS_COMBINER_CONTIGUOUS; -int MPICONSTANTS_COMBINER_DARRAY; -int MPICONSTANTS_COMBINER_DUP; -int MPICONSTANTS_COMBINER_F90_COMPLEX; -int MPICONSTANTS_COMBINER_F90_INTEGER; -int MPICONSTANTS_COMBINER_F90_REAL; -int MPICONSTANTS_COMBINER_HINDEXED; -int MPICONSTANTS_COMBINER_HINDEXED_BLOCK; -int MPICONSTANTS_COMBINER_HVECTOR; -int MPICONSTANTS_COMBINER_INDEXED; -int MPICONSTANTS_COMBINER_INDEXED_BLOCK; -int MPICONSTANTS_COMBINER_NAMED; -int MPICONSTANTS_COMBINER_RESIZED; -int MPICONSTANTS_COMBINER_STRUCT; -int MPICONSTANTS_COMBINER_SUBARRAY; -int MPICONSTANTS_COMBINER_VECTOR; -int MPICONSTANTS_COMM_TYPE_SHARED; -int MPICONSTANTS_DISTRIBUTE_BLOCK; -int MPICONSTANTS_DISTRIBUTE_CYCLIC; -int MPICONSTANTS_DISTRIBUTE_NONE; -int MPICONSTANTS_ERR_ACCESS; -int MPICONSTANTS_ERR_AMODE; -int MPICONSTANTS_ERR_ARG; -int MPICONSTANTS_ERR_ASSERT; -int MPICONSTANTS_ERR_BAD_FILE; -int MPICONSTANTS_ERR_BASE; -int MPICONSTANTS_ERR_BUFFER; -int MPICONSTANTS_ERR_COMM; -int MPICONSTANTS_ERR_CONVERSION; -int MPICONSTANTS_ERR_COUNT; -int MPICONSTANTS_ERR_DIMS; -int MPICONSTANTS_ERR_DISP; -int MPICONSTANTS_ERR_DUP_DATAREP; -int MPICONSTANTS_ERR_FILE; -int MPICONSTANTS_ERR_FILE_EXISTS; -int MPICONSTANTS_ERR_FILE_IN_USE; -int MPICONSTANTS_ERR_GROUP; -int MPICONSTANTS_ERR_INFO; -int MPICONSTANTS_ERR_INFO_KEY; -int MPICONSTANTS_ERR_INFO_NOKEY; -int MPICONSTANTS_ERR_INFO_VALUE; -int MPICONSTANTS_ERR_INTERN; -int MPICONSTANTS_ERR_IN_STATUS; -int MPICONSTANTS_ERR_IO; -int MPICONSTANTS_ERR_KEYVAL; -int MPICONSTANTS_ERR_LASTCODE; -int MPICONSTANTS_ERR_LOCKTYPE; -int MPICONSTANTS_ERR_NAME; -int MPICONSTANTS_ERR_NOT_SAME; -int MPICONSTANTS_ERR_NO_MEM; -int MPICONSTANTS_ERR_NO_SPACE; -int MPICONSTANTS_ERR_NO_SUCH_FILE; -int MPICONSTANTS_ERR_OP; -int MPICONSTANTS_ERR_OTHER; -int MPICONSTANTS_ERR_PENDING; -int MPICONSTANTS_ERR_PORT; -int MPICONSTANTS_ERR_QUOTA; -int MPICONSTANTS_ERR_RANK; -int MPICONSTANTS_ERR_READ_ONLY; -int MPICONSTANTS_ERR_REQUEST; -#if MPI_VERSION >= 3 -int MPICONSTANTS_ERR_RMA_ATTACH; -#endif -int MPICONSTANTS_ERR_RMA_CONFLICT; -#if MPI_VERSION >= 3 -int MPICONSTANTS_ERR_RMA_FLAVOR; -int MPICONSTANTS_ERR_RMA_RANGE; -int MPICONSTANTS_ERR_RMA_SHARED; -#endif -int MPICONSTANTS_ERR_RMA_SYNC; -int MPICONSTANTS_ERR_ROOT; -int MPICONSTANTS_ERR_SERVICE; -int MPICONSTANTS_ERR_SIZE; -int MPICONSTANTS_ERR_SPAWN; -int MPICONSTANTS_ERR_TAG; -int MPICONSTANTS_ERR_TOPOLOGY; -int MPICONSTANTS_ERR_TRUNCATE; -int MPICONSTANTS_ERR_TYPE; -int MPICONSTANTS_ERR_UNKNOWN; -int MPICONSTANTS_ERR_UNSUPPORTED_DATAREP; -int MPICONSTANTS_ERR_UNSUPPORTED_OPERATION; -int MPICONSTANTS_ERR_WIN; -int MPICONSTANTS_SUCCESS; -int MPICONSTANTS_LOCK_EXCLUSIVE; -int MPICONSTANTS_LOCK_SHARED; -int MPICONSTANTS_MODE_APPEND; -int MPICONSTANTS_MODE_CREATE; -int MPICONSTANTS_MODE_DELETE_ON_CLOSE; -int MPICONSTANTS_MODE_EXCL; -int MPICONSTANTS_MODE_NOCHECK; -int MPICONSTANTS_MODE_NOPRECEDE; -int MPICONSTANTS_MODE_NOPUT; -int MPICONSTANTS_MODE_NOSTORE; -int MPICONSTANTS_MODE_NOSUCCEED; -int MPICONSTANTS_MODE_RDONLY; -int MPICONSTANTS_MODE_RDWR; -int MPICONSTANTS_MODE_SEQUENTIAL; -int MPICONSTANTS_MODE_UNIQUE_OPEN; -int MPICONSTANTS_MODE_WRONLY; -int MPICONSTANTS_ORDER_C; -int MPICONSTANTS_ORDER_FORTRAN; -int MPICONSTANTS_SEEK_CUR; -int MPICONSTANTS_SEEK_END; -int MPICONSTANTS_SEEK_SET; -int MPICONSTANTS_THREAD_SINGLE; -int MPICONSTANTS_THREAD_FUNNELED; -int MPICONSTANTS_THREAD_SERIALIZED; -int MPICONSTANTS_THREAD_MULTIPLE; -int MPICONSTANTS_TYPECLASS_COMPLEX; -int MPICONSTANTS_TYPECLASS_INTEGER; -int MPICONSTANTS_TYPECLASS_REAL; - -char **MPICONSTANTS_ARGV_NULL; -char ***MPICONSTANTS_ARGVS_NULL; -// int *MPICONSTANTS_UNWEIGHTED ; -// int *MPICONSTANTS_WEIGHTS_EMPTY ; -void *MPICONSTANTS_BOTTOM; -void *MPICONSTANTS_IN_PLACE; - -MPI_Comm MPICONSTANTS_COMM_NULL; -MPI_Comm MPICONSTANTS_COMM_SELF; -MPI_Comm MPICONSTANTS_COMM_WORLD; -MPI_Comm_copy_attr_function *MPICONSTANTS_COMM_DUP_FN; -MPI_Comm_copy_attr_function *MPICONSTANTS_COMM_NULL_COPY_FN; -MPI_Comm_delete_attr_function *MPICONSTANTS_COMM_NULL_DELETE_FN; -MPI_Copy_function *MPICONSTANTS_NULL_COPY_FN; -MPI_Datatype MPICONSTANTS_2DOUBLE_PRECISION; -MPI_Datatype MPICONSTANTS_2INT; -MPI_Datatype MPICONSTANTS_2INTEGER; -MPI_Datatype MPICONSTANTS_2REAL; -MPI_Datatype MPICONSTANTS_AINT; -MPI_Datatype MPICONSTANTS_BYTE; -MPI_Datatype MPICONSTANTS_CHAR; -MPI_Datatype MPICONSTANTS_CHARACTER; -MPI_Datatype MPICONSTANTS_COMPLEX; -MPI_Datatype MPICONSTANTS_COMPLEX16; -#ifdef MPI_COMPLEX32 -MPI_Datatype MPICONSTANTS_COMPLEX32; -#endif -MPI_Datatype MPICONSTANTS_COMPLEX8; -MPI_Datatype MPICONSTANTS_COUNT; -#if MPI_VERSION >= 3 -MPI_Datatype MPICONSTANTS_CXX_BOOL; -MPI_Datatype MPICONSTANTS_CXX_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_CXX_FLOAT_COMPLEX; -MPI_Datatype MPICONSTANTS_CXX_LONG_DOUBLE_COMPLEX; -#endif -MPI_Datatype MPICONSTANTS_C_BOOL; -MPI_Datatype MPICONSTANTS_C_COMPLEX; -MPI_Datatype MPICONSTANTS_C_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_C_FLOAT_COMPLEX; -MPI_Datatype MPICONSTANTS_C_LONG_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_DATATYPE_NULL; -MPI_Datatype MPICONSTANTS_DOUBLE; -MPI_Datatype MPICONSTANTS_DOUBLE_COMPLEX; -MPI_Datatype MPICONSTANTS_DOUBLE_INT; -MPI_Datatype MPICONSTANTS_DOUBLE_PRECISION; -MPI_Datatype MPICONSTANTS_FLOAT; -MPI_Datatype MPICONSTANTS_FLOAT_INT; -MPI_Datatype MPICONSTANTS_INT; -MPI_Datatype MPICONSTANTS_INT16_T; -MPI_Datatype MPICONSTANTS_INT32_T; -MPI_Datatype MPICONSTANTS_INT64_T; -MPI_Datatype MPICONSTANTS_INT8_T; -MPI_Datatype MPICONSTANTS_INTEGER; -MPI_Datatype MPICONSTANTS_INTEGER1; -MPI_Datatype MPICONSTANTS_INTEGER2; -MPI_Datatype MPICONSTANTS_INTEGER4; -MPI_Datatype MPICONSTANTS_INTEGER8; -MPI_Datatype MPICONSTANTS_LOGICAL; -MPI_Datatype MPICONSTANTS_LONG; -MPI_Datatype MPICONSTANTS_LONG_DOUBLE; -MPI_Datatype MPICONSTANTS_LONG_DOUBLE_INT; -MPI_Datatype MPICONSTANTS_LONG_INT; -MPI_Datatype MPICONSTANTS_LONG_LONG; -MPI_Datatype MPICONSTANTS_LONG_LONG_INT; -MPI_Datatype MPICONSTANTS_OFFSET; -MPI_Datatype MPICONSTANTS_PACKED; -MPI_Datatype MPICONSTANTS_REAL; -#ifdef MPI_REAL16 -MPI_Datatype MPICONSTANTS_REAL16; -#endif -MPI_Datatype MPICONSTANTS_REAL4; -MPI_Datatype MPICONSTANTS_REAL8; -MPI_Datatype MPICONSTANTS_SHORT; -MPI_Datatype MPICONSTANTS_SHORT_INT; -MPI_Datatype MPICONSTANTS_SIGNED_CHAR; -MPI_Datatype MPICONSTANTS_UINT16_T; -MPI_Datatype MPICONSTANTS_UINT32_T; -MPI_Datatype MPICONSTANTS_UINT64_T; -MPI_Datatype MPICONSTANTS_UINT8_T; -MPI_Datatype MPICONSTANTS_UNSIGNED; -MPI_Datatype MPICONSTANTS_UNSIGNED_CHAR; -MPI_Datatype MPICONSTANTS_UNSIGNED_LONG; -MPI_Datatype MPICONSTANTS_UNSIGNED_LONG_LONG; -MPI_Datatype MPICONSTANTS_UNSIGNED_SHORT; -MPI_Datatype MPICONSTANTS_WCHAR; -MPI_Delete_function *MPICONSTANTS_NULL_DELETE_FN; -MPI_Errhandler MPICONSTANTS_ERRHANDLER_NULL; -MPI_Errhandler MPICONSTANTS_ERRORS_ARE_FATAL; -MPI_Errhandler MPICONSTANTS_ERRORS_RETURN; -MPI_File MPICONSTANTS_FILE_NULL; -MPI_Group MPICONSTANTS_GROUP_EMPTY; -MPI_Group MPICONSTANTS_GROUP_NULL; -#if MPI_VERSION >= 3 -MPI_Info MPICONSTANTS_INFO_ENV; -#endif -MPI_Info MPICONSTANTS_INFO_NULL; -MPI_Message MPICONSTANTS_MESSAGE_NO_PROC; -MPI_Message MPICONSTANTS_MESSAGE_NULL; -MPI_Offset MPICONSTANTS_DISPLACEMENT_CURRENT; -MPI_Op MPICONSTANTS_BAND; -MPI_Op MPICONSTANTS_BOR; -MPI_Op MPICONSTANTS_BXOR; -MPI_Op MPICONSTANTS_LAND; -MPI_Op MPICONSTANTS_LOR; -MPI_Op MPICONSTANTS_LXOR; -MPI_Op MPICONSTANTS_MAX; -MPI_Op MPICONSTANTS_MAXLOC; -MPI_Op MPICONSTANTS_MIN; -MPI_Op MPICONSTANTS_MINLOC; -MPI_Op MPICONSTANTS_NO_OP; -MPI_Op MPICONSTANTS_OP_NULL; -MPI_Op MPICONSTANTS_PROD; -MPI_Op MPICONSTANTS_REPLACE; -MPI_Op MPICONSTANTS_SUM; -MPI_Request MPICONSTANTS_REQUEST_NULL; -MPI_Status *MPICONSTANTS_STATUS_IGNORE; -MPI_Status *MPICONSTANTS_STATUSES_IGNORE; -MPI_Type_copy_attr_function *MPICONSTANTS_TYPE_DUP_FN; -MPI_Type_copy_attr_function *MPICONSTANTS_TYPE_NULL_COPY_FN; -MPI_Type_delete_attr_function *MPICONSTANTS_TYPE_NULL_DELETE_FN; -MPI_Win MPICONSTANTS_WIN_NULL; -MPI_Win_copy_attr_function *MPICONSTANTS_WIN_DUP_FN; -MPI_Win_copy_attr_function *MPICONSTANTS_WIN_NULL_COPY_FN; -MPI_Win_delete_attr_function *MPICONSTANTS_WIN_NULL_DELETE_FN; - -#ifdef __APPLE__ -#define CONSTRUCTOR_PRIORITY -#else -#define CONSTRUCTOR_PRIORITY (1000) -#endif -static void __attribute__((__constructor__ CONSTRUCTOR_PRIORITY)) -mpiconstants_init() { - MPICONSTANTS_ANY_SOURCE = MPI_ANY_SOURCE; - MPICONSTANTS_ANY_TAG = MPI_ANY_TAG; - MPICONSTANTS_PROC_NULL = MPI_PROC_NULL; - MPICONSTANTS_ROOT = MPI_ROOT; - MPICONSTANTS_CART = MPI_CART; - MPICONSTANTS_DIST_GRAPH = MPI_DIST_GRAPH; - MPICONSTANTS_GRAPH = MPI_GRAPH; - MPICONSTANTS_CONGRUENT = MPI_CONGRUENT; - MPICONSTANTS_IDENT = MPI_IDENT; - MPICONSTANTS_SIMILAR = MPI_SIMILAR; - MPICONSTANTS_UNEQUAL = MPI_UNEQUAL; - MPICONSTANTS_BSEND_OVERHEAD = MPI_BSEND_OVERHEAD; - MPICONSTANTS_KEYVAL_INVALID = MPI_KEYVAL_INVALID; - MPICONSTANTS_UNDEFINED = MPI_UNDEFINED; - MPICONSTANTS_APPNUM = MPI_APPNUM; - MPICONSTANTS_HOST = MPI_HOST; - MPICONSTANTS_IO = MPI_IO; - MPICONSTANTS_LASTUSEDCODE = MPI_LASTUSEDCODE; - MPICONSTANTS_TAG_UB = MPI_TAG_UB; - MPICONSTANTS_UNIVERSE_SIZE = MPI_UNIVERSE_SIZE; - MPICONSTANTS_WIN_BASE = MPI_WIN_BASE; - MPICONSTANTS_WIN_CREATE_FLAVOR = MPI_WIN_CREATE_FLAVOR; - MPICONSTANTS_WIN_DISP_UNIT = MPI_WIN_DISP_UNIT; - MPICONSTANTS_WIN_MODEL = MPI_WIN_MODEL; - MPICONSTANTS_WIN_SIZE = MPI_WIN_SIZE; - MPICONSTANTS_WTIME_IS_GLOBAL = MPI_WTIME_IS_GLOBAL; - MPICONSTANTS_COMBINER_CONTIGUOUS = MPI_COMBINER_CONTIGUOUS; - MPICONSTANTS_COMBINER_DARRAY = MPI_COMBINER_DARRAY; - MPICONSTANTS_COMBINER_DUP = MPI_COMBINER_DUP; - MPICONSTANTS_COMBINER_F90_COMPLEX = MPI_COMBINER_F90_COMPLEX; - MPICONSTANTS_COMBINER_F90_INTEGER = MPI_COMBINER_F90_INTEGER; - MPICONSTANTS_COMBINER_F90_REAL = MPI_COMBINER_F90_REAL; - MPICONSTANTS_COMBINER_HINDEXED = MPI_COMBINER_HINDEXED; - MPICONSTANTS_COMBINER_HINDEXED_BLOCK = MPI_COMBINER_HINDEXED_BLOCK; - MPICONSTANTS_COMBINER_HVECTOR = MPI_COMBINER_HVECTOR; - MPICONSTANTS_COMBINER_INDEXED = MPI_COMBINER_INDEXED; - MPICONSTANTS_COMBINER_INDEXED_BLOCK = MPI_COMBINER_INDEXED_BLOCK; - MPICONSTANTS_COMBINER_NAMED = MPI_COMBINER_NAMED; - MPICONSTANTS_COMBINER_RESIZED = MPI_COMBINER_RESIZED; - MPICONSTANTS_COMBINER_STRUCT = MPI_COMBINER_STRUCT; - MPICONSTANTS_COMBINER_SUBARRAY = MPI_COMBINER_SUBARRAY; - MPICONSTANTS_COMBINER_VECTOR = MPI_COMBINER_VECTOR; - MPICONSTANTS_COMM_TYPE_SHARED = MPI_COMM_TYPE_SHARED; - MPICONSTANTS_DISTRIBUTE_BLOCK = MPI_DISTRIBUTE_BLOCK; - MPICONSTANTS_DISTRIBUTE_CYCLIC = MPI_DISTRIBUTE_CYCLIC; - MPICONSTANTS_DISTRIBUTE_NONE = MPI_DISTRIBUTE_NONE; - MPICONSTANTS_ERR_ACCESS = MPI_ERR_ACCESS; - MPICONSTANTS_ERR_AMODE = MPI_ERR_AMODE; - MPICONSTANTS_ERR_ARG = MPI_ERR_ARG; - MPICONSTANTS_ERR_ASSERT = MPI_ERR_ASSERT; - MPICONSTANTS_ERR_BAD_FILE = MPI_ERR_BAD_FILE; - MPICONSTANTS_ERR_BASE = MPI_ERR_BASE; - MPICONSTANTS_ERR_BUFFER = MPI_ERR_BUFFER; - MPICONSTANTS_ERR_COMM = MPI_ERR_COMM; - MPICONSTANTS_ERR_CONVERSION = MPI_ERR_CONVERSION; - MPICONSTANTS_ERR_COUNT = MPI_ERR_COUNT; - MPICONSTANTS_ERR_DIMS = MPI_ERR_DIMS; - MPICONSTANTS_ERR_DISP = MPI_ERR_DISP; - MPICONSTANTS_ERR_DUP_DATAREP = MPI_ERR_DUP_DATAREP; - MPICONSTANTS_ERR_FILE = MPI_ERR_FILE; - MPICONSTANTS_ERR_FILE_EXISTS = MPI_ERR_FILE_EXISTS; - MPICONSTANTS_ERR_FILE_IN_USE = MPI_ERR_FILE_IN_USE; - MPICONSTANTS_ERR_GROUP = MPI_ERR_GROUP; - MPICONSTANTS_ERR_INFO = MPI_ERR_INFO; - MPICONSTANTS_ERR_INFO_KEY = MPI_ERR_INFO_KEY; - MPICONSTANTS_ERR_INFO_NOKEY = MPI_ERR_INFO_NOKEY; - MPICONSTANTS_ERR_INFO_VALUE = MPI_ERR_INFO_VALUE; - MPICONSTANTS_ERR_INTERN = MPI_ERR_INTERN; - MPICONSTANTS_ERR_IN_STATUS = MPI_ERR_IN_STATUS; - MPICONSTANTS_ERR_IO = MPI_ERR_IO; - MPICONSTANTS_ERR_KEYVAL = MPI_ERR_KEYVAL; - MPICONSTANTS_ERR_LASTCODE = MPI_ERR_LASTCODE; - MPICONSTANTS_ERR_LOCKTYPE = MPI_ERR_LOCKTYPE; - MPICONSTANTS_ERR_NAME = MPI_ERR_NAME; - MPICONSTANTS_ERR_NOT_SAME = MPI_ERR_NOT_SAME; - MPICONSTANTS_ERR_NO_MEM = MPI_ERR_NO_MEM; - MPICONSTANTS_ERR_NO_SPACE = MPI_ERR_NO_SPACE; - MPICONSTANTS_ERR_NO_SUCH_FILE = MPI_ERR_NO_SUCH_FILE; - MPICONSTANTS_ERR_OP = MPI_ERR_OP; - MPICONSTANTS_ERR_OTHER = MPI_ERR_OTHER; - MPICONSTANTS_ERR_PENDING = MPI_ERR_PENDING; - MPICONSTANTS_ERR_PORT = MPI_ERR_PORT; - MPICONSTANTS_ERR_QUOTA = MPI_ERR_QUOTA; - MPICONSTANTS_ERR_RANK = MPI_ERR_RANK; - MPICONSTANTS_ERR_READ_ONLY = MPI_ERR_READ_ONLY; - MPICONSTANTS_ERR_REQUEST = MPI_ERR_REQUEST; -#if MPI_VERSION >= 3 - MPICONSTANTS_ERR_RMA_ATTACH = MPI_ERR_RMA_ATTACH; -#endif - MPICONSTANTS_ERR_RMA_CONFLICT = MPI_ERR_RMA_CONFLICT; -#if MPI_VERSION >= 3 - MPICONSTANTS_ERR_RMA_FLAVOR = MPI_ERR_RMA_FLAVOR; - MPICONSTANTS_ERR_RMA_RANGE = MPI_ERR_RMA_RANGE; - MPICONSTANTS_ERR_RMA_SHARED = MPI_ERR_RMA_SHARED; -#endif - MPICONSTANTS_ERR_RMA_SYNC = MPI_ERR_RMA_SYNC; - MPICONSTANTS_ERR_ROOT = MPI_ERR_ROOT; - MPICONSTANTS_ERR_SERVICE = MPI_ERR_SERVICE; - MPICONSTANTS_ERR_SIZE = MPI_ERR_SIZE; - MPICONSTANTS_ERR_SPAWN = MPI_ERR_SPAWN; - MPICONSTANTS_ERR_TAG = MPI_ERR_TAG; - MPICONSTANTS_ERR_TOPOLOGY = MPI_ERR_TOPOLOGY; - MPICONSTANTS_ERR_TRUNCATE = MPI_ERR_TRUNCATE; - MPICONSTANTS_ERR_TYPE = MPI_ERR_TYPE; - MPICONSTANTS_ERR_UNKNOWN = MPI_ERR_UNKNOWN; - MPICONSTANTS_ERR_UNSUPPORTED_DATAREP = MPI_ERR_UNSUPPORTED_DATAREP; - MPICONSTANTS_ERR_UNSUPPORTED_OPERATION = MPI_ERR_UNSUPPORTED_OPERATION; - MPICONSTANTS_ERR_WIN = MPI_ERR_WIN; - MPICONSTANTS_SUCCESS = MPI_SUCCESS; - MPICONSTANTS_LOCK_EXCLUSIVE = MPI_LOCK_EXCLUSIVE; - MPICONSTANTS_LOCK_SHARED = MPI_LOCK_SHARED; - MPICONSTANTS_MODE_APPEND = MPI_MODE_APPEND; - MPICONSTANTS_MODE_CREATE = MPI_MODE_CREATE; - MPICONSTANTS_MODE_DELETE_ON_CLOSE = MPI_MODE_DELETE_ON_CLOSE; - MPICONSTANTS_MODE_EXCL = MPI_MODE_EXCL; - MPICONSTANTS_MODE_NOCHECK = MPI_MODE_NOCHECK; - MPICONSTANTS_MODE_NOPRECEDE = MPI_MODE_NOPRECEDE; - MPICONSTANTS_MODE_NOPUT = MPI_MODE_NOPUT; - MPICONSTANTS_MODE_NOSTORE = MPI_MODE_NOSTORE; - MPICONSTANTS_MODE_NOSUCCEED = MPI_MODE_NOSUCCEED; - MPICONSTANTS_MODE_RDONLY = MPI_MODE_RDONLY; - MPICONSTANTS_MODE_RDWR = MPI_MODE_RDWR; - MPICONSTANTS_MODE_SEQUENTIAL = MPI_MODE_SEQUENTIAL; - MPICONSTANTS_MODE_UNIQUE_OPEN = MPI_MODE_UNIQUE_OPEN; - MPICONSTANTS_MODE_WRONLY = MPI_MODE_WRONLY; - MPICONSTANTS_ORDER_C = MPI_ORDER_C; - MPICONSTANTS_ORDER_FORTRAN = MPI_ORDER_FORTRAN; - MPICONSTANTS_SEEK_CUR = MPI_SEEK_CUR; - MPICONSTANTS_SEEK_END = MPI_SEEK_END; - MPICONSTANTS_SEEK_SET = MPI_SEEK_SET; - MPICONSTANTS_THREAD_SINGLE = MPI_THREAD_SINGLE; - MPICONSTANTS_THREAD_FUNNELED = MPI_THREAD_FUNNELED; - MPICONSTANTS_THREAD_SERIALIZED = MPI_THREAD_SERIALIZED; - MPICONSTANTS_THREAD_MULTIPLE = MPI_THREAD_MULTIPLE; - MPICONSTANTS_TYPECLASS_COMPLEX = MPI_TYPECLASS_COMPLEX; - MPICONSTANTS_TYPECLASS_INTEGER = MPI_TYPECLASS_INTEGER; - MPICONSTANTS_TYPECLASS_REAL = MPI_TYPECLASS_REAL; - - MPICONSTANTS_ARGV_NULL = MPI_ARGV_NULL; - MPICONSTANTS_ARGVS_NULL = MPI_ARGVS_NULL; - // MPICONSTANTS_UNWEIGHTED = MPI_UNWEIGHTED; - // MPICONSTANTS_WEIGHTS_EMPTY = MPI_WEIGHTS_EMPTY; - MPICONSTANTS_BOTTOM = MPI_BOTTOM; - MPICONSTANTS_IN_PLACE = MPI_IN_PLACE; - - MPICONSTANTS_COMM_NULL = MPI_COMM_NULL; - MPICONSTANTS_COMM_SELF = MPI_COMM_SELF; - MPICONSTANTS_COMM_WORLD = MPI_COMM_WORLD; - MPICONSTANTS_COMM_DUP_FN = MPI_COMM_DUP_FN; - MPICONSTANTS_COMM_NULL_COPY_FN = MPI_COMM_NULL_COPY_FN; - MPICONSTANTS_COMM_NULL_DELETE_FN = MPI_COMM_NULL_DELETE_FN; - MPICONSTANTS_NULL_COPY_FN = MPI_NULL_COPY_FN; - MPICONSTANTS_2DOUBLE_PRECISION = MPI_2DOUBLE_PRECISION; - MPICONSTANTS_2INT = MPI_2INT; - MPICONSTANTS_2INTEGER = MPI_2INTEGER; - MPICONSTANTS_2REAL = MPI_2REAL; - MPICONSTANTS_AINT = MPI_AINT; - MPICONSTANTS_BYTE = MPI_BYTE; - MPICONSTANTS_CHAR = MPI_CHAR; - MPICONSTANTS_CHARACTER = MPI_CHARACTER; - MPICONSTANTS_COMPLEX = MPI_COMPLEX; - MPICONSTANTS_COMPLEX16 = MPI_COMPLEX16; -#ifdef MPI_COMPLEX32 - MPICONSTANTS_COMPLEX32 = MPI_COMPLEX32; -#endif - MPICONSTANTS_COMPLEX8 = MPI_COMPLEX8; - MPICONSTANTS_COUNT = MPI_COUNT; -#if MPI_VERSION >= 3 - MPICONSTANTS_CXX_BOOL = MPI_CXX_BOOL; - MPICONSTANTS_CXX_DOUBLE_COMPLEX = MPI_CXX_DOUBLE_COMPLEX; - MPICONSTANTS_CXX_FLOAT_COMPLEX = MPI_CXX_FLOAT_COMPLEX; - MPICONSTANTS_CXX_LONG_DOUBLE_COMPLEX = MPI_CXX_LONG_DOUBLE_COMPLEX; -#endif - MPICONSTANTS_C_BOOL = MPI_C_BOOL; - MPICONSTANTS_C_COMPLEX = MPI_C_COMPLEX; - MPICONSTANTS_C_DOUBLE_COMPLEX = MPI_C_DOUBLE_COMPLEX; - MPICONSTANTS_C_FLOAT_COMPLEX = MPI_C_FLOAT_COMPLEX; - MPICONSTANTS_C_LONG_DOUBLE_COMPLEX = MPI_C_LONG_DOUBLE_COMPLEX; - MPICONSTANTS_DATATYPE_NULL = MPI_DATATYPE_NULL; - MPICONSTANTS_DOUBLE = MPI_DOUBLE; - MPICONSTANTS_DOUBLE_COMPLEX = MPI_DOUBLE_COMPLEX; - MPICONSTANTS_DOUBLE_INT = MPI_DOUBLE_INT; - MPICONSTANTS_DOUBLE_PRECISION = MPI_DOUBLE_PRECISION; - MPICONSTANTS_FLOAT = MPI_FLOAT; - MPICONSTANTS_FLOAT_INT = MPI_FLOAT_INT; - MPICONSTANTS_INT = MPI_INT; - MPICONSTANTS_INT16_T = MPI_INT16_T; - MPICONSTANTS_INT32_T = MPI_INT32_T; - MPICONSTANTS_INT64_T = MPI_INT64_T; - MPICONSTANTS_INT8_T = MPI_INT8_T; - MPICONSTANTS_INTEGER = MPI_INTEGER; - MPICONSTANTS_INTEGER1 = MPI_INTEGER1; - MPICONSTANTS_INTEGER2 = MPI_INTEGER2; - MPICONSTANTS_INTEGER4 = MPI_INTEGER4; - MPICONSTANTS_INTEGER8 = MPI_INTEGER8; - MPICONSTANTS_LOGICAL = MPI_LOGICAL; - MPICONSTANTS_LONG = MPI_LONG; - MPICONSTANTS_LONG_DOUBLE = MPI_LONG_DOUBLE; - MPICONSTANTS_LONG_DOUBLE_INT = MPI_LONG_DOUBLE_INT; - MPICONSTANTS_LONG_INT = MPI_LONG_INT; - MPICONSTANTS_LONG_LONG = MPI_LONG_LONG; - MPICONSTANTS_LONG_LONG_INT = MPI_LONG_LONG_INT; - MPICONSTANTS_OFFSET = MPI_OFFSET; - MPICONSTANTS_PACKED = MPI_PACKED; - MPICONSTANTS_REAL = MPI_REAL; -#ifdef MPI_REAL16 - MPICONSTANTS_REAL16 = MPI_REAL16; -#endif - MPICONSTANTS_REAL4 = MPI_REAL4; - MPICONSTANTS_REAL8 = MPI_REAL8; - MPICONSTANTS_SHORT = MPI_SHORT; - MPICONSTANTS_SHORT_INT = MPI_SHORT_INT; - MPICONSTANTS_SIGNED_CHAR = MPI_SIGNED_CHAR; - MPICONSTANTS_UINT16_T = MPI_UINT16_T; - MPICONSTANTS_UINT32_T = MPI_UINT32_T; - MPICONSTANTS_UINT64_T = MPI_UINT64_T; - MPICONSTANTS_UINT8_T = MPI_UINT8_T; - MPICONSTANTS_UNSIGNED = MPI_UNSIGNED; - MPICONSTANTS_UNSIGNED_CHAR = MPI_UNSIGNED_CHAR; - MPICONSTANTS_UNSIGNED_LONG = MPI_UNSIGNED_LONG; - MPICONSTANTS_UNSIGNED_LONG_LONG = MPI_UNSIGNED_LONG_LONG; - MPICONSTANTS_UNSIGNED_SHORT = MPI_UNSIGNED_SHORT; - MPICONSTANTS_WCHAR = MPI_WCHAR; - MPICONSTANTS_NULL_DELETE_FN = MPI_NULL_DELETE_FN; - MPICONSTANTS_ERRHANDLER_NULL = MPI_ERRHANDLER_NULL; - MPICONSTANTS_ERRORS_ARE_FATAL = MPI_ERRORS_ARE_FATAL; - MPICONSTANTS_ERRORS_RETURN = MPI_ERRORS_RETURN; - MPICONSTANTS_FILE_NULL = MPI_FILE_NULL; - MPICONSTANTS_GROUP_EMPTY = MPI_GROUP_EMPTY; - MPICONSTANTS_GROUP_NULL = MPI_GROUP_NULL; -#if MPI_VERSION >= 3 - MPICONSTANTS_INFO_ENV = MPI_INFO_ENV; -#endif - MPICONSTANTS_INFO_NULL = MPI_INFO_NULL; - MPICONSTANTS_MESSAGE_NO_PROC = MPI_MESSAGE_NO_PROC; - MPICONSTANTS_MESSAGE_NULL = MPI_MESSAGE_NULL; - MPICONSTANTS_DISPLACEMENT_CURRENT = MPI_DISPLACEMENT_CURRENT; - MPICONSTANTS_BAND = MPI_BAND; - MPICONSTANTS_BOR = MPI_BOR; - MPICONSTANTS_BXOR = MPI_BXOR; - MPICONSTANTS_LAND = MPI_LAND; - MPICONSTANTS_LOR = MPI_LOR; - MPICONSTANTS_LXOR = MPI_LXOR; - MPICONSTANTS_MAX = MPI_MAX; - MPICONSTANTS_MAXLOC = MPI_MAXLOC; - MPICONSTANTS_MIN = MPI_MIN; - MPICONSTANTS_MINLOC = MPI_MINLOC; - MPICONSTANTS_NO_OP = MPI_NO_OP; - MPICONSTANTS_OP_NULL = MPI_OP_NULL; - MPICONSTANTS_PROD = MPI_PROD; - MPICONSTANTS_REPLACE = MPI_REPLACE; - MPICONSTANTS_SUM = MPI_SUM; - MPICONSTANTS_REQUEST_NULL = MPI_REQUEST_NULL; - MPICONSTANTS_STATUS_IGNORE = MPI_STATUS_IGNORE; - MPICONSTANTS_STATUSES_IGNORE = MPI_STATUSES_IGNORE; - MPICONSTANTS_TYPE_DUP_FN = MPI_TYPE_DUP_FN; - MPICONSTANTS_TYPE_NULL_COPY_FN = MPI_TYPE_NULL_COPY_FN; - MPICONSTANTS_TYPE_NULL_DELETE_FN = MPI_TYPE_NULL_DELETE_FN; - MPICONSTANTS_WIN_NULL = MPI_WIN_NULL; - MPICONSTANTS_WIN_DUP_FN = MPI_WIN_DUP_FN; - MPICONSTANTS_WIN_NULL_COPY_FN = MPI_WIN_NULL_COPY_FN; - MPICONSTANTS_WIN_NULL_DELETE_FN = MPI_WIN_NULL_DELETE_FN; -} diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index 92ed8bf2b..000000000 --- a/deps/build.jl +++ /dev/null @@ -1,281 +0,0 @@ -using Pkg.TOML, Libdl - -config_toml = joinpath(first(DEPOT_PATH), "prefs", "MPI.toml") -mkpath(dirname(config_toml)) - -if !isfile(config_toml) - touch(config_toml) -end - -# This file contains code that runs at three different occasions: -# -# 1. When `build MPI` is called. At this time, `MPI.jl` has not yet -# been loaded. This code runs essentially as a script. However, it -# calls the MPI function `MPI_Get_library_version`, which means -# that the MPI library must be callable. (`MPI_Init` is not -# called.) The result of this call is saved, to ensure that the MPI -# library doesn't accidentally change at a later time (e.g. when -# the wrong set of modules is loaded), which could lead to -# segfaults that are difficult to debug. -# -# 2. When `MPI.jl` is precompiled. Most things should be initialized -# at that time. -# -# 3. When `MPI.jl` is loaded, i.e. when its `__init__` function is -# run. Some information is only available at load time, e.g. -# certatin MPI constants such as `MPI_COMM_DUP_FN`. This might be -# function pointers whose value is only known at load time. Another -# reason to run code at this time would be to set environment -# variables; their values are not captured while precompiling. -# -# Generally, this file `build.jl` is run at stage (1). It creates a -# file `deps.jl` that is run at stage (2), and which also defines a -# function `__init__deps` that is run at stage (3). Certain actions -# need to happen at two or all three stages. - -config = TOML.parsefile(config_toml) -update_config = false - - -# MPI.toml has 4 keys -# binary = "" (default) | "system" | "MPICH_jll" | "MPItrampoline_jll" | "OpenMPI_jll" | "MicrosoftMPI_jll" -# path = "" (default) | top-level directory location -# library = "" (default) | library name/path | list of library names/paths -# mpiexec = "" (default) | executable name/path | [executable name/path, extra args...] - - -# 1. check if environment variables have changed -if haskey(ENV, "JULIA_MPI_BINARY") - config["binary"] = ENV["JULIA_MPI_BINARY"] - update_config = true -elseif haskey(ENV, "JULIA_MPI_LIBRARY") || haskey(ENV, "JULIA_MPI_PATH") - config["binary"] = "system" -end - -if haskey(ENV, "JULIA_MPI_PATH") - config["path"] = ENV["JULIA_MPI_PATH"] - update_config = true -end - -if haskey(ENV, "JULIA_MPI_LIBRARY") - config["library"] = ENV["JULIA_MPI_LIBRARY"] - update_config = true -end - -if haskey(ENV, "JULIA_MPIEXEC") - if ENV["JULIA_MPIEXEC"] == "" - delete!(config, "mpiexec") - else - config["mpiexec"] = ENV["JULIA_MPIEXEC"] - end - update_config = true -end - -if update_config - open(config_toml, write=true) do f - TOML.print(f, config) - end -end - -binary = get(config, "binary", "") - -# 2. generate deps.jl -if binary == "system" - - @info "using system MPI" - library = get(config, "library", "") - if library == "" - library = ["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"] - end - path = get(config, "path", "") - mpiexec = get(config, "mpiexec", path == "" ? "mpiexec" : joinpath(path, "bin", "mpiexec")) - - const libmpi = find_library(library, path == "" ? [] : [joinpath(path, "lib"), joinpath(path, "lib64")]) - if libmpi == "" - error("libmpi could not be found") - end - - const mpiexec_cmd = Cmd(mpiexec isa String ? [mpiexec] : mpiexec) - - _doc_external(fname) = "" - - include(joinpath("..", "src", "implementations.jl")) - - @info "using implementation" libmpi mpiexec_cmd MPI_LIBRARY_VERSION_STRING - - include("prepare_mpi_constants.jl") - - deps = quote - const libmpi = $libmpi - const libmpiconstants = joinpath(dirname(@__DIR__), "deps", "libload_time_mpi_constants.so") - const mpiexec_cmd = $mpiexec_cmd - const mpiexec_path = mpiexec_cmd[1] - _mpiexec(fn) = fn(mpiexec_cmd) - - using Requires - - function __init__deps() - if Get_library_version() != $MPI_LIBRARY_VERSION_STRING - error("MPI library has changed, please re-run `Pkg.build(\"MPI\")`.") - end - - # error if a jll is loaded. - @require(MPICH_jll = "7cb0a576-ebde-5e09-9194-50597f1243b4", - error("MPICH_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - @require(MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748", - error("MPItrampoline_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - @require(MicrosoftMPI_jll = "9237b28f-5490-5468-be7b-bb81f5f5e6cf", - error("MicrosoftMPI_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - @require(OpenMPI_jll = "fe0851c0-eecd-5654-98d4-656369965a5c", - error("OpenMPI_jll cannot be loaded: MPI.jl is configured to use the system MPI library")) - end - end - -elseif binary == "" - - @info "using default MPI jll" - - if Sys.iswindows() - using MicrosoftMPI_jll - # run(MicrosoftMPI_jll.generate_compile_time_mpi_constants()) - cp("compile_time_mpi_constants_msmpi_$(Sys.ARCH).jl", "compile_time_mpi_constants.jl"; force=true) - else - using MPICH_jll - run(MPICH_jll.generate_compile_time_mpi_constants()) - end - - deps = quote - if Sys.iswindows() - using MicrosoftMPI_jll - const libmpiconstants = MicrosoftMPI_jll.libload_time_mpi_constants - const _mpiexec = MicrosoftMPI_jll.mpiexec - const mpiexec_path = MicrosoftMPI_jll.mpiexec_path - else - using MPICH_jll - const libmpiconstants = MPICH_jll.libload_time_mpi_constants - const _mpiexec = MPICH_jll.mpiexec - const mpiexec_path = MPICH_jll.mpiexec_path - end - - function __init__deps() - if (haskey(ENV, "SLURM_JOBID") || haskey(ENV, "PBS_JOBID") || haskey(ENV, "LSB_JOBID")) && - get(ENV, "JULIA_MPI_CLUSTER_WARN", "") != "n" - @warn """ - You appear to be using MPI.jl with the default MPI binary on a cluster. - We recommend using the system-provided MPI, see the Configuration section of the MPI.jl docs. - """ - end - end - end - -elseif binary == "MPICH_jll" - - @info "using MPICH_jll" - - using MPICH_jll - run(MPICH_jll.generate_compile_time_mpi_constants()) - - deps = quote - using MPICH_jll - const libmpiconstants = MPICH_jll.libload_time_mpi_constants - const _mpiexec = MPICH_jll.mpiexec - const mpiexec_path = MPICH_jll.mpiexec_path - - __init__deps() = nothing - end - -elseif binary == "MPItrampoline_jll" - - @info "using MPItrampoline_jll" - using MPItrampoline_jll - @assert MPItrampoline_jll.is_available() - run(MPItrampoline_jll.generate_compile_time_mpi_constants()) - - deps = quote - @info "using MPItrampoline_jll" - using MPItrampoline_jll - @assert MPItrampoline_jll.is_available() - mpiexec_path = get(ENV, "MPITRAMPOLINE_MPIEXEC", nothing) - if mpiexec_path === nothing - if "MPITRAMPOLINE_LIB" ∉ keys(ENV) - @info "[MPI] Using built-in MPICH with MPItrampoline" - # In principle, MPItrampoline_jll.mpiwrapperexec should - # forward to MPItrampoline_jll.mpich_mpiexec. However, - # there is no mechanism to update the path to where the - # Julia artifact is installed, so we forward manually - # here. - const _mpiexec = MPItrampoline_jll.mpich_mpiexec - mpiexec_path = MPItrampoline_jll.mpich_mpiexec_path - else - const _mpiexec = MPItrampoline_jll.mpiwrapperexec - mpiexec_path = MPItrampoline_jll.mpiwrapperexec_path - end - else - const mpiexec_cmd = Cmd([mpiexec_path]) - _mpiexec(fn) = fn(mpiexec_cmd) - end - const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path - - __init__deps() = nothing - end - -elseif binary == "OpenMPI_jll" - - @info "using OpenMPI_jll" - - using OpenMPI_jll - run(OpenMPI_jll.generate_compile_time_mpi_constants()) - - deps = quote - using OpenMPI_jll - const _mpiexec = OpenMPI_jll.mpiexec - const mpiexec_path = OpenMPI_jll.mpiexec_path - - __init__deps() = nothing - end - -elseif binary == "MicrosoftMPI_jll" - - @info "using MicrosoftMPI_jll" - - using MicrosoftMPI_jll - # run(MicrosoftMPI_jll.generate_compile_time_mpi_constants()) - cp("compile_time_mpi_constants_msmpi_$(Sys.ARCH).jl", "compile_time_mpi_constants.jl"; force=true) - - deps = quote - using MicrosoftMPI_jll - const libmpiconstants = MicrosoftMPI_jll.libload_time_mpi_constants - const _mpiexec = MicrosoftMPI_jll.mpiexec - const mpiexec_path = MicrosoftMPI_jll.mpiexec_path - - __init__deps() = nothing - end - -else - error("Unknown binary $binary") -end - -remove_line_numbers(x) = x -function remove_line_numbers(ex::Expr) - if ex.head == :macrocall - ex.args[2] = nothing - else - ex.args = [remove_line_numbers(arg) for arg in ex.args if !(arg isa LineNumberNode)] - end - return ex -end - -# Only update deps.jl if it has changed. -# This allows users to call Pkg.build("MPI") without triggering another round of precompilation. -deps_str = - """ - # This file has been generated automatically. - # It will be overwritten the next time `Pkg.build("MPI")` is called. - """ * - string(remove_line_numbers(deps)) * - """ - """ - -if !isfile("deps.jl") || deps_str != read("deps.jl", String) - write("deps.jl", deps_str) -end diff --git a/deps/compile_time_mpi_constants_msmpi_i686.jl b/deps/compile_time_mpi_constants_msmpi_i686.jl deleted file mode 100644 index 6b23e10e8..000000000 --- a/deps/compile_time_mpi_constants_msmpi_i686.jl +++ /dev/null @@ -1,73 +0,0 @@ -# This file has been generated automatically by `generate_compile_time_mpi_constants`. -# Do not edit. - -# MPI library version (for reference only; this is not a constant) -const MPI_LIBRARY_VERSION_ = "Microsoft MPI i686" - -# Compile-time constants - -# Version: -# (We add an underscore to avoid a name conflict with `MPI.jl`) -const MPI_VERSION_ = Cint(2) -const MPI_SUBVERSION_ = Cint(0) - -# Implementation limits: -const MPI_MAX_DATAREP_STRING = Cint(128) -const MPI_MAX_ERROR_STRING = Cint(512) -const MPI_MAX_INFO_KEY = Cint(255) -const MPI_MAX_INFO_VAL = Cint(1024) -const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) -const MPI_MAX_OBJECT_NAME = Cint(128) -const MPI_MAX_PORT_NAME = Cint(256) -const MPI_MAX_PROCESSOR_NAME = Cint(128) - -# Types - -# Various (signed) integer types: -const MPI_Aint = Int32 -const MPI_Count = Int64 -const MPI_Fint = Int32 -const MPI_Offset = Int64 - -# Status: -struct MPI_Status - private0::Cint - private1::Cint - MPI_SOURCE::Cint - MPI_TAG::Cint - MPI_ERROR::Cint -end - -# Opaque handles: -const MPI_Comm = UInt32 -const MPI_Datatype = UInt32 -const MPI_Errhandler = UInt32 -const MPI_File = UInt32 -const MPI_Group = UInt32 -const MPI_Info = UInt32 -const MPI_Message = UInt32 -const MPI_Op = UInt32 -const MPI_Request = UInt32 -const MPI_Win = UInt32 - -# Function pointers: -const MPI_Comm_copy_attr_function = Ptr{Cvoid} -const MPI_Comm_delete_attr_function = Ptr{Cvoid} -const MPI_Comm_errhandler_function = Ptr{Cvoid} -const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function -const MPI_Copy_function = MPI_Comm_copy_attr_function -const MPI_Datarep_conversion_function = Ptr{Cvoid} -const MPI_Datarep_extent_function = Ptr{Cvoid} -const MPI_Delete_function = Ptr{Cvoid} -const MPI_File_errhandler_function = Ptr{Cvoid} -const MPI_File_errhandler_fn = Ptr{Cvoid} -const MPI_Grequest_cancel_function = Ptr{Cvoid} -const MPI_Grequest_free_function = Ptr{Cvoid} -const MPI_Grequest_query_function = Ptr{Cvoid} -const MPI_Type_copy_attr_function = Ptr{Cvoid} -const MPI_Type_delete_attr_function = Ptr{Cvoid} -const MPI_User_function = Ptr{Cvoid} -const MPI_Win_copy_attr_function = Ptr{Cvoid} -const MPI_Win_delete_attr_function = Ptr{Cvoid} -const MPI_Win_errhandler_function = Ptr{Cvoid} -const MPI_Win_errhandler_fn = MPI_Win_errhandler_function diff --git a/deps/compile_time_mpi_constants_msmpi_x86_64.jl b/deps/compile_time_mpi_constants_msmpi_x86_64.jl deleted file mode 100644 index b7243fb18..000000000 --- a/deps/compile_time_mpi_constants_msmpi_x86_64.jl +++ /dev/null @@ -1,73 +0,0 @@ -# This file has been generated automatically by `generate_compile_time_mpi_constants`. -# Do not edit. - -# MPI library version (for reference only; this is not a constant) -const MPI_LIBRARY_VERSION_ = "Microsoft MPI x86_64" - -# Compile-time constants - -# Version: -# (We add an underscore to avoid a name conflict with `MPI.jl`) -const MPI_VERSION_ = Cint(2) -const MPI_SUBVERSION_ = Cint(0) - -# Implementation limits: -const MPI_MAX_DATAREP_STRING = Cint(128) -const MPI_MAX_ERROR_STRING = Cint(512) -const MPI_MAX_INFO_KEY = Cint(255) -const MPI_MAX_INFO_VAL = Cint(1024) -const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) -const MPI_MAX_OBJECT_NAME = Cint(128) -const MPI_MAX_PORT_NAME = Cint(256) -const MPI_MAX_PROCESSOR_NAME = Cint(128) - -# Types - -# Various (signed) integer types: -const MPI_Aint = Int64 -const MPI_Count = Int64 -const MPI_Fint = Int32 -const MPI_Offset = Int64 - -# Status: -struct MPI_Status - private0::Cint - private1::Cint - MPI_SOURCE::Cint - MPI_TAG::Cint - MPI_ERROR::Cint -end - -# Opaque handles: -const MPI_Comm = UInt32 -const MPI_Datatype = UInt32 -const MPI_Errhandler = UInt32 -const MPI_File = UInt64 -const MPI_Group = UInt32 -const MPI_Info = UInt32 -const MPI_Message = UInt32 -const MPI_Op = UInt32 -const MPI_Request = UInt32 -const MPI_Win = UInt32 - -# Function pointers: -const MPI_Comm_copy_attr_function = Ptr{Cvoid} -const MPI_Comm_delete_attr_function = Ptr{Cvoid} -const MPI_Comm_errhandler_function = Ptr{Cvoid} -const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function -const MPI_Copy_function = MPI_Comm_copy_attr_function -const MPI_Datarep_conversion_function = Ptr{Cvoid} -const MPI_Datarep_extent_function = Ptr{Cvoid} -const MPI_Delete_function = Ptr{Cvoid} -const MPI_File_errhandler_function = Ptr{Cvoid} -const MPI_File_errhandler_fn = Ptr{Cvoid} -const MPI_Grequest_cancel_function = Ptr{Cvoid} -const MPI_Grequest_free_function = Ptr{Cvoid} -const MPI_Grequest_query_function = Ptr{Cvoid} -const MPI_Type_copy_attr_function = Ptr{Cvoid} -const MPI_Type_delete_attr_function = Ptr{Cvoid} -const MPI_User_function = Ptr{Cvoid} -const MPI_Win_copy_attr_function = Ptr{Cvoid} -const MPI_Win_delete_attr_function = Ptr{Cvoid} -const MPI_Win_errhandler_function = Ptr{Cvoid} -const MPI_Win_errhandler_fn = MPI_Win_errhandler_function diff --git a/deps/prepare_mpi_constants.jl b/deps/prepare_mpi_constants.jl deleted file mode 100644 index 233add43e..000000000 --- a/deps/prepare_mpi_constants.jl +++ /dev/null @@ -1,33 +0,0 @@ -if !Sys.iswindows() - - libdir = dirname(dlpath(libmpi)) - - mpidir = get(ENV, "JULIA_MPI_PATH", joinpath(libdir, "..")) - incdir = get(ENV, "JULIA_INCLUDE_PATH", joinpath(mpidir, "include")) - mpicc = get(ENV, "JULIA_MPICC", joinpath(mpidir, "bin", "mpicc")) - - # `cflags` includes libraries and needs to be listed at the end of the - # compile/link command - if haskey(ENV, "JULIA_MPI_CFLAGS") - cflags = Base.shell_split(ENV["JULIA_MPI_CFLAGS"]) - else - libfilename = basename(libmpi) - libbasename, = splitext(libfilename) - libname = replace(libbasename, r"^lib" => s"") - cflags = `-I$incdir -L$libdir -Wl,-rpath,$libdir -l$libname` - end - - # We expect the subdirectory `MPIconstants-1.4.0` to contain a copy of - # - srcdir = "MPIconstants-1.4.0" - - run(`$mpicc -o generate_compile_time_mpi_constants $(joinpath(srcdir, "generate_compile_time_mpi_constants.c")) $cflags`) - run(`./generate_compile_time_mpi_constants`) - - run(`$mpicc -fPIC -shared -o libload_time_mpi_constants.so $(joinpath(srcdir, "load_time_mpi_constants.c")) $cflags`) - -else - - cp("compile_time_mpi_constants_msmpi_$(Sys.ARCH).jl", "compile_time_mpi_constants.jl"; force=true) - -end From 6624d1b244b1e8581334fc84aaa7786acc78c454 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 17 Feb 2022 22:24:22 -0800 Subject: [PATCH 15/53] more CI updates --- .github/workflows/UnitTests.yml | 49 ++++++++++++--------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 3736deb29..51d79fb81 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -235,10 +235,6 @@ jobs: runs-on: windows-latest - env: - JULIA_MPI_BINARY: system - JULIA_MPIEXEC: "C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec" - steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.4.0 @@ -260,18 +256,15 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(export_prefs=true) - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -300,9 +293,6 @@ jobs: runs-on: ${{ matrix.os }} - env: - JULIA_MPI_BINARY: MPItrampoline_jll - steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.4.0 @@ -316,18 +306,15 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_jll_binary("MPItrampoline", export_prefs=true) - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest From 7d96e85e44948b9c9eda44916aafaa0d4d445d66 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 17 Feb 2022 22:25:20 -0800 Subject: [PATCH 16/53] move deps --- Project.toml | 1 - test/Project.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cadf55018..1ed57183e 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" MPItrampoline_jll = "f1f71cc9-e9ae-5b93-9b94-4fe0e1ad3748" MicrosoftMPI_jll = "9237b28f-5490-5468-be7b-bb81f5f5e6cf" OpenMPI_jll = "fe0851c0-eecd-5654-98d4-656369965a5c" -Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Requires = "ae029012-a4dd-5104-9daa-d747884805df" Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" diff --git a/test/Project.toml b/test/Project.toml index 3af2eafd0..8e7a1d404 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -4,3 +4,4 @@ DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267" Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" From b6c215af881e0d2f6bd6d16500a4dbc587c56700 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 08:44:40 -0800 Subject: [PATCH 17/53] try MPICH on macos --- .github/workflows/UnitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 51d79fb81..a6f2628fb 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -59,7 +59,7 @@ jobs: strategy: matrix: mpi: - #BROKEN - mpich + - mpich - openmpi julia_version: - "1" From b288269cbea57e3e00d7c14d72e6bca985ec8801 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 08:48:46 -0800 Subject: [PATCH 18/53] fix apt --- .github/workflows/UnitTests.yml | 52 +++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index a6f2628fb..6b3d54d8c 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -8,7 +8,7 @@ on: - master jobs: - test-jll: + test-default: timeout-minutes: 20 strategy: matrix: @@ -53,6 +53,52 @@ jobs: - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest + test-openmpi-jll: + timeout-minutes: 20 + strategy: + matrix: + os: + - macos-latest + - ubuntu-latest + - windows-latest + julia_version: + - "1.6" + - "1" + - "nightly" + julia_arch: [x64, x86] + exclude: + - os: macos-latest + julia_arch: x86 + + fail-fast: false + + runs-on: ${{ matrix.os }} + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v2.2.0 + + - uses: julia-actions/setup-julia@latest + with: + arch: ${{ matrix.julia_arch }} + version: ${{ matrix.julia_version }} + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences, use system + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_jll_binary("OpenMPI_jll", export_prefs=true) + + - uses: julia-actions/julia-buildpkg@latest + - uses: julia-actions/julia-runtest@latest test-system-brew: timeout-minutes: 20 @@ -135,7 +181,9 @@ jobs: uses: actions/checkout@v2.2.0 - name: Install MPI via apt - run: sudo apt-get install $MPI + run: | + sudo apt-get update + sudo apt-get install $MPI env: MPI: ${{ matrix.mpi }} From a1249e2042f5995c37f86e0e4249206566466dba Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 08:56:19 -0800 Subject: [PATCH 19/53] remove buildpkg --- .github/workflows/UnitTests.yml | 9 +-------- test/runtests.jl | 11 ++++++++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 6b3d54d8c..7452383d1 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -50,7 +50,6 @@ jobs: using Pkg Pkg.develop(path="lib/MPIPreferences") - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest test-openmpi-jll: @@ -97,7 +96,6 @@ jobs: using MPIPreferences MPIPreferences.use_jll_binary("OpenMPI_jll", export_prefs=true) - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest test-system-brew: @@ -145,7 +143,6 @@ jobs: Pkg.develop(path="lib/MPIPreferences") using MPIPreferences MPIPreferences.use_system_binary(export_prefs=true) - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: # TODO: Only disable this test for MPICH. OpenMPI works fine. @@ -201,7 +198,6 @@ jobs: using MPIPreferences MPIPreferences.use_system_binary(export_prefs=true) - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest test-intel-linux: @@ -314,7 +310,6 @@ jobs: using MPIPreferences MPIPreferences.use_system_binary(export_prefs=true) - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -328,7 +323,7 @@ jobs: mpi: [mpitrampoline] julia_version: - "1.6" - - "1.7" + - "1" - "nightly" julia_arch: - x64 @@ -364,7 +359,6 @@ jobs: using MPIPreferences MPIPreferences.use_jll_binary("MPItrampoline", export_prefs=true) - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest @@ -562,7 +556,6 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest diff --git a/test/runtests.jl b/test/runtests.jl index de52ebd23..4ca1c75c8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,8 +2,6 @@ using Test, MPI using MPIPreferences -@show MPIPreferences.abi MPIPreferences.binary - # load test packages to trigger precompilation using DoubleFloats if get(ENV, "JULIA_MPI_TEST_ARRAYTYPE", "") == "CuArray" @@ -22,7 +20,14 @@ end nprocs_str = get(ENV, "JULIA_MPI_TEST_NPROCS", "") nprocs = nprocs_str == "" ? clamp(Sys.CPU_THREADS, 2, 4) : parse(Int, nprocs_str) -@info "Running MPI tests" ArrayType nprocs +@info "Running MPI tests" ArrayType nprocs MPIPreferences.abi MPIPreferences.binary + +if haskey(ENV,"JULIA_MPI_TEST_BINARY") + @test ENV["JULIA_MPI_TEST_BINARY"] == MPIPreferences.binary +end +if haskey(ENV,"JULIA_MPI_TEST_ABI") + @test ENV["JULIA_MPI_TEST_ABI"] == MPIPreferences.abi +end testdir = @__DIR__ istest(f) = endswith(f, ".jl") && startswith(f, "test_") From 64de9bc633aaf7d5222243c8d6b797314ba5ac3e Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 09:03:08 -0800 Subject: [PATCH 20/53] use correct name --- .github/workflows/UnitTests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 7452383d1..5e52afec4 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -357,7 +357,7 @@ jobs: using Pkg Pkg.develop(path="lib/MPIPreferences") using MPIPreferences - MPIPreferences.use_jll_binary("MPItrampoline", export_prefs=true) + MPIPreferences.use_jll_binary("MPItrampoline_jll", export_prefs=true) - uses: julia-actions/julia-runtest@latest From 8a68c73a49a9379a3b44b3e20722f08e24a34e1a Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 09:04:05 -0800 Subject: [PATCH 21/53] no openmpi_jll on windows --- .github/workflows/UnitTests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 5e52afec4..d2fff15e4 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -59,7 +59,6 @@ jobs: os: - macos-latest - ubuntu-latest - - windows-latest julia_version: - "1.6" - "1" From d20b79992666bae3ed1d197b4d1ee2b6e85d97ec Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 09:06:37 -0800 Subject: [PATCH 22/53] remove some environment variables --- .github/workflows/UnitTests.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index d2fff15e4..98f49d951 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -111,10 +111,6 @@ jobs: runs-on: macos-latest - env: - JULIA_MPI_BINARY: system - JULIA_MPI_PATH: /usr/local - steps: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.4.0 From 7e28b4cc5721045846851b85c83d63b0c514ce55 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 09:09:41 -0800 Subject: [PATCH 23/53] remove canceller --- .github/workflows/UnitTests.yml | 45 --------------------------------- 1 file changed, 45 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 98f49d951..520819fec 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -30,11 +30,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -73,11 +68,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -112,11 +102,6 @@ jobs: runs-on: macos-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -164,11 +149,6 @@ jobs: OMPI_MCA_btl_base_warn_component_unused: 0 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -211,11 +191,6 @@ jobs: JULIA_MPI_PATH: /home/runner/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -275,11 +250,6 @@ jobs: runs-on: windows-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -332,11 +302,6 @@ jobs: runs-on: ${{ matrix.os }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -512,11 +477,6 @@ jobs: OMPI_MCA_btl_base_warn_component_unused: 0 steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 @@ -574,11 +534,6 @@ jobs: MPITRAMPOLINE_MPIEXEC: /home/runner/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64/bin/mpiexec steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.4.0 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2.2.0 From 0a327673f153278f02b7909c51cccd6206c9b08d Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 09:39:07 -0800 Subject: [PATCH 24/53] fix typo --- src/consts/consts.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/consts/consts.jl b/src/consts/consts.jl index 8259abcce..e1cf01527 100644 --- a/src/consts/consts.jl +++ b/src/consts/consts.jl @@ -31,12 +31,12 @@ end include("mpich.jl") elseif MPIPreferences.abi == "OpenMPI" include("openmpi.jl") -elseif MPIPreferences.abi == "MicrosofMPI" +elseif MPIPreferences.abi == "MicrosoftMPI" include("microsoftmpi.jl") elseif MPIPreferences.abi == "MPIwrapper" include("mpiwrapper.jl") else - error("Unknown MPI ABI") + error("Unknown MPI ABI $(MPIPreferences.abi)") end @eval function __init__() From 9109788162badb9bf08646611bf45bcd996ee841 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 09:43:49 -0800 Subject: [PATCH 25/53] dev MPIPreferences --- .github/workflows/UnitTests.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 520819fec..c04d11c55 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -77,7 +77,13 @@ jobs: version: ${{ matrix.julia_version }} - uses: julia-actions/cache@v1 - - name: add MPIPreferences, use system + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + + - name: add test MPIPreferences, use system shell: julia --color=yes --project=test {0} run: | using Pkg @@ -115,6 +121,11 @@ jobs: version: ${{ matrix.julia_version }} - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - name: add MPIPreferences, use system shell: julia --color=yes --project=test {0} @@ -164,6 +175,11 @@ jobs: version: ${{ matrix.julia_version }} - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - name: add MPIPreferences, use system shell: julia --color=yes --project=test {0} @@ -226,6 +242,11 @@ jobs: version: ${{ matrix.julia_version }} - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") # we can't use the usual actions here as we need to ensure the environment variables are set - name: "Build package" @@ -266,6 +287,11 @@ jobs: version: ${{ matrix.julia_version }} - uses: julia-actions/cache@v1 + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") - name: add MPIPreferences, use system shell: julia --color=yes --project=test {0} From 926342bf9caf3d6707050c3e7400969dceb07bee Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 10:02:10 -0800 Subject: [PATCH 26/53] try deleting Manifest.toml --- .github/workflows/UnitTests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index c04d11c55..d735a61e1 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -83,13 +83,14 @@ jobs: using Pkg Pkg.develop(path="lib/MPIPreferences") - - name: add test MPIPreferences, use system + - name: use OpenMPI_jll shell: julia --color=yes --project=test {0} run: | using Pkg Pkg.develop(path="lib/MPIPreferences") using MPIPreferences MPIPreferences.use_jll_binary("OpenMPI_jll", export_prefs=true) + rm("test/Manifest.toml") - uses: julia-actions/julia-runtest@latest @@ -134,6 +135,8 @@ jobs: Pkg.develop(path="lib/MPIPreferences") using MPIPreferences MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml") + - uses: julia-actions/julia-runtest@latest env: # TODO: Only disable this test for MPICH. OpenMPI works fine. From 54ebccb48b63b5965eba7ef84ec33d11c9174a68 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 10:08:46 -0800 Subject: [PATCH 27/53] fix MPItrampoline --- .github/workflows/UnitTests.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index d735a61e1..8e62ccfe1 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -64,6 +64,9 @@ jobs: julia_arch: x86 fail-fast: false + env: + JULIA_MPI_TEST_BINARY: OpenMPI_jll + JULIA_MPI_TEST_ABI: OpenMPI runs-on: ${{ matrix.os }} @@ -107,6 +110,8 @@ jobs: fail-fast: false runs-on: macos-latest + env: + JULIA_MPI_TEST_BINARY: system steps: - name: Checkout @@ -158,8 +163,7 @@ jobs: runs-on: ubuntu-20.04 env: - JULIA_MPI_BINARY: system - JULIA_MPI_PATH: /usr + JULIA_MPI_TEST_BINARY: system OMPI_MCA_btl_base_warn_component_unused: 0 steps: @@ -329,6 +333,9 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} + env: + JULIA_MPI_TEST_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_ABI: MPIwrapper steps: - name: Checkout @@ -340,13 +347,20 @@ jobs: - uses: julia-actions/cache@v1 - - name: add MPIPreferences, use system + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + + - name: use OpenMPI_jll shell: julia --color=yes --project=test {0} run: | using Pkg Pkg.develop(path="lib/MPIPreferences") using MPIPreferences MPIPreferences.use_jll_binary("MPItrampoline_jll", export_prefs=true) + rm("test/Manifest.toml") - uses: julia-actions/julia-runtest@latest From e952a3eae4257a8df6c1b3e866df3f80fd61095c Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 10:09:28 -0800 Subject: [PATCH 28/53] remove Manifest --- .github/workflows/UnitTests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 8e62ccfe1..66d84620d 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -195,6 +195,7 @@ jobs: Pkg.develop(path="lib/MPIPreferences") using MPIPreferences MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml") - uses: julia-actions/julia-runtest@latest From f0c6c17756e9cc8fbba82c03fcb0368153247bbf Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 10:27:30 -0800 Subject: [PATCH 29/53] more MPItrampoline fixes --- .github/workflows/UnitTests.yml | 35 +++++++++++++++++++-------------- src/MPI.jl | 2 +- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 66d84620d..4d3e66b68 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -354,7 +354,7 @@ jobs: using Pkg Pkg.develop(path="lib/MPIPreferences") - - name: use OpenMPI_jll + - name: use MPItrampoline_jll shell: julia --color=yes --project=test {0} run: | using Pkg @@ -505,7 +505,7 @@ jobs: - libmpich-dev - libopenmpi-dev julia_version: - - "1.6" + - "1" # We don't need to test all combinations # - "1.7" # - "nightly" @@ -515,7 +515,8 @@ jobs: runs-on: ubuntu-20.04 env: - JULIA_MPI_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_BINARY: MPItrampoline_jll + JULIA_MPI_TEST_ABI: MPIwrapper MPITRAMPOLINE_LIB: /usr/local/lib/libmpiwrapper.so MPITRAMPOLINE_MPIEXEC: /usr/bin/mpiexec OMPI_MCA_btl_base_warn_component_unused: 0 @@ -542,18 +543,22 @@ jobs: with: version: ${{ matrix.julia_version }} - # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 - - name: Cache artifacts - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 + + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + + - name: use MPItrampoline_jll + shell: julia --color=yes --project=test {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_jll_binary("MPItrampoline_jll", export_prefs=true) + rm("test/Manifest.toml") - uses: julia-actions/julia-runtest@latest diff --git a/src/MPI.jl b/src/MPI.jl index 115394572..069cac6cb 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -43,7 +43,7 @@ elseif MPIPreferences.binary == "OpenMPI_jll" elseif MPIPreferences.binary == "MicrosoftMPI_jll" import MicrosoftMPI_jll: libmpi, mpiexec elseif MPIPreferences.binary == "MPItrampoline_jll" - import MPItrampoline_jll: libmpi, mpiexec + import MPItrampoline_jll: MPItrampoline_jll, libmpi, mpiexec const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path else error("Unknown MPI binary: $(MPIPreferences.binary)") From 07109d91e6fcc9703cbd8fa647bfeb84f687cd5b Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 10:42:12 -0800 Subject: [PATCH 30/53] add mpiwrapper consts --- src/consts/mpiwrapper.jl | 336 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 336 insertions(+) create mode 100644 src/consts/mpiwrapper.jl diff --git a/src/consts/mpiwrapper.jl b/src/consts/mpiwrapper.jl new file mode 100644 index 000000000..832a215fb --- /dev/null +++ b/src/consts/mpiwrapper.jl @@ -0,0 +1,336 @@ +# Compile-time constants + +# Implementation limits: +const MPI_MAX_DATAREP_STRING = Cint(128) +const MPI_MAX_ERROR_STRING = Cint(1024) +const MPI_MAX_INFO_KEY = Cint(256) +const MPI_MAX_INFO_VAL = Cint(1024) +const MPI_MAX_LIBRARY_VERSION_STRING = Cint(8192) +const MPI_MAX_OBJECT_NAME = Cint(128) +const MPI_MAX_PORT_NAME = Cint(1024) +const MPI_MAX_PROCESSOR_NAME = Cint(256) + +# Types + +# Various (signed) integer types: +const MPI_Aint = Int64 +const MPI_Count = Int64 +const MPI_Fint = Int32 +const MPI_Offset = Int64 + +# Status: +struct MPI_Status + _private0::Cint + _private1::Cint + _private2::Cint + _private3::Cint + _private4::Cint + _private5::Cint + MPI_SOURCE::Cint + MPI_TAG::Cint + MPI_ERROR::Cint + _private9::Cint +end + +# Opaque handles: +const MPI_Comm = UInt +const MPI_Datatype = UInt +const MPI_Errhandler = UInt +const MPI_File = UInt +const MPI_Group = UInt +const MPI_Info = UInt +const MPI_Message = UInt +const MPI_Op = UInt +const MPI_Request = UInt +const MPI_Win = UInt + +# Function pointers: +const MPI_Comm_copy_attr_function = Ptr{Cvoid} +const MPI_Comm_delete_attr_function = Ptr{Cvoid} +const MPI_Comm_errhandler_function = Ptr{Cvoid} +const MPI_Comm_errhandler_fn = MPI_Comm_errhandler_function +const MPI_Copy_function = MPI_Comm_copy_attr_function +const MPI_Datarep_conversion_function = Ptr{Cvoid} +const MPI_Datarep_extent_function = Ptr{Cvoid} +const MPI_Delete_function = Ptr{Cvoid} +const MPI_File_errhandler_function = Ptr{Cvoid} +const MPI_File_errhandler_fn = Ptr{Cvoid} +const MPI_Grequest_cancel_function = Ptr{Cvoid} +const MPI_Grequest_free_function = Ptr{Cvoid} +const MPI_Grequest_query_function = Ptr{Cvoid} +const MPI_Type_copy_attr_function = Ptr{Cvoid} +const MPI_Type_delete_attr_function = Ptr{Cvoid} +const MPI_User_function = Ptr{Cvoid} +const MPI_Win_copy_attr_function = Ptr{Cvoid} +const MPI_Win_delete_attr_function = Ptr{Cvoid} +const MPI_Win_errhandler_function = Ptr{Cvoid} +const MPI_Win_errhandler_fn = MPI_Win_errhandler_function + + +@const_ref MPI_ANY_SOURCE Cint unsafe_load(cglobal((:MPICONSTANTS_ANY_SOURCE, libmpiconstants), Cint)) +@const_ref MPI_ANY_TAG Cint unsafe_load(cglobal((:MPICONSTANTS_ANY_TAG, libmpiconstants), Cint)) +@const_ref MPI_PROC_NULL Cint unsafe_load(cglobal((:MPICONSTANTS_PROC_NULL, libmpiconstants), Cint)) +@const_ref MPI_ROOT Cint unsafe_load(cglobal((:MPICONSTANTS_ROOT, libmpiconstants), Cint)) +@const_ref MPI_CART Cint unsafe_load(cglobal((:MPICONSTANTS_CART, libmpiconstants), Cint)) +@const_ref MPI_DIST_GRAPH Cint unsafe_load(cglobal((:MPICONSTANTS_DIST_GRAPH, libmpiconstants), Cint)) +@const_ref MPI_GRAPH Cint unsafe_load(cglobal((:MPICONSTANTS_GRAPH, libmpiconstants), Cint)) +@const_ref MPI_CONGRUENT Cint unsafe_load(cglobal((:MPICONSTANTS_CONGRUENT, libmpiconstants), Cint)) +@const_ref MPI_IDENT Cint unsafe_load(cglobal((:MPICONSTANTS_IDENT, libmpiconstants), Cint)) +@const_ref MPI_SIMILAR Cint unsafe_load(cglobal((:MPICONSTANTS_SIMILAR, libmpiconstants), Cint)) +@const_ref MPI_UNEQUAL Cint unsafe_load(cglobal((:MPICONSTANTS_UNEQUAL, libmpiconstants), Cint)) +@const_ref MPI_KEYVAL_INVALID Cint unsafe_load(cglobal((:MPICONSTANTS_KEYVAL_INVALID, libmpiconstants), Cint)) +@const_ref MPI_UNDEFINED Cint unsafe_load(cglobal((:MPICONSTANTS_UNDEFINED, libmpiconstants), Cint)) +@const_ref MPI_APPNUM Cint unsafe_load(cglobal((:MPICONSTANTS_APPNUM, libmpiconstants), Cint)) +@const_ref MPI_HOST Cint unsafe_load(cglobal((:MPICONSTANTS_HOST, libmpiconstants), Cint)) +@const_ref MPI_IO Cint unsafe_load(cglobal((:MPICONSTANTS_IO, libmpiconstants), Cint)) +@const_ref MPI_LASTUSEDCODE Cint unsafe_load(cglobal((:MPICONSTANTS_LASTUSEDCODE, libmpiconstants), Cint)) +@const_ref MPI_TAG_UB Cint unsafe_load(cglobal((:MPICONSTANTS_TAG_UB, libmpiconstants), Cint)) +@const_ref MPI_UNIVERSE_SIZE Cint unsafe_load(cglobal((:MPICONSTANTS_UNIVERSE_SIZE, libmpiconstants), Cint)) +@const_ref MPI_WIN_BASE Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_BASE, libmpiconstants), Cint)) +@const_ref MPI_WIN_CREATE_FLAVOR Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_CREATE_FLAVOR, libmpiconstants), Cint)) +@const_ref MPI_WIN_DISP_UNIT Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_DISP_UNIT, libmpiconstants), Cint)) +@const_ref MPI_WIN_MODEL Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_MODEL, libmpiconstants), Cint)) +@const_ref MPI_WIN_SIZE Cint unsafe_load(cglobal((:MPICONSTANTS_WIN_SIZE, libmpiconstants), Cint)) +@const_ref MPI_WTIME_IS_GLOBAL Cint unsafe_load(cglobal((:MPICONSTANTS_WTIME_IS_GLOBAL, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_CONTIGUOUS Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_CONTIGUOUS, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_DARRAY Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_DARRAY, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_DUP Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_DUP, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_F90_COMPLEX Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_F90_COMPLEX, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_F90_INTEGER Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_F90_INTEGER, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_F90_REAL Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_F90_REAL, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_HINDEXED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_HINDEXED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_HINDEXED_BLOCK Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_HINDEXED_BLOCK, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_HVECTOR Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_HVECTOR, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_INDEXED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_INDEXED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_INDEXED_BLOCK Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_INDEXED_BLOCK, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_NAMED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_NAMED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_RESIZED Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_RESIZED, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_STRUCT Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_STRUCT, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_SUBARRAY Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_SUBARRAY, libmpiconstants), Cint)) +@const_ref MPI_COMBINER_VECTOR Cint unsafe_load(cglobal((:MPICONSTANTS_COMBINER_VECTOR, libmpiconstants), Cint)) +@const_ref MPI_COMM_TYPE_SHARED Cint unsafe_load(cglobal((:MPICONSTANTS_COMM_TYPE_SHARED, libmpiconstants), Cint)) +@const_ref MPI_DISTRIBUTE_BLOCK Cint unsafe_load(cglobal((:MPICONSTANTS_DISTRIBUTE_BLOCK, libmpiconstants), Cint)) +@const_ref MPI_DISTRIBUTE_CYCLIC Cint unsafe_load(cglobal((:MPICONSTANTS_DISTRIBUTE_CYCLIC, libmpiconstants), Cint)) +@const_ref MPI_DISTRIBUTE_NONE Cint unsafe_load(cglobal((:MPICONSTANTS_DISTRIBUTE_NONE, libmpiconstants), Cint)) +@const_ref MPI_ERR_ACCESS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ACCESS, libmpiconstants), Cint)) +@const_ref MPI_ERR_AMODE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_AMODE, libmpiconstants), Cint)) +@const_ref MPI_ERR_ARG Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ARG, libmpiconstants), Cint)) +@const_ref MPI_ERR_ASSERT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ASSERT, libmpiconstants), Cint)) +@const_ref MPI_ERR_BAD_FILE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_BAD_FILE, libmpiconstants), Cint)) +@const_ref MPI_ERR_BASE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_BASE, libmpiconstants), Cint)) +@const_ref MPI_ERR_BUFFER Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_BUFFER, libmpiconstants), Cint)) +@const_ref MPI_ERR_COMM Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_COMM, libmpiconstants), Cint)) +@const_ref MPI_ERR_CONVERSION Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_CONVERSION, libmpiconstants), Cint)) +@const_ref MPI_ERR_COUNT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_COUNT, libmpiconstants), Cint)) +@const_ref MPI_ERR_DIMS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_DIMS, libmpiconstants), Cint)) +@const_ref MPI_ERR_DISP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_DISP, libmpiconstants), Cint)) +@const_ref MPI_ERR_DUP_DATAREP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_DUP_DATAREP, libmpiconstants), Cint)) +@const_ref MPI_ERR_FILE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_FILE, libmpiconstants), Cint)) +@const_ref MPI_ERR_FILE_EXISTS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_FILE_EXISTS, libmpiconstants), Cint)) +@const_ref MPI_ERR_FILE_IN_USE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_FILE_IN_USE, libmpiconstants), Cint)) +@const_ref MPI_ERR_GROUP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_GROUP, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO_KEY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO_KEY, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO_NOKEY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO_NOKEY, libmpiconstants), Cint)) +@const_ref MPI_ERR_INFO_VALUE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INFO_VALUE, libmpiconstants), Cint)) +@const_ref MPI_ERR_INTERN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_INTERN, libmpiconstants), Cint)) +@const_ref MPI_ERR_IN_STATUS Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_IN_STATUS, libmpiconstants), Cint)) +@const_ref MPI_ERR_IO Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_IO, libmpiconstants), Cint)) +@const_ref MPI_ERR_KEYVAL Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_KEYVAL, libmpiconstants), Cint)) +@const_ref MPI_ERR_LASTCODE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_LASTCODE, libmpiconstants), Cint)) +@const_ref MPI_ERR_LOCKTYPE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_LOCKTYPE, libmpiconstants), Cint)) +@const_ref MPI_ERR_NAME Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NAME, libmpiconstants), Cint)) +@const_ref MPI_ERR_NOT_SAME Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NOT_SAME, libmpiconstants), Cint)) +@const_ref MPI_ERR_NO_MEM Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NO_MEM, libmpiconstants), Cint)) +@const_ref MPI_ERR_NO_SPACE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NO_SPACE, libmpiconstants), Cint)) +@const_ref MPI_ERR_NO_SUCH_FILE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_NO_SUCH_FILE, libmpiconstants), Cint)) +@const_ref MPI_ERR_OP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_OP, libmpiconstants), Cint)) +@const_ref MPI_ERR_OTHER Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_OTHER, libmpiconstants), Cint)) +@const_ref MPI_ERR_PENDING Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_PENDING, libmpiconstants), Cint)) +@const_ref MPI_ERR_PORT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_PORT, libmpiconstants), Cint)) +@const_ref MPI_ERR_QUOTA Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_QUOTA, libmpiconstants), Cint)) +@const_ref MPI_ERR_RANK Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RANK, libmpiconstants), Cint)) +@const_ref MPI_ERR_READ_ONLY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_READ_ONLY, libmpiconstants), Cint)) +@const_ref MPI_ERR_REQUEST Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_REQUEST, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_ATTACH Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_ATTACH, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_CONFLICT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_CONFLICT, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_FLAVOR Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_FLAVOR, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_RANGE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_RANGE, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_SHARED Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_SHARED, libmpiconstants), Cint)) +@const_ref MPI_ERR_RMA_SYNC Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_RMA_SYNC, libmpiconstants), Cint)) +@const_ref MPI_ERR_ROOT Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_ROOT, libmpiconstants), Cint)) +@const_ref MPI_ERR_SERVICE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_SERVICE, libmpiconstants), Cint)) +@const_ref MPI_ERR_SIZE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_SIZE, libmpiconstants), Cint)) +@const_ref MPI_ERR_SPAWN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_SPAWN, libmpiconstants), Cint)) +@const_ref MPI_ERR_TAG Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TAG, libmpiconstants), Cint)) +@const_ref MPI_ERR_TOPOLOGY Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TOPOLOGY, libmpiconstants), Cint)) +@const_ref MPI_ERR_TRUNCATE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TRUNCATE, libmpiconstants), Cint)) +@const_ref MPI_ERR_TYPE Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_TYPE, libmpiconstants), Cint)) +@const_ref MPI_ERR_UNKNOWN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_UNKNOWN, libmpiconstants), Cint)) +@const_ref MPI_ERR_UNSUPPORTED_DATAREP Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_UNSUPPORTED_DATAREP, libmpiconstants), Cint)) +@const_ref MPI_ERR_UNSUPPORTED_OPERATION Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_UNSUPPORTED_OPERATION, libmpiconstants), Cint)) +@const_ref MPI_ERR_WIN Cint unsafe_load(cglobal((:MPICONSTANTS_ERR_WIN, libmpiconstants), Cint)) + +@const_ref MPI_SUCCESS Cint unsafe_load(cglobal((:MPICONSTANTS_SUCCESS, libmpiconstants), Cint)) +@const_ref MPI_LOCK_EXCLUSIVE Cint unsafe_load(cglobal((:MPICONSTANTS_LOCK_EXCLUSIVE, libmpiconstants), Cint)) +@const_ref MPI_LOCK_SHARED Cint unsafe_load(cglobal((:MPICONSTANTS_LOCK_SHARED, libmpiconstants), Cint)) +@const_ref MPI_MODE_APPEND Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_APPEND, libmpiconstants), Cint)) +@const_ref MPI_MODE_CREATE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_CREATE, libmpiconstants), Cint)) +@const_ref MPI_MODE_DELETE_ON_CLOSE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_DELETE_ON_CLOSE, libmpiconstants), Cint)) +@const_ref MPI_MODE_EXCL Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_EXCL, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOCHECK Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOCHECK, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOPRECEDE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOPRECEDE, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOPUT Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOPUT, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOSTORE Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOSTORE, libmpiconstants), Cint)) +@const_ref MPI_MODE_NOSUCCEED Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_NOSUCCEED, libmpiconstants), Cint)) +@const_ref MPI_MODE_RDONLY Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_RDONLY, libmpiconstants), Cint)) +@const_ref MPI_MODE_RDWR Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_RDWR, libmpiconstants), Cint)) +@const_ref MPI_MODE_SEQUENTIAL Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_SEQUENTIAL, libmpiconstants), Cint)) +@const_ref MPI_MODE_UNIQUE_OPEN Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_UNIQUE_OPEN, libmpiconstants), Cint)) +@const_ref MPI_MODE_WRONLY Cint unsafe_load(cglobal((:MPICONSTANTS_MODE_WRONLY, libmpiconstants), Cint)) +@const_ref MPI_ORDER_C Cint unsafe_load(cglobal((:MPICONSTANTS_ORDER_C, libmpiconstants), Cint)) +@const_ref MPI_ORDER_FORTRAN Cint unsafe_load(cglobal((:MPICONSTANTS_ORDER_FORTRAN, libmpiconstants), Cint)) +@const_ref MPI_SEEK_CUR Cint unsafe_load(cglobal((:MPICONSTANTS_SEEK_CUR, libmpiconstants), Cint)) +@const_ref MPI_SEEK_END Cint unsafe_load(cglobal((:MPICONSTANTS_SEEK_END, libmpiconstants), Cint)) +@const_ref MPI_SEEK_SET Cint unsafe_load(cglobal((:MPICONSTANTS_SEEK_SET, libmpiconstants), Cint)) +@const_ref MPI_THREAD_SINGLE Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_SINGLE, libmpiconstants), Cint)) +@const_ref MPI_THREAD_FUNNELED Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_FUNNELED, libmpiconstants), Cint)) +@const_ref MPI_THREAD_SERIALIZED Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_SERIALIZED, libmpiconstants), Cint)) +@const_ref MPI_THREAD_MULTIPLE Cint unsafe_load(cglobal((:MPICONSTANTS_THREAD_MULTIPLE, libmpiconstants), Cint)) +@const_ref MPI_TYPECLASS_COMPLEX Cint unsafe_load(cglobal((:MPICONSTANTS_TYPECLASS_COMPLEX, libmpiconstants), Cint)) +@const_ref MPI_TYPECLASS_INTEGER Cint unsafe_load(cglobal((:MPICONSTANTS_TYPECLASS_INTEGER, libmpiconstants), Cint)) +@const_ref MPI_TYPECLASS_REAL Cint unsafe_load(cglobal((:MPICONSTANTS_TYPECLASS_REAL, libmpiconstants), Cint)) + +@const_ref MPI_ARGV_NULL Ptr{Cchar} unsafe_load(cglobal((:MPICONSTANTS_ARGV_NULL, libmpiconstants), Ptr{Ptr{Cchar}})) +@const_ref MPI_ARGVS_NULL Ptr{Cchar} unsafe_load(cglobal((:MPICONSTANTS_ARGVS_NULL, libmpiconstants), Ptr{Ptr{Ptr{Cchar}}})) +# MPI_UNWEIGHTED Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_UNWEIGHTED, libmpiconstants), Ptr{Cint})) +# MPI_WEIGHTS_EMPTY Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_WEIGHTS_EMPTY, libmpiconstants), Ptr{Cint})) +@const_ref MPI_BOTTOM Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_BOTTOM, libmpiconstants), Ptr{Cvoid})) +@const_ref MPI_IN_PLACE Ptr{Cvoid} unsafe_load(cglobal((:MPICONSTANTS_IN_PLACE, libmpiconstants), Ptr{Cvoid})) + +@const_ref MPI_COMM_NULL MPI_Comm unsafe_load(cglobal((:MPICONSTANTS_COMM_NULL , libmpiconstants), MPI_Comm)) +@const_ref MPI_COMM_SELF MPI_Comm unsafe_load(cglobal((:MPICONSTANTS_COMM_SELF , libmpiconstants), MPI_Comm)) +@const_ref MPI_COMM_WORLD MPI_Comm unsafe_load(cglobal((:MPICONSTANTS_COMM_WORLD, libmpiconstants), MPI_Comm)) + +@const_ref MPI_COMM_DUP_FN MPI_Comm_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_COMM_DUP_FN, libmpiconstants), MPI_Comm_copy_attr_function)) +@const_ref MPI_COMM_NULL_COPY_FN MPI_Comm_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_COMM_NULL_COPY_FN, libmpiconstants), MPI_Comm_copy_attr_function)) +@const_ref MPI_COMM_NULL_DELETE_FN MPI_Comm_delete_attr_function unsafe_load(cglobal((:MPICONSTANTS_COMM_NULL_DELETE_FN, libmpiconstants), MPI_Comm_delete_attr_function)) + +@const_ref MPI_NULL_COPY_FN MPI_Copy_function unsafe_load(cglobal((:MPICONSTANTS_NULL_COPY_FN, libmpiconstants), MPI_Copy_function)) + +@const_ref MPI_2DOUBLE_PRECISION MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2DOUBLE_PRECISION, libmpiconstants), MPI_Datatype)) +@const_ref MPI_2INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_2INTEGER MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2INTEGER, libmpiconstants), MPI_Datatype)) +@const_ref MPI_2REAL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_2REAL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_AINT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_AINT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_BYTE MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_BYTE, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CHAR, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CHARACTER MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CHARACTER, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COMPLEX16 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX16, libmpiconstants), MPI_Datatype)) +# MPI_COMPLEX32 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX32, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COMPLEX8 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COMPLEX8, libmpiconstants), MPI_Datatype)) +@const_ref MPI_COUNT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_COUNT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_BOOL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_BOOL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_FLOAT_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_FLOAT_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_CXX_LONG_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_CXX_LONG_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_BOOL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_BOOL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_FLOAT_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_FLOAT_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_C_LONG_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_C_LONG_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DATATYPE_NULL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DATATYPE_NULL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE_COMPLEX MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE_COMPLEX, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_DOUBLE_PRECISION MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_DOUBLE_PRECISION, libmpiconstants), MPI_Datatype)) +@const_ref MPI_FLOAT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_FLOAT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_FLOAT_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_FLOAT_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT16_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT16_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT32_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT32_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT64_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT64_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INT8_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INT8_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER1 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER1, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER2 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER2, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER4 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER4, libmpiconstants), MPI_Datatype)) +@const_ref MPI_INTEGER8 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_INTEGER8, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LOGICAL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LOGICAL, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_DOUBLE MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_DOUBLE, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_DOUBLE_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_DOUBLE_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_LONG_LONG_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_LONG_LONG_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_OFFSET MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_OFFSET, libmpiconstants), MPI_Datatype)) +@const_ref MPI_PACKED MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_PACKED, libmpiconstants), MPI_Datatype)) +@const_ref MPI_REAL MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL, libmpiconstants), MPI_Datatype)) +# MPI_REAL16 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL16, libmpiconstants), MPI_Datatype)) +@const_ref MPI_REAL4 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL4, libmpiconstants), MPI_Datatype)) +@const_ref MPI_REAL8 MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_REAL8, libmpiconstants), MPI_Datatype)) +@const_ref MPI_SHORT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_SHORT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_SHORT_INT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_SHORT_INT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_SIGNED_CHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_SIGNED_CHAR, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT16_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT16_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT32_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT32_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT64_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT64_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UINT8_T MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UINT8_T, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_CHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_CHAR, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_LONG_LONG MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_LONG_LONG, libmpiconstants), MPI_Datatype)) +@const_ref MPI_UNSIGNED_SHORT MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_UNSIGNED_SHORT, libmpiconstants), MPI_Datatype)) +@const_ref MPI_WCHAR MPI_Datatype unsafe_load(cglobal((:MPICONSTANTS_WCHAR, libmpiconstants), MPI_Datatype)) + +@const_ref MPI_NULL_DELETE_FN MPI_Delete_function unsafe_load(cglobal((:MPICONSTANTS_NULL_DELETE_FN, libmpiconstants), MPI_Delete_function)) + +@const_ref MPI_ERRHANDLER_NULL MPI_Errhandler unsafe_load(cglobal((:MPICONSTANTS_ERRHANDLER_NULL, libmpiconstants), MPI_Errhandler)) +@const_ref MPI_ERRORS_ARE_FATAL MPI_Errhandler unsafe_load(cglobal((:MPICONSTANTS_ERRORS_ARE_FATAL, libmpiconstants), MPI_Errhandler)) +@const_ref MPI_ERRORS_RETURN MPI_Errhandler unsafe_load(cglobal((:MPICONSTANTS_ERRORS_RETURN, libmpiconstants), MPI_Errhandler)) + +@const_ref MPI_FILE_NULL MPI_File unsafe_load(cglobal((:MPICONSTANTS_FILE_NULL, libmpiconstants), MPI_File)) + +@const_ref MPI_GROUP_EMPTY MPI_Group unsafe_load(cglobal((:MPICONSTANTS_GROUP_EMPTY, libmpiconstants), MPI_Group)) +@const_ref MPI_GROUP_NULL MPI_Group unsafe_load(cglobal((:MPICONSTANTS_GROUP_NULL, libmpiconstants), MPI_Group)) + +@const_ref MPI_INFO_ENV MPI_Info unsafe_load(cglobal((:MPICONSTANTS_INFO_ENV, libmpiconstants), MPI_Info)) +@const_ref MPI_INFO_NULL MPI_Info unsafe_load(cglobal((:MPICONSTANTS_INFO_NULL, libmpiconstants), MPI_Info)) + +@const_ref MPI_MESSAGE_NO_PROC MPI_Message unsafe_load(cglobal((:MPICONSTANTS_MESSAGE_NO_PROC, libmpiconstants), MPI_Message)) +@const_ref MPI_MESSAGE_NULL MPI_Message unsafe_load(cglobal((:MPICONSTANTS_MESSAGE_NULL, libmpiconstants), MPI_Message)) + +@const_ref MPI_DISPLACEMENT_CURRENT MPI_Offset unsafe_load(cglobal((:MPICONSTANTS_DISPLACEMENT_CURRENT, libmpiconstants), MPI_Offset)) + +@const_ref MPI_BAND MPI_Op unsafe_load(cglobal((:MPICONSTANTS_BAND, libmpiconstants), MPI_Op)) +@const_ref MPI_BOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_BOR, libmpiconstants), MPI_Op)) +@const_ref MPI_BXOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_BXOR, libmpiconstants), MPI_Op)) +@const_ref MPI_LAND MPI_Op unsafe_load(cglobal((:MPICONSTANTS_LAND, libmpiconstants), MPI_Op)) +@const_ref MPI_LOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_LOR, libmpiconstants), MPI_Op)) +@const_ref MPI_LXOR MPI_Op unsafe_load(cglobal((:MPICONSTANTS_LXOR, libmpiconstants), MPI_Op)) +@const_ref MPI_MAX MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MAX, libmpiconstants), MPI_Op)) +@const_ref MPI_MAXLOC MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MAXLOC, libmpiconstants), MPI_Op)) +@const_ref MPI_MIN MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MIN, libmpiconstants), MPI_Op)) +@const_ref MPI_MINLOC MPI_Op unsafe_load(cglobal((:MPICONSTANTS_MINLOC, libmpiconstants), MPI_Op)) +@const_ref MPI_NO_OP MPI_Op unsafe_load(cglobal((:MPICONSTANTS_NO_OP, libmpiconstants), MPI_Op)) +@const_ref MPI_OP_NULL MPI_Op unsafe_load(cglobal((:MPICONSTANTS_OP_NULL, libmpiconstants), MPI_Op)) +@const_ref MPI_PROD MPI_Op unsafe_load(cglobal((:MPICONSTANTS_PROD, libmpiconstants), MPI_Op)) +@const_ref MPI_REPLACE MPI_Op unsafe_load(cglobal((:MPICONSTANTS_REPLACE, libmpiconstants), MPI_Op)) +@const_ref MPI_SUM MPI_Op unsafe_load(cglobal((:MPICONSTANTS_SUM, libmpiconstants), MPI_Op)) + +@const_ref MPI_REQUEST_NULL MPI_Request unsafe_load(cglobal((:MPICONSTANTS_REQUEST_NULL, libmpiconstants), MPI_Request)) + +@const_ref MPI_STATUS_IGNORE Ptr{MPI_Status} unsafe_load(cglobal((:MPICONSTANTS_STATUS_IGNORE, libmpiconstants), Ptr{MPI_Status})) +@const_ref MPI_STATUSES_IGNORE Ptr{MPI_Status} unsafe_load(cglobal((:MPICONSTANTS_STATUSES_IGNORE, libmpiconstants), Ptr{MPI_Status})) + +@const_ref MPI_TYPE_DUP_FN MPI_Type_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_TYPE_DUP_FN, libmpiconstants), MPI_Type_copy_attr_function)) +@const_ref MPI_TYPE_NULL_COPY_FN MPI_Type_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_TYPE_NULL_COPY_FN, libmpiconstants), MPI_Type_copy_attr_function)) +@const_ref MPI_TYPE_NULL_DELETE_FN MPI_Type_delete_attr_function unsafe_load(cglobal((:MPICONSTANTS_TYPE_NULL_DELETE_FN, libmpiconstants), MPI_Type_delete_attr_function)) + +@const_ref MPI_WIN_NULL MPI_Win unsafe_load(cglobal((:MPICONSTANTS_WIN_NULL, libmpiconstants), MPI_Win)) + +@const_ref MPI_WIN_DUP_FN MPI_Win_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_WIN_DUP_FN, libmpiconstants), MPI_Win_copy_attr_function)) +@const_ref MPI_WIN_NULL_COPY_FN MPI_Win_copy_attr_function unsafe_load(cglobal((:MPICONSTANTS_WIN_NULL_COPY_FN, libmpiconstants), MPI_Win_copy_attr_function)) + +@const_ref MPI_WIN_NULL_DELETE_FN MPI_Win_delete_attr_function unsafe_load(cglobal((:MPICONSTANTS_WIN_NULL_DELETE_FN, libmpiconstants), MPI_Win_delete_attr_function)) From 422c00644fe3c7fc73124b1ca9e15ecbb051e25c Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 10:59:39 -0800 Subject: [PATCH 31/53] enable system --- src/MPI.jl | 6 ++++++ src/consts/consts.jl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MPI.jl b/src/MPI.jl index 069cac6cb..e2a8d8b0e 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -38,13 +38,19 @@ import MPIPreferences @static if MPIPreferences.binary == "MPICH_jll" import MPICH_jll: libmpi, mpiexec + const libmpiconstants = nothing elseif MPIPreferences.binary == "OpenMPI_jll" import OpenMPI_jll: libmpi, mpiexec + const libmpiconstants = nothing elseif MPIPreferences.binary == "MicrosoftMPI_jll" import MicrosoftMPI_jll: libmpi, mpiexec + const libmpiconstants = nothing elseif MPIPreferences.binary == "MPItrampoline_jll" import MPItrampoline_jll: MPItrampoline_jll, libmpi, mpiexec const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path +elseif MPIPreferences.binary == "system" + import MPIPreferences.Sysem: libmpi, mpiexec + const libmpiconstants = nothing else error("Unknown MPI binary: $(MPIPreferences.binary)") end diff --git a/src/consts/consts.jl b/src/consts/consts.jl index e1cf01527..519c4a357 100644 --- a/src/consts/consts.jl +++ b/src/consts/consts.jl @@ -5,7 +5,7 @@ export MPI_Aint, MPI_Count, MPI_Offset, MPI_Status, MPI_Info, MPI_Message, MPI_Op, MPI_Request, MPI_Win import MPIPreferences -import ..libmpi +import ..libmpi, ..libmpiconstants const initexprs = Any[] From fbe478a23f7161fcb3ebc993b32f4ca81af9f179 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 14:24:36 -0800 Subject: [PATCH 32/53] MPI_Count on Open MPI is Int --- src/consts/openmpi.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/consts/openmpi.jl b/src/consts/openmpi.jl index aeff38e24..0c2866391 100644 --- a/src/consts/openmpi.jl +++ b/src/consts/openmpi.jl @@ -17,8 +17,8 @@ const MPI_MAX_PROCESSOR_NAME = Cint(256) # Various (signed) integer types: const MPI_Aint = Int const MPI_Fint = Int32 -const MPI_Count = Int64 -const MPI_Offset = Int64 +const MPI_Count = Int +const MPI_Offset = Int # Status: struct MPI_Status From e2cd300367d9ed46125ebde0569f365e2afe4186 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 14:25:16 -0800 Subject: [PATCH 33/53] typo --- src/MPI.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MPI.jl b/src/MPI.jl index e2a8d8b0e..32b8511e4 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -49,7 +49,7 @@ elseif MPIPreferences.binary == "MPItrampoline_jll" import MPItrampoline_jll: MPItrampoline_jll, libmpi, mpiexec const libmpiconstants = MPItrampoline_jll.libload_time_mpi_constants_path elseif MPIPreferences.binary == "system" - import MPIPreferences.Sysem: libmpi, mpiexec + import MPIPreferences.System: libmpi, mpiexec const libmpiconstants = nothing else error("Unknown MPI binary: $(MPIPreferences.binary)") From d0beb6d350e15c6ad83ff0f3811e6da9d6e8c083 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 21:55:22 -0800 Subject: [PATCH 34/53] fix mpiexec --- lib/MPIPreferences/src/MPIPreferences.jl | 1 + src/environment.jl | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl index fa1ca2594..096a15abb 100644 --- a/lib/MPIPreferences/src/MPIPreferences.jl +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -19,6 +19,7 @@ else end module System + export libmpi, mpiexec using Preferences const libmpi = @load_preference("libmpi") const mpiexec_path = @load_preference("mpiexec") diff --git a/src/environment.jl b/src/environment.jl index acd2b9f9d..f93be9e1a 100644 --- a/src/environment.jl +++ b/src/environment.jl @@ -21,10 +21,7 @@ hello world hello world ``` """ -function mpiexec(fn) - _mpiexec(cmd -> fn(`$cmd $(Base.shell_split(get(ENV, "JULIA_MPIEXEC_ARGS", "")))`)) -end - +mpiexec # Administrative functions function _warn_if_wrong_mpi() From 7a18cd822146eece31169401ab2ff84458734d97 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 21:56:48 -0800 Subject: [PATCH 35/53] print some info --- test/test_sendrecv.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_sendrecv.jl b/test/test_sendrecv.jl index 513e72e69..d2f42ecaa 100644 --- a/test/test_sendrecv.jl +++ b/test/test_sendrecv.jl @@ -30,6 +30,7 @@ rreq = MPI.Irecv!(recv_mesg, comm; source=src, tag=src+32) sreq = MPI.Isend(send_mesg, comm; dest=dst, tag=rank+32) stats = MPI.Waitall([sreq, rreq], MPI.Status) +@show stats[2] @test rreq isa MPI.Request @test sreq isa MPI.Request @test MPI.Get_source(stats[2]) == src From 44a9dc7f9dd866343dc40a15194369e2e88a99d3 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 22:16:44 -0800 Subject: [PATCH 36/53] fix openmpi status struct --- src/consts/openmpi.jl | 3 +-- src/nonblocking.jl | 2 +- test/test_sendrecv.jl | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/consts/openmpi.jl b/src/consts/openmpi.jl index 0c2866391..f67ecf022 100644 --- a/src/consts/openmpi.jl +++ b/src/consts/openmpi.jl @@ -26,8 +26,7 @@ struct MPI_Status MPI_TAG::Cint MPI_ERROR::Cint _private0::Cint - _private1::Cint - _private2::Cint + _private1::Csize_t end # Opaque handles: diff --git a/src/nonblocking.jl b/src/nonblocking.jl index f266656cc..07c573c19 100644 --- a/src/nonblocking.jl +++ b/src/nonblocking.jl @@ -14,7 +14,7 @@ number of entries received. """ const Status = MPI_Status -@eval const STATUS_ZERO = Status($([Cint(0) for i in 1:sizeof(Status) ÷ sizeof(Cint)]...)) +const STATUS_ZERO = Status(map(zero,fieldtypes(Status))...) function Base.getproperty(status::Status, name::Symbol) name ≡ :error && return status.MPI_ERROR diff --git a/test/test_sendrecv.jl b/test/test_sendrecv.jl index d2f42ecaa..513e72e69 100644 --- a/test/test_sendrecv.jl +++ b/test/test_sendrecv.jl @@ -30,7 +30,6 @@ rreq = MPI.Irecv!(recv_mesg, comm; source=src, tag=src+32) sreq = MPI.Isend(send_mesg, comm; dest=dst, tag=rank+32) stats = MPI.Waitall([sreq, rreq], MPI.Status) -@show stats[2] @test rreq isa MPI.Request @test sreq isa MPI.Request @test MPI.Get_source(stats[2]) == src From 4a1b176e1b426b844499f1373a4e7718ed3d1c25 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 22:33:07 -0800 Subject: [PATCH 37/53] add hook for MPITRAMPOLINE_MPIEXEC --- src/MPI.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MPI.jl b/src/MPI.jl index 32b8511e4..a234c3690 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -124,6 +124,10 @@ function __init__() ENV["UCX_ERROR_SIGNALS"] = "SIGILL,SIGBUS,SIGFPE" end + if MPIPreferences.binary == "MPItrampoline_jll" && !haskey(ENV, "MPITRAMPOLINE_MPIEXEC") + ENV["MPITRAMPOLINE_MPIEXEC"] = MPItrampoline_jll.mpich_mpiexec_path + end + run_load_time_hooks() @require CUDA="052768ef-5323-5732-b1bb-66c8b64840ba" include("cuda.jl") From 958b6d65c0d464dae9e40da2924f977fd4da9830 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 22:44:13 -0800 Subject: [PATCH 38/53] fix mpiwrapper status struct --- src/consts/mpiwrapper.jl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/consts/mpiwrapper.jl b/src/consts/mpiwrapper.jl index 832a215fb..7e5063c41 100644 --- a/src/consts/mpiwrapper.jl +++ b/src/consts/mpiwrapper.jl @@ -24,12 +24,10 @@ struct MPI_Status _private1::Cint _private2::Cint _private3::Cint - _private4::Cint - _private5::Cint + _private4::Csize_t MPI_SOURCE::Cint MPI_TAG::Cint MPI_ERROR::Cint - _private9::Cint end # Opaque handles: From 1cc6f11800c120d988c27269ed9f280e0d37219a Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 22:46:38 -0800 Subject: [PATCH 39/53] clean up build --- .github/workflows/UnitTests.yml | 131 -------------------------------- 1 file changed, 131 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 4d3e66b68..e6cb478d6 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -366,137 +366,6 @@ jobs: - uses: julia-actions/julia-runtest@latest -# It takes too long to build MPICH or OpenMPI from source. -# test-mpitrampoline-system-macos: -# timeout-minutes: 20 -# strategy: -# matrix: -# mpi: -# - mpich -# - openmpi -# julia_version: -# - "1.6" -# - "1.7" -# - "nightly" -# -# fail-fast: false -# -# runs-on: macos-latest -# -# env: -# JULIA_MPI_BINARY: MPItrampoline_jll -# MPITRAMPOLINE_VERBOSE: 1 #TODO -# MPITRAMPOLINE_LIB: /usr/local/lib/libmpiwrapper.so -# MPITRAMPOLINE_MPIEXEC: /usr/local/bin/mpiexec -# -# steps: -# - name: Cancel Previous Runs -# uses: styfle/cancel-workflow-action@0.4.0 -# with: -# access_token: ${{ github.token }} -# -# - name: Checkout -# uses: actions/checkout@v2.2.0 -# -# - name: Install Homebrew packages -# run: brew install autoconf automake -# env: -# MPI: ${{ matrix.mpi }} -# -# # We cannot install MPICH or OpenMPI via Homebrew or MacPorts, -# # since the MPI libraries there use a flat namespace, which means -# # that they cannot be loaded as plugin. We need to build the -# # libraries ourselves. -# - name: Install MPI -# run: | -# case ${{ matrix.mpi }} in -# mpich) -# # Install MPICH 4.0.b1 (a beta version) since 3.4.2 has a -# # bug in MPI_Reduce -# wget http://www.mpich.org/static/downloads/4.0b1/mpich-4.0b1.tar.gz -# tar xzf mpich-4.0b1.tar.gz -# cd mpich* -# ./configure \ -# --enable-two-level-namespace \ -# --prefix=/usr/local \ -# CC=gcc-11 \ -# CXX=g++-11 \ -# FC=gfortran-11 \ -# FFLAGS=-fallow-argument-mismatch \ -# FCFLAGS=-fallow-argument-mismatch -# make -j$(nproc) -# sudo make -j$(nproc) install -# ;; -# openmpi) -# wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.2.tar.gz -# tar xzf openmpi-4.1.2.tar.gz -# cd openmpi* -# find . -type f -print0 | xargs -0 perl -pi -e 's/-Wl,-flat_namespace//g' -# ./autogen.pl --force -# ./configure \ -# --prefix=/usr/local \ -# CC=gcc-11 \ -# CXX=g++-11 \ -# FC=gfortran-11 -# make -j$(nproc) -# sudo make -j$(nproc) install -# ;; -# esac -# env: -# MPI: ${{ matrix.mpi }} -# -# - name: Build MPIwrapper -# run: | -# wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz -# tar xzf v2.2.1.tar.gz -# cd MPIwrapper-* -# cmake \ -# -DCMAKE_CXX_COMPILER=g++-11 \ -# -DCMAKE_Fortran_COMPILER=gfortran-11 \ -# -DMPIEXEC_EXECUTABLE=mpiexec \ -# -DCMAKE_BUILD_TYPE=Debug \ -# -DCMAKE_INSTALL_PREFIX=/usr/local \ -# . -# # cmake \ -# # -DCMAKE_CXX_COMPILER=g++-11 \ -# # -DCMAKE_Fortran_COMPILER=gfortran-11 \ -# # -DMPI_CXX_ADDITIONAL_INCLUDE_DIRS=/usr/local/include \ -# # -DMPI_CXX_ADDITIONAL_INCLUDE_DIRS=/usr/local/include \ -# # -DMPI_CXX_LIB_NAMES='mpi' \ -# # -DMPI_Fortran_ADDITIONAL_INCLUDE_DIRS='/usr/local/include;/usr/local/lib' \ -# # -DMPI_Fortran_LIB_NAMES='mpi_usempif08;mpi_usempi_ignore_tkr;mpi_mpifh;mpi' \ -# # -DMPI_mpi_LIBRARY=/usr/local/lib/libmpi.dylib \ -# # -DMPI_mpi_mpifh_LIBRARY=/usr/local/lib/libmpi_mpifh.dylib \ -# # -DMPI_mpi_usempi_ignore_tkr_LIBRARY=/usr/local/lib/libmpi_usempi_ignore_tkr.dylib \ -# # -DMPI_mpi_usempif08_LIBRARY=/usr/local/lib/libmpi_usempif08.dylib \ -# # -DMPIEXEC_EXECUTABLE=/usr/local/bin/mpiexec \ -# # -DCMAKE_BUILD_TYPE=Debug \ -# # -DCMAKE_INSTALL_PREFIX=/usr/local \ -# # . -# cmake --build . -# sudo cmake --install . -# -# - uses: julia-actions/setup-julia@latest -# with: -# version: ${{ matrix.julia_version }} -# -# # https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484 -# - name: Cache artifacts -# uses: actions/cache@v1 -# env: -# cache-name: cache-artifacts -# with: -# path: ~/.julia/artifacts -# key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} -# restore-keys: | -# ${{ runner.os }}-test-${{ env.cache-name }}- -# ${{ runner.os }}-test- -# ${{ runner.os }}- -# -# - uses: julia-actions/julia-buildpkg@latest -# - uses: julia-actions/julia-runtest@latest - - test-mpitrampoline-system-apt: timeout-minutes: 20 strategy: From 1d31520dabf88770af85c825dc7248412315adbe Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 18 Feb 2022 22:47:41 -0800 Subject: [PATCH 40/53] apt update --- .github/workflows/UnitTests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index e6cb478d6..4798b9806 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -395,7 +395,9 @@ jobs: uses: actions/checkout@v2.2.0 - name: Install MPI via apt - run: sudo apt-get install $MPI + run: | + sudo apt-get update + sudo apt-get install $MPI env: MPI: ${{ matrix.mpi }} From b859bbf8bb2c0af852a1ea14ed99e8e8ac7d4a53 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Sat, 19 Feb 2022 15:03:04 -0800 Subject: [PATCH 41/53] try to get intelmpi working --- .github/workflows/UnitTests.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 4798b9806..43b7a616b 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -211,8 +211,8 @@ jobs: runs-on: ubuntu-18.04 # 20.04 not supported env: - JULIA_MPI_BINARY: system - JULIA_MPI_PATH: /home/runner/intel/compilers_and_libraries_2020.4.304/linux/mpi/intel64 + JULIA_MPI_TEST_BINARY: system + JULIA_MPI_TEST_ABi: MPICH steps: - name: Checkout @@ -256,11 +256,17 @@ jobs: using Pkg Pkg.develop(path="lib/MPIPreferences") - # we can't use the usual actions here as we need to ensure the environment variables are set - - name: "Build package" + - name: add MPIPreferences, use system run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release - julia --project -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)' + julia --color=yes --project=test -e ' + using Pkg + Pkg.develop(path="lib/MPIPreferences") + using MPIPreferences + MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml")' + + # we can't use the usual actions here as we need to ensure the environment variables are set - name: "Run tests" run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release @@ -308,6 +314,7 @@ jobs: Pkg.develop(path="lib/MPIPreferences") using MPIPreferences MPIPreferences.use_system_binary(export_prefs=true) + rm("test/Manifest.toml") - uses: julia-actions/julia-runtest@latest From 1e59f2de05334de0d144f37c230814d8b598a666 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 10:26:03 -0500 Subject: [PATCH 42/53] fix docs build --- .github/workflows/Documenter.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 9e0159173..cb4212064 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -13,7 +13,13 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.build(;verbose=true)' + shell: julia --color=yes --project=docs/ {0} + run: | + using Pkg + Pkg.develop(PackageSpec(path="lib/MPIPreferences")) + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate() + Pkg.build(;verbose=true) - name: Build and deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3c708f510ded2e79efc44543381e168df11868d5 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 10:28:36 -0500 Subject: [PATCH 43/53] add MPIPreferences to intel test --- .github/workflows/UnitTests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 43b7a616b..9a1d272d7 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -522,6 +522,12 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- + - name: add MPIPreferences + shell: julia --color=yes --project=. {0} + run: | + using Pkg + Pkg.develop(path="lib/MPIPreferences") + # We can't use the usual actions here as we need to ensure the environment variables are set - name: "Build package" run: | From 0ce4b44e77827f0117ce825d65e7e379975998ed Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 16:48:15 -0500 Subject: [PATCH 44/53] bump MPIWrapper in tests --- .github/workflows/UnitTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 9a1d272d7..fe92ce9ef 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -410,7 +410,7 @@ jobs: - name: Build MPIwrapper run: | - wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz + wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.7.0.tar.gz tar xzf v2.2.1.tar.gz cd MPIwrapper-* cmake -DMPIEXEC_EXECUTABLE=mpiexec -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local . @@ -494,7 +494,7 @@ jobs: - name: Build MPIwrapper run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release - wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.2.1.tar.gz + wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.7.0.tar.gz tar xzf v2.2.1.tar.gz cd MPIwrapper-* cmake \ From 2fe0d9421dbc5006d44da207c890586e20619cb8 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 16:51:57 -0500 Subject: [PATCH 45/53] set mpiexec on ms system --- .github/workflows/UnitTests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index fe92ce9ef..e3ad49c7d 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -313,7 +313,10 @@ jobs: using Pkg Pkg.develop(path="lib/MPIPreferences") using MPIPreferences - MPIPreferences.use_system_binary(export_prefs=true) + MPIPreferences.use_system_binary(; + export_prefs=true, + mpiexec="C:\\Program Files\\Microsoft MPI\\Bin\\mpiexec" + ) rm("test/Manifest.toml") - uses: julia-actions/julia-runtest@latest From 3062d6057843a4ba779e98ae169e4d8a27497ee0 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 18:04:15 -0500 Subject: [PATCH 46/53] fixup! bump MPIWrapper in tests --- .github/workflows/UnitTests.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index e3ad49c7d..e2599649c 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -388,6 +388,8 @@ jobs: # We don't need to test all combinations # - "1.7" # - "nightly" + MPIWrapper: + - "2.7.0" fail-fast: false @@ -413,12 +415,14 @@ jobs: - name: Build MPIwrapper run: | - wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.7.0.tar.gz - tar xzf v2.2.1.tar.gz + wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v${MPIWrapper}.tar.gz + tar xzf v${MPIWrapper}.tar.gz cd MPIwrapper-* cmake -DMPIEXEC_EXECUTABLE=mpiexec -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local . cmake --build . sudo cmake --install . + env: + MPIWrapper: ${{matrix.MPIWrapper}} - uses: julia-actions/setup-julia@latest with: @@ -453,6 +457,8 @@ jobs: # We don't need to test all combinations # - "1.7" # - "nightly" + MPIWrapper: + - "2.7.0" fail-fast: false @@ -497,8 +503,8 @@ jobs: - name: Build MPIwrapper run: | source ${HOME}/intel/compilers_and_libraries/linux/mpi/intel64/bin/mpivars.sh release - wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v2.7.0.tar.gz - tar xzf v2.2.1.tar.gz + wget https://github.com/eschnett/MPIwrapper/archive/refs/tags/v${MPIWrapper}.tar.gz + tar xzf v${MPIWrapper}.tar.gz cd MPIwrapper-* cmake \ -DMPIEXEC_EXECUTABLE=mpiexec \ @@ -507,6 +513,8 @@ jobs: . cmake --build . sudo cmake --install . + env: + MPIWrapper: ${{matrix.MPIWrapper}} - uses: julia-actions/setup-julia@latest with: From 612a74065d48cc0fd83663560a8ccff8e4d9316c Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 18:06:41 -0500 Subject: [PATCH 47/53] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano --- .gitignore | 2 +- lib/MPIPreferences/src/MPIPreferences.jl | 4 ++-- src/MPI.jl | 2 +- src/consts/consts.jl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 783882eea..ddc4e8c78 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ libjuliampi.dylib *.mem *.so Manifest.toml -LocalPreferences.toml \ No newline at end of file +LocalPreferences.toml diff --git a/lib/MPIPreferences/src/MPIPreferences.jl b/lib/MPIPreferences/src/MPIPreferences.jl index 096a15abb..af60b1af0 100644 --- a/lib/MPIPreferences/src/MPIPreferences.jl +++ b/lib/MPIPreferences/src/MPIPreferences.jl @@ -41,14 +41,14 @@ function use_jll_binary(binary = Sys.iswindows() ? "MicrosoftMPI_jll" : "MPICH_j end function use_system_binary(; - library=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"], + library_names=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"], mpiexec="mpiexec", abi=nothing, export_prefs=false, force=true, ) - libmpi = find_library(library) + libmpi = find_library(library_names) if libmpi == "" error("MPI library could not be found") end diff --git a/src/MPI.jl b/src/MPI.jl index a234c3690..ac6bfd8cc 100644 --- a/src/MPI.jl +++ b/src/MPI.jl @@ -36,7 +36,7 @@ end import MPIPreferences -@static if MPIPreferences.binary == "MPICH_jll" +if MPIPreferences.binary == "MPICH_jll" import MPICH_jll: libmpi, mpiexec const libmpiconstants = nothing elseif MPIPreferences.binary == "OpenMPI_jll" diff --git a/src/consts/consts.jl b/src/consts/consts.jl index 519c4a357..bf0570cb4 100644 --- a/src/consts/consts.jl +++ b/src/consts/consts.jl @@ -43,4 +43,4 @@ end $(Expr(:block, initexprs...)) end -end \ No newline at end of file +end From 39e74a68ed765ce108ab74ea26830d9b1c01f514 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 18:42:56 -0500 Subject: [PATCH 48/53] Update src/consts/microsoftmpi.jl --- src/consts/microsoftmpi.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/consts/microsoftmpi.jl b/src/consts/microsoftmpi.jl index 3bed55ede..7245a5f64 100644 --- a/src/consts/microsoftmpi.jl +++ b/src/consts/microsoftmpi.jl @@ -31,7 +31,7 @@ end const MPI_Comm = UInt32 const MPI_Datatype = UInt32 const MPI_Errhandler = UInt32 -const MPI_File = UInt32 +const MPI_File = UInt const MPI_Group = UInt32 const MPI_Info = UInt32 const MPI_Message = UInt32 From d52e761a61b32504c3df7602f2f96b3d519ad1df Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 4 Mar 2022 18:48:19 -0500 Subject: [PATCH 49/53] downgrade MPIwrapper --- .github/workflows/UnitTests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index e2599649c..dbf2c5f0a 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -389,7 +389,7 @@ jobs: # - "1.7" # - "nightly" MPIWrapper: - - "2.7.0" + - "2.3.2" fail-fast: false @@ -458,7 +458,7 @@ jobs: # - "1.7" # - "nightly" MPIWrapper: - - "2.7.0" + - "2.3.2" fail-fast: false From 147deb0e18cbaffa920727a4b3fda84099688351 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Tue, 15 Mar 2022 12:16:58 -0700 Subject: [PATCH 50/53] Fix deprecated method in shared_win test --- test/test_shared_win.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_shared_win.jl b/test/test_shared_win.jl index cc68b5946..de2944df2 100644 --- a/test/test_shared_win.jl +++ b/test/test_shared_win.jl @@ -51,7 +51,7 @@ function main() @test all(shared_arr[:, 1] .== 1:100) @test all(shared_arr[:, 2] .== 901:1000) if node_rank <= 1 - len, elsize_bytes, baseptr = MPI.Win_shared_query(win, owner_rank) + len, elsize_bytes, baseptr = MPI.Win_shared_query(Ptr{Float32}, win, owner_rank) @test elsize_bytes == sizeof(Float32) @test len == sizeof(shared_arr) @test baseptr == pointer(shared_arr) From 23c2f7e1b8a604cfc86ba0df8ca70af5884dc23d Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Thu, 17 Mar 2022 15:11:00 -0700 Subject: [PATCH 51/53] add atomicity get and set to io_shared --- src/io.jl | 31 +++++++++++++++++++++++++++++++ test/test_io_shared.jl | 6 ++++++ 2 files changed, 37 insertions(+) diff --git a/src/io.jl b/src/io.jl index 5770207ed..dd858e17e 100644 --- a/src/io.jl +++ b/src/io.jl @@ -486,4 +486,35 @@ function get_position_shared(file::FileHandle) return r[] end +""" + MPI.File.get_atomicity(file::FileHandle) + +Get the consistency option for the `fh`. If `false` it is non-atomic. + +# External links +$(_doc_external("MPI_File_get_atomicity")) +""" +function get_atomicity(file::FileHandle) + r = Ref{Cint}() + # int MPI_File_get_atomicity(MPI_File fh, Int *flag) + @mpichk ccall((:MPI_File_get_atomicity, libmpi), Cint, + (MPI_File, Ptr{Cint}), file, r) + return r[] == 1 +end + +""" + MPI.File.set_atomicity(file::FileHandle, flag::Bool) + +Set the consitency option for the `fh`. + +# External links +$(_doc_external("MPI_File_get_atomicity")) +""" +function set_atomicity(file::FileHandle, flag::Bool) + # int MPI_File_set_atomicity(MPI_File fh, Int flag) + @mpichk ccall((:MPI_File_set_atomicity, libmpi), Cint, + (MPI_File, Cint), file, flag) + return nothing +end + end # module diff --git a/test/test_io_shared.jl b/test/test_io_shared.jl index e949c504f..621f020de 100644 --- a/test/test_io_shared.jl +++ b/test/test_io_shared.jl @@ -20,6 +20,12 @@ MPI.Barrier(comm) fh = MPI.File.open(comm, filename, read=true, write=true, create=true) @test MPI.File.get_position_shared(fh) == 0 +if !MPI.File.get_atomicity(fh) + MPI.File.set_atomicity(fh, true) +end + +@test MPI.File.get_atomicity(fh) + MPI.Barrier(comm) MPI.File.sync(fh) From 6e381209abd325b9e5ba6f2bdae2028045aedba0 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 17 Mar 2022 22:05:55 -0700 Subject: [PATCH 52/53] fix Homebrew Open MPI --- .github/workflows/UnitTests.yml | 1 + docs/src/knownissues.md | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/UnitTests.yml index 44e7b004f..02d2def3d 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/UnitTests.yml @@ -121,6 +121,7 @@ jobs: runs-on: macos-latest env: JULIA_MPI_TEST_BINARY: system + ZES_ENABLE_SYSMAN: 1 # https://github.com/open-mpi/ompi/issues/10142 steps: - name: Checkout diff --git a/docs/src/knownissues.md b/docs/src/knownissues.md index e09c33129..afabf6b08 100644 --- a/docs/src/knownissues.md +++ b/docs/src/knownissues.md @@ -34,6 +34,12 @@ This can be worked around be either: 2. Launching julia with the `--compiled-modules=no` option. This can result in much longer package load times. +## Open MPI + +### Segmentation fault + +When attempting to use a system-provided Open MPI implementation, you may encounter a segmentation fault. This can be fixed by setting the environment variable `ZES_ENABLE_SYSMAN=1`. See [Open MPI issue #10142](https://github.com/open-mpi/ompi/issues/10142). + ## UCX [UCX](https://www.openucx.org/) is a communication framework used by several MPI implementations. From 500b8111464a2ed491b7206d7dbc2f626fd436ff Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Wed, 6 Apr 2022 05:37:03 -0400 Subject: [PATCH 53/53] add compat to MPIPreferences --- lib/MPIPreferences/Project.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/MPIPreferences/Project.toml b/lib/MPIPreferences/Project.toml index bf8446e0b..5b8dab7b3 100644 --- a/lib/MPIPreferences/Project.toml +++ b/lib/MPIPreferences/Project.toml @@ -6,3 +6,7 @@ version = "0.1.0" [deps] Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Preferences = "21216c6a-2e73-6563-6e65-726566657250" + +[compat] +julia = "1.6" +Preferences = "1"