Skip to content

Commit

Permalink
drop Statistics dep; clean up imports/using
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Aug 5, 2024
1 parent 7be761e commit 3e32acc
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 35 deletions.
17 changes: 6 additions & 11 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,27 @@ authors = ["Erik Schnetter <[email protected]>"]
version = "3.2.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Hwloc_jll = "e33a78d0-f292-5ffc-b300-72abe9b543c8"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
# here for compatibility with older versions of Julia (that don't have extensions):
# https://pkgdocs.julialang.org/v1/creating-packages/#Transition-from-normal-dependency-to-extension
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

[weakdeps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

[extensions]
HwlocTrees = "AbstractTrees"

[compat]
AbstractTrees = "^0.4, ^0.3"
CEnum = "^0.4, ^0.5"
Hwloc_jll = "^2.8"
AbstractTrees = "^0.4, ^0.3"
julia = "^1.10"

[extras]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

[extensions]
# Conditional dependencies: https://pkgdocs.julialang.org/v1/creating-packages/#Conditional-loading-of-code-in-packages-(Extensions)
# Note: use a list for multiple extension dependencies
HwlocTrees = "AbstractTrees"

[targets]
test = ["Test", "CpuId", "AbstractTrees"]
3 changes: 2 additions & 1 deletion ext/HwlocTrees.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module HwlocTrees

using Hwloc, Printf
using Hwloc
using Printf: Printf, @sprintf
import AbstractTrees

mutable struct HwlocTreeNode{T}
Expand Down
1 change: 0 additions & 1 deletion src/Hwloc.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Hwloc
using Hwloc_jll
using Statistics

import Base: show, IteratorSize, IteratorEltype, isempty, eltype, iterate

Expand Down
4 changes: 2 additions & 2 deletions src/libhwloc.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module LibHwloc

using Hwloc_jll
using Hwloc_jll: Hwloc_jll, libhwloc
export Hwloc_jll

using CEnum
using CEnum: CEnum, @cenum

const __pid_t = Cint

Expand Down
4 changes: 1 addition & 3 deletions src/libhwloc_extensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module LibHwlocExtensions

using ..LibHwloc: libhwloc

using CEnum

function hwloc_pci_class_string(class_id)
val = ccall(
(:hwloc_pci_class_string, libhwloc),
Expand All @@ -14,4 +12,4 @@ function hwloc_pci_class_string(class_id)
return unsafe_string(val)
end

end
end
27 changes: 11 additions & 16 deletions src/lowlevel_api.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
using ..LibHwloc:
hwloc_cpuset_t, hwloc_nodeset_t, hwloc_obj_type_t, hwloc_obj_cache_type_t,
hwloc_obj_bridge_type_t, hwloc_obj_osdev_type_t, hwloc_distances_s,
hwloc_obj, hwloc_obj_t, hwloc_obj_attr_u, hwloc_cache_attr_s,
hwloc_group_attr_s, hwloc_bridge_attr_s, hwloc_pcidev_attr_s,
hwloc_osdev_attr_s, hwloc_topology_t, hwloc_topology_init,
hwloc_topology_load, hwloc_topology_get_depth, hwloc_get_nbobjs_by_depth,
hwloc_get_obj_by_depth, hwloc_topology_destroy, hwloc_type_filter_e,
hwloc_topology_set_type_filter, hwloc_topology_get_type_filter,
hwloc_topology_set_all_types_filter, hwloc_topology_set_cache_types_filter,
hwloc_topology_set_icache_types_filter, hwloc_topology_set_io_types_filter,
hwloc_topology_set_userdata, hwloc_topology_get_userdata, var"##Ctag#349",
var"##Ctag#350", hwloc_cpukinds_get_nr, hwloc_bitmap_alloc, hwloc_bitmap_alloc_full,
hwloc_bitmap_free, hwloc_cpukinds_get_by_cpuset, hwloc_bitmap_from_ulong,
hwloc_cpukinds_get_info, hwloc_info_s, hwloc_bitmap_nr_ulongs,
hwloc_bitmap_to_ulongs, hwloc_topology_set_flags
hwloc_obj_type_t, hwloc_obj_cache_type_t, hwloc_obj_bridge_type_t,
hwloc_obj_osdev_type_t, hwloc_obj_t, hwloc_obj_attr_u, hwloc_cache_attr_s,
hwloc_group_attr_s, hwloc_bridge_attr_s, hwloc_pcidev_attr_s, hwloc_topology_t,
hwloc_topology_init, hwloc_topology_load, hwloc_topology_get_depth,
hwloc_get_nbobjs_by_depth, hwloc_get_obj_by_depth, hwloc_topology_destroy,
hwloc_type_filter_e, hwloc_topology_get_type_filter,
hwloc_topology_set_io_types_filter, var"##Ctag#349", var"##Ctag#350",
hwloc_cpukinds_get_nr, hwloc_bitmap_alloc, hwloc_bitmap_alloc_full, hwloc_bitmap_free,
hwloc_cpukinds_get_info, hwloc_info_s, hwloc_bitmap_nr_ulongs, hwloc_bitmap_to_ulongs,
hwloc_topology_set_flags

using ..LibHwlocExtensions:
hwloc_pci_class_string
Expand Down Expand Up @@ -374,7 +369,7 @@ function ith_in_mask(mask::Culong, i::Integer)
return !iszero(mask & imask)
end

count_set_bits(mask::Culong) = count(i -> ith_in_mask(mask, i), 0:(sizeof(Culong) * 8 - 1))
count_set_bits(mask::Culong) = count(i -> ith_in_mask(mask, i), 0:(sizeof(Culong)*8-1))
count_set_bits(masks::Vector{Culong}) = sum(count_set_bits.(masks))

struct HwlocInfo
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Hwloc
using Test
using Statistics
import CpuId

@testset "Hwloc.jl" begin
Expand Down

0 comments on commit 3e32acc

Please sign in to comment.