Class hwloc_obj

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class hwloc_obj extends Struct<hwloc_obj> implements NativeResource

 struct hwloc_obj {
     hwloc_obj_type_t type;
     char * subtype;
     unsigned os_index;
     char * name;
     hwloc_uint64_t total_memory;
     {@link hwloc_obj_attr_u struct hwloc_obj_attr_u} * attr;
     int depth;
     unsigned logical_index;
     {@link hwloc_obj struct hwloc_obj} * next_cousin;
     {@link hwloc_obj struct hwloc_obj} * prev_cousin;
     {@link hwloc_obj struct hwloc_obj} * parent;
     unsigned sibling_rank;
     {@link hwloc_obj struct hwloc_obj} * next_sibling;
     {@link hwloc_obj struct hwloc_obj} * prev_sibling;
     unsigned arity;
     {@link hwloc_obj struct hwloc_obj} ** children;
     {@link hwloc_obj struct hwloc_obj} * first_child;
     {@link hwloc_obj struct hwloc_obj} * last_child;
     int symmetric_subtree;
     unsigned memory_arity;
     {@link hwloc_obj struct hwloc_obj} * memory_first_child;
     unsigned io_arity;
     {@link hwloc_obj struct hwloc_obj} * io_first_child;
     unsigned misc_arity;
     {@link hwloc_obj struct hwloc_obj} * misc_first_child;
     hwloc_cpuset_t cpuset;
     hwloc_cpuset_t complete_cpuset;
     hwloc_nodeset_t nodeset;
     hwloc_nodeset_t complete_nodeset;
     {@link hwloc_infos_s struct hwloc_infos_s} infos;
     void * userdata;
     hwloc_uint64_t gp_index;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • SUBTYPE

      public static final int SUBTYPE
      The struct member offsets.
    • OS_INDEX

      public static final int OS_INDEX
      The struct member offsets.
    • NAME

      public static final int NAME
      The struct member offsets.
    • TOTAL_MEMORY

      public static final int TOTAL_MEMORY
      The struct member offsets.
    • ATTR

      public static final int ATTR
      The struct member offsets.
    • DEPTH

      public static final int DEPTH
      The struct member offsets.
    • LOGICAL_INDEX

      public static final int LOGICAL_INDEX
      The struct member offsets.
    • NEXT_COUSIN

      public static final int NEXT_COUSIN
      The struct member offsets.
    • PREV_COUSIN

      public static final int PREV_COUSIN
      The struct member offsets.
    • PARENT

      public static final int PARENT
      The struct member offsets.
    • SIBLING_RANK

      public static final int SIBLING_RANK
      The struct member offsets.
    • NEXT_SIBLING

      public static final int NEXT_SIBLING
      The struct member offsets.
    • PREV_SIBLING

      public static final int PREV_SIBLING
      The struct member offsets.
    • ARITY

      public static final int ARITY
      The struct member offsets.
    • CHILDREN

      public static final int CHILDREN
      The struct member offsets.
    • FIRST_CHILD

      public static final int FIRST_CHILD
      The struct member offsets.
    • LAST_CHILD

      public static final int LAST_CHILD
      The struct member offsets.
    • SYMMETRIC_SUBTREE

      public static final int SYMMETRIC_SUBTREE
      The struct member offsets.
    • MEMORY_ARITY

      public static final int MEMORY_ARITY
      The struct member offsets.
    • MEMORY_FIRST_CHILD

      public static final int MEMORY_FIRST_CHILD
      The struct member offsets.
    • IO_ARITY

      public static final int IO_ARITY
      The struct member offsets.
    • IO_FIRST_CHILD

      public static final int IO_FIRST_CHILD
      The struct member offsets.
    • MISC_ARITY

      public static final int MISC_ARITY
      The struct member offsets.
    • MISC_FIRST_CHILD

      public static final int MISC_FIRST_CHILD
      The struct member offsets.
    • CPUSET

      public static final int CPUSET
      The struct member offsets.
    • COMPLETE_CPUSET

      public static final int COMPLETE_CPUSET
      The struct member offsets.
    • NODESET

      public static final int NODESET
      The struct member offsets.
    • COMPLETE_NODESET

      public static final int COMPLETE_NODESET
      The struct member offsets.
    • INFOS

      public static final int INFOS
      The struct member offsets.
    • USERDATA

      public static final int USERDATA
      The struct member offsets.
    • GP_INDEX

      public static final int GP_INDEX
      The struct member offsets.
  • Constructor Details

    • hwloc_obj

      public hwloc_obj(ByteBuffer container)
      Creates a hwloc_obj instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<hwloc_obj>
    • type

      public int type()
      Returns:
      the value of the type field.
    • subtype

      public ByteBuffer subtype()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the subtype field.
    • subtypeString

      public String subtypeString()
      Returns:
      the null-terminated string pointed to by the subtype field.
    • os_index

      public int os_index()
      Returns:
      the value of the os_index field.
    • name

      public @Nullable ByteBuffer name()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the name field.
    • nameString

      public @Nullable String nameString()
      Returns:
      the null-terminated string pointed to by the name field.
    • total_memory

      public long total_memory()
      Returns:
      the value of the total_memory field.
    • attr

      public hwloc_obj_attr_u attr()
      Returns:
      a hwloc_obj_attr_u view of the struct pointed to by the attr field.
    • depth

      public int depth()
      Returns:
      the value of the depth field.
    • logical_index

      public int logical_index()
      Returns:
      the value of the logical_index field.
    • next_cousin

      public @Nullable hwloc_obj next_cousin()
      Returns:
      a hwloc_obj view of the struct pointed to by the next_cousin field.
    • prev_cousin

      public @Nullable hwloc_obj prev_cousin()
      Returns:
      a hwloc_obj view of the struct pointed to by the prev_cousin field.
    • parent

      public @Nullable hwloc_obj parent()
      Returns:
      a hwloc_obj view of the struct pointed to by the parent field.
    • sibling_rank

      public int sibling_rank()
      Returns:
      the value of the sibling_rank field.
    • next_sibling

      public @Nullable hwloc_obj next_sibling()
      Returns:
      a hwloc_obj view of the struct pointed to by the next_sibling field.
    • prev_sibling

      public @Nullable hwloc_obj prev_sibling()
      Returns:
      a hwloc_obj view of the struct pointed to by the prev_sibling field.
    • arity

      public int arity()
      Returns:
      the value of the arity field.
    • children

      public @Nullable PointerBuffer children()
      Returns:
      a PointerBuffer view of the data pointed to by the children field.
    • first_child

      public @Nullable hwloc_obj first_child()
      Returns:
      a hwloc_obj view of the struct pointed to by the first_child field.
    • last_child

      public @Nullable hwloc_obj last_child()
      Returns:
      a hwloc_obj view of the struct pointed to by the last_child field.
    • symmetric_subtree

      public boolean symmetric_subtree()
      Returns:
      the value of the symmetric_subtree field.
    • memory_arity

      public int memory_arity()
      Returns:
      the value of the memory_arity field.
    • memory_first_child

      public @Nullable hwloc_obj memory_first_child()
      Returns:
      a hwloc_obj view of the struct pointed to by the memory_first_child field.
    • io_arity

      public int io_arity()
      Returns:
      the value of the io_arity field.
    • io_first_child

      public @Nullable hwloc_obj io_first_child()
      Returns:
      a hwloc_obj view of the struct pointed to by the io_first_child field.
    • misc_arity

      public int misc_arity()
      Returns:
      the value of the misc_arity field.
    • misc_first_child

      public @Nullable hwloc_obj misc_first_child()
      Returns:
      a hwloc_obj view of the struct pointed to by the misc_first_child field.
    • cpuset

      public long cpuset()
      Returns:
      the value of the cpuset field.
    • complete_cpuset

      public long complete_cpuset()
      Returns:
      the value of the complete_cpuset field.
    • nodeset

      public long nodeset()
      Returns:
      the value of the nodeset field.
    • complete_nodeset

      public long complete_nodeset()
      Returns:
      the value of the complete_nodeset field.
    • infos

      public hwloc_infos_s infos()
      Returns:
      a hwloc_infos_s view of the infos field.
    • userdata

      public long userdata()
      Returns:
      the value of the userdata field.
    • gp_index

      public long gp_index()
      Returns:
      the value of the gp_index field.
    • userdata

      public hwloc_obj userdata(long value)
      Sets the specified value to the userdata field.
    • set

      public hwloc_obj set(hwloc_obj src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static hwloc_obj malloc()
      Returns a new hwloc_obj instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static hwloc_obj calloc()
      Returns a new hwloc_obj instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static hwloc_obj create()
      Returns a new hwloc_obj instance allocated with BufferUtils.
    • create

      public static hwloc_obj create(long address)
      Returns a new hwloc_obj instance for the specified memory address.
    • createSafe

      public static @Nullable hwloc_obj createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static hwloc_obj.Buffer malloc(int capacity)
      Returns a new hwloc_obj.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static hwloc_obj.Buffer calloc(int capacity)
      Returns a new hwloc_obj.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static hwloc_obj.Buffer create(int capacity)
      Returns a new hwloc_obj.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static hwloc_obj.Buffer create(long address, int capacity)
      Create a hwloc_obj.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable hwloc_obj.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static hwloc_obj malloc(MemoryStack stack)
      Returns a new hwloc_obj instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static hwloc_obj calloc(MemoryStack stack)
      Returns a new hwloc_obj instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static hwloc_obj.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new hwloc_obj.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static hwloc_obj.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new hwloc_obj.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nsubtype

      public static ByteBuffer nsubtype(long struct)
      Unsafe version of subtype().
    • nsubtypeString

      public static String nsubtypeString(long struct)
      Unsafe version of subtypeString().
    • nos_index

      public static int nos_index(long struct)
      Unsafe version of os_index().
    • nname

      public static @Nullable ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static @Nullable String nnameString(long struct)
      Unsafe version of nameString().
    • ntotal_memory

      public static long ntotal_memory(long struct)
      Unsafe version of total_memory().
    • nattr

      public static hwloc_obj_attr_u nattr(long struct)
      Unsafe version of attr().
    • ndepth

      public static int ndepth(long struct)
      Unsafe version of depth().
    • nlogical_index

      public static int nlogical_index(long struct)
      Unsafe version of logical_index().
    • nnext_cousin

      public static @Nullable hwloc_obj nnext_cousin(long struct)
      Unsafe version of next_cousin().
    • nprev_cousin

      public static @Nullable hwloc_obj nprev_cousin(long struct)
      Unsafe version of prev_cousin().
    • nparent

      public static @Nullable hwloc_obj nparent(long struct)
      Unsafe version of parent().
    • nsibling_rank

      public static int nsibling_rank(long struct)
      Unsafe version of sibling_rank().
    • nnext_sibling

      public static @Nullable hwloc_obj nnext_sibling(long struct)
      Unsafe version of next_sibling().
    • nprev_sibling

      public static @Nullable hwloc_obj nprev_sibling(long struct)
      Unsafe version of prev_sibling().
    • narity

      public static int narity(long struct)
      Unsafe version of arity().
    • nchildren

      public static @Nullable PointerBuffer nchildren(long struct)
      Unsafe version of children.
    • nfirst_child

      public static @Nullable hwloc_obj nfirst_child(long struct)
      Unsafe version of first_child().
    • nlast_child

      public static @Nullable hwloc_obj nlast_child(long struct)
      Unsafe version of last_child().
    • nsymmetric_subtree

      public static int nsymmetric_subtree(long struct)
      Unsafe version of symmetric_subtree().
    • nmemory_arity

      public static int nmemory_arity(long struct)
      Unsafe version of memory_arity().
    • nmemory_first_child

      public static @Nullable hwloc_obj nmemory_first_child(long struct)
      Unsafe version of memory_first_child().
    • nio_arity

      public static int nio_arity(long struct)
      Unsafe version of io_arity().
    • nio_first_child

      public static @Nullable hwloc_obj nio_first_child(long struct)
      Unsafe version of io_first_child().
    • nmisc_arity

      public static int nmisc_arity(long struct)
      Unsafe version of misc_arity().
    • nmisc_first_child

      public static @Nullable hwloc_obj nmisc_first_child(long struct)
      Unsafe version of misc_first_child().
    • ncpuset

      public static long ncpuset(long struct)
      Unsafe version of cpuset().
    • ncomplete_cpuset

      public static long ncomplete_cpuset(long struct)
      Unsafe version of complete_cpuset().
    • nnodeset

      public static long nnodeset(long struct)
      Unsafe version of nodeset().
    • ncomplete_nodeset

      public static long ncomplete_nodeset(long struct)
      Unsafe version of complete_nodeset().
    • ninfos

      public static hwloc_infos_s ninfos(long struct)
      Unsafe version of infos().
    • nuserdata

      public static long nuserdata(long struct)
      Unsafe version of userdata().
    • ngp_index

      public static long ngp_index(long struct)
      Unsafe version of gp_index().
    • nuserdata

      public static void nuserdata(long struct, long value)
      Unsafe version of userdata.