📄 mpid_datatype.tex
字号:
\startmanpage\mantitle{MPID{\tt \char`\_}Datatype}{tex}{10/7/2002}\manname{MPID{\tt \char`\_}Datatype}--- Description of the MPID Datatype structure \subhead{Synopsis}\startvb\begin{verbatim}typedef struct { int handle; /* value of MPI_Datatype for this structure */ volatile int ref_count; int is_contig; /* True if data is contiguous (even with a (count,datatype) pair) */ MPID_Dataloop loopinfo; /* Describes the arguments that the user provided for creating the datatype; these are used to implement the MPI-2 MPI_Type_get_contents functions */ int size; MPI_Aint extent; /* MPI-2 allows a type to created by resizing (the extent of) an existing type. Note that the extent of the datatype may be different from the extent information in loopinfo */ /* The remaining fields are required but less frequently used, and are placed after the more commonly used fields */ int has_sticky_ub; /* The MPI_UB and MPI_LB are sticky */ int has_sticky_lb; int is_permanent; /* e.g., MPI_DOUBLE*/ int is_committed; /* See MPID_Datatype_commit */ int loopinfo_depth; /* Depth of dataloop stack needed to process this datatype. This information is used to ensure that no datatype is constructed that cannot be processed (see MPID_Segment) */ MPI_Aint ub, lb, /* MPI-1 upper and lower bounds */ true_ub, true_lb; /* MPI-2 true upper and lower bounds */ MPID_List attributes; /* MPI-2 adds datatype attributes */ int32_t cache_id; /* These are used to track which processes */ MPID_Lpidmask mask; /* have cached values of this datatype */ char name[MPI_MAX_OBJECT_NAME]; /* Required for MPI-2 */ /* other, device-specific information */} MPID_Datatype;\end{verbatim}\endvb\subhead{Notes}The {\tt ref{\tt \char`\_}count} is needed for nonblocking operations such as\begin{verbatim} MPI_Type_struct( ... , &newtype ); MPI_Irecv( buf, 1000, newtype, ..., &request ); MPI_Type_free( &newtype ); ... MPI_Wait( &request, &status );\end{verbatim}\par\subhead{Module}Datatype-DS\par\subhead{Notes}\par\subhead{Alternatives}The following alternatives for the layout of this structure were considered.Most were not chosen because any benefit in performance or memoryefficiency was outweighed by the added complexity of the implementation.\parA number of fields contain only boolean inforation ({\tt is{\tt \char`\_}contig},{\tt has{\tt \char`\_}sticky{\tt \char`\_}ub}, {\tt has{\tt \char`\_}sticky{\tt \char`\_}lb}, {\tt is{\tt \char`\_}permanent}, {\tt is{\tt \char`\_}committed}). Thesecould be combined and stored in a single bit vector.\par{\tt MPI{\tt \char`\_}Type{\tt \char`\_}dup} could be implemented with a shallow copy, where most of thedata fields, particularly the {\tt opt{\tt \char`\_}dataloop} field, would not be copied intothe new object created by {\tt MPI{\tt \char`\_}Type{\tt \char`\_}dup}; instead, the new object couldpoint to the data fields in the old object. However, this requiresmore code to make sure that fields are found in the correct objects and thatdeleting the old object doesn{\tt t invalidate the dup}ed datatype.\parA related optimization would point to the {\tt opt{\tt \char`\_}dataloop} and {\tt dataloop}fields in other datatypes. This has the same problems as the shallowcopy implementation.\parIn addition to the separate {\tt dataloop} and {\tt opt{\tt \char`\_}dataloop} fields, we couldin addition have a separate {\tt hetero{\tt \char`\_}dataloop} optimized for heterogeneouscommunication for systems with different data representations.\parEarlier versions of the ADI used a single API to change the {\tt ref{\tt \char`\_}count},with each MPI object type having a separate routine. Since referencecount changes are always up or down one, and since all MPI objectsare defined to have the {\tt ref{\tt \char`\_}count} field in the same place, the currentADI3 API uses two routines, {\tt MPIU{\tt \char`\_}Object{\tt \char`\_}add{\tt \char`\_}ref} and{\tt MPIU{\tt \char`\_}Object{\tt \char`\_}release{\tt \char`\_}ref}, to increment and decrement the reference count.\par\endmanpage
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -