2004-09-04 02:34:52 +04:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-09-04 02:34:52 +04:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
2004-10-20 05:03:09 +04:00
|
|
|
#include "ompi_config.h"
|
2005-12-11 00:54:12 +03:00
|
|
|
#ifdef HAVE_SYS_TYPES_H
|
2004-09-04 02:34:52 +04:00
|
|
|
#include <sys/types.h>
|
2005-12-11 00:54:12 +03:00
|
|
|
#endif /* HAVE_SYS_TYPES_H */
|
2004-09-04 02:34:52 +04:00
|
|
|
#include "ptl_sm.h"
|
|
|
|
#include "ptl_sm_frag.h"
|
2004-09-16 19:40:24 +04:00
|
|
|
#include "ptl_sm_address.h"
|
2004-09-04 02:34:52 +04:00
|
|
|
|
|
|
|
|
2004-09-13 19:24:34 +04:00
|
|
|
static void mca_ptl_sm_first_frag_construct(mca_ptl_sm_frag_t* frag);
|
|
|
|
static void mca_ptl_sm_first_frag_destruct(mca_ptl_sm_frag_t* frag);
|
|
|
|
static void mca_ptl_sm_second_frag_construct(mca_ptl_sm_frag_t* frag);
|
|
|
|
static void mca_ptl_sm_second_frag_destruct(mca_ptl_sm_frag_t* frag);
|
2004-09-04 02:34:52 +04:00
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_ptl_sm_frag_t,
|
|
|
|
mca_ptl_base_recv_frag_t,
|
2004-09-13 19:24:34 +04:00
|
|
|
mca_ptl_sm_first_frag_construct,
|
|
|
|
mca_ptl_sm_first_frag_destruct
|
|
|
|
);
|
|
|
|
|
|
|
|
OBJ_CLASS_INSTANCE(
|
|
|
|
mca_ptl_sm_second_frag_t,
|
|
|
|
mca_ptl_base_recv_frag_t,
|
|
|
|
mca_ptl_sm_second_frag_construct,
|
|
|
|
mca_ptl_sm_second_frag_destruct
|
2004-09-04 02:34:52 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* shared memory recv fragment constructor
|
|
|
|
*/
|
|
|
|
|
2004-09-13 19:24:34 +04:00
|
|
|
static void mca_ptl_sm_first_frag_construct(mca_ptl_sm_frag_t* frag)
|
2004-09-04 02:34:52 +04:00
|
|
|
{
|
|
|
|
char *ptr;
|
|
|
|
|
|
|
|
/* set the buffer length */
|
2004-09-13 17:52:43 +04:00
|
|
|
frag->buff_length=(size_t)mca_ptl_sm_component.first_fragment_size;
|
2004-10-19 03:24:53 +04:00
|
|
|
|
|
|
|
/* set local rank */
|
|
|
|
frag->queue_index=mca_ptl_sm_component.my_smp_rank;
|
2004-09-04 02:34:52 +04:00
|
|
|
|
2004-10-25 22:02:46 +04:00
|
|
|
/* set pointer to the sending ptl */
|
|
|
|
frag->send_ptl=(mca_ptl_base_module_t *)(&mca_ptl_sm);
|
|
|
|
|
2004-09-04 02:34:52 +04:00
|
|
|
/* set buffer pointer */
|
|
|
|
ptr=((char *)frag)+sizeof(mca_ptl_sm_frag_t)+
|
|
|
|
mca_ptl_sm_component.fragment_alignment;
|
|
|
|
/* align */
|
|
|
|
ptr=ptr-(((size_t)ptr)%(mca_ptl_sm_component.fragment_alignment));
|
2004-09-16 19:40:24 +04:00
|
|
|
frag->buff=ptr;
|
2004-09-04 02:34:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* shared memory recv fragment destructor
|
|
|
|
*/
|
|
|
|
|
2004-09-13 19:24:34 +04:00
|
|
|
static void mca_ptl_sm_first_frag_destruct(mca_ptl_sm_frag_t* frag)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* shared memory second and above fragments
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void mca_ptl_sm_second_frag_construct(mca_ptl_sm_frag_t* frag)
|
|
|
|
{
|
|
|
|
char *ptr;
|
|
|
|
|
|
|
|
/* set the buffer length */
|
|
|
|
frag->buff_length=(size_t)mca_ptl_sm_component.max_fragment_size;
|
|
|
|
|
2004-10-19 03:24:53 +04:00
|
|
|
/* set local rank */
|
|
|
|
frag->queue_index=mca_ptl_sm_component.my_smp_rank;
|
|
|
|
|
2004-10-25 22:02:46 +04:00
|
|
|
/* set pointer to the sending ptl */
|
|
|
|
frag->send_ptl=(mca_ptl_base_module_t *)(&mca_ptl_sm);
|
|
|
|
|
2004-09-13 19:24:34 +04:00
|
|
|
/* set buffer pointer */
|
|
|
|
ptr=((char *)frag)+sizeof(mca_ptl_sm_frag_t)+
|
|
|
|
mca_ptl_sm_component.fragment_alignment;
|
|
|
|
/* align */
|
|
|
|
ptr=ptr-(((size_t)ptr)%(mca_ptl_sm_component.fragment_alignment));
|
2004-09-16 19:40:24 +04:00
|
|
|
frag->buff=ptr;
|
2004-09-13 19:24:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* shared memory second and above fragments
|
|
|
|
*/
|
|
|
|
|
|
|
|
static void mca_ptl_sm_second_frag_destruct(mca_ptl_sm_frag_t* frag)
|
2004-09-04 02:34:52 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|