Skip to content

BTL/SM component frag header confusion #13404

@TroyMitchell911

Description

@TroyMitchell911

When initializing the free_list, the payload_buffer_size is:
mca_btl_sm_component.max_inline_send + sizeof(mca_btl_sm_frag_t)

In the init function, base.super.ptr(item->ptr) is assigned as payload_ptr:

// in opal_free_list.c
/* allocate the rest from the mpool (or use memalign/malloc) */
payload_ptr = (unsigned char *) flist->fl_mpool->mpool_alloc(flist->fl_mpool,
                                                             buffer_size,
                                                             align, 0);
item->ptr = payload_ptr;

So the memory layout looks like this:
+-----------------------------+
| struct btl_sm_frag | <- base.super.ptr
| ... |
+-----------------------------+
| max_inline_send_size bytes |
| (payload buffer) |
| ... |
+-----------------------------+
In the frag_constructor function:

frag->hdr = (mca_btl_sm_hdr_t *) frag->base.super.ptr;

So hdr directly points to base.super.ptr(this memory size is sizeof(struct mca_btl_sm_frag _t)?
Then why, during init, is it not + sizeof(struct mca_btl_sm_hdr_t)?

If I'm wrong, please let me know.

Best regards,
Troy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions