1
1

Shift the architecture calculation from the ompi/datatype engine to the opal/util area. This allows us to compute the architecture earlier in the launch and communicate it outside of the modex.

Note: this is an early preliminary step in the movement of portions of the datatype engine to the opal layer.

This commit was SVN r18198.
Этот коммит содержится в:
Ralph Castain 2008-04-17 20:43:56 +00:00
родитель 01148b77dc
Коммит fa082cafa9
21 изменённых файлов: 169 добавлений и 151 удалений

Просмотреть файл

@ -27,7 +27,6 @@ headers = \
datatype_unpack.h \ datatype_unpack.h \
datatype_checksum.h \ datatype_checksum.h \
datatype_memcpy.h \ datatype_memcpy.h \
dt_arch.h \
convertor.h \ convertor.h \
convertor_internal.h convertor_internal.h
@ -54,7 +53,6 @@ libdatatype_la_SOURCES = \
dt_sndrcv.c \ dt_sndrcv.c \
fake_stack.c \ fake_stack.c \
dt_args.c \ dt_args.c \
dt_arch.c \
dt_copy.c \ dt_copy.c \
dt_external32.c \ dt_external32.c \
dt_match_size.c \ dt_match_size.c \

Просмотреть файл

@ -27,6 +27,7 @@
#include <stdio.h> #include <stdio.h>
#include "opal/prefetch.h" #include "opal/prefetch.h"
#include "opal/util/arch.h"
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/convertor.h" #include "ompi/datatype/convertor.h"
@ -34,7 +35,6 @@
#include "ompi/datatype/datatype_checksum.h" #include "ompi/datatype/datatype_checksum.h"
#include "ompi/datatype/datatype_prototypes.h" #include "ompi/datatype/datatype_prototypes.h"
#include "ompi/datatype/convertor_internal.h" #include "ompi/datatype/convertor_internal.h"
#include "ompi/datatype/dt_arch.h"
extern size_t ompi_ddt_local_sizes[DT_MAX_PREDEFINED]; extern size_t ompi_ddt_local_sizes[DT_MAX_PREDEFINED];
extern int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* convertor, extern int ompi_convertor_create_stack_with_pos_general( ompi_convertor_t* convertor,
@ -123,18 +123,18 @@ ompi_convertor_find_or_create_master( uint32_t remote_arch )
} }
/* Find out the remote bool size */ /* Find out the remote bool size */
if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_BOOLIS8 ) ) { if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_BOOLIS8 ) ) {
remote_sizes[DT_CXX_BOOL] = 1; remote_sizes[DT_CXX_BOOL] = 1;
} else if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_BOOLIS16 ) ) { } else if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_BOOLIS16 ) ) {
remote_sizes[DT_CXX_BOOL] = 2; remote_sizes[DT_CXX_BOOL] = 2;
} else if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_BOOLIS32 ) ) { } else if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_BOOLIS32 ) ) {
remote_sizes[DT_CXX_BOOL] = 4; remote_sizes[DT_CXX_BOOL] = 4;
} else { } else {
opal_output( 0, "Unknown sizeof(bool) for the remote architecture\n" ); opal_output( 0, "Unknown sizeof(bool) for the remote architecture\n" );
} }
/* check the length of the long */ /* check the length of the long */
if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_LONGIS64 ) ) { if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_LONGIS64 ) ) {
remote_sizes[DT_LONG] = 8; remote_sizes[DT_LONG] = 8;
remote_sizes[DT_UNSIGNED_LONG] = 8; remote_sizes[DT_UNSIGNED_LONG] = 8;
remote_sizes[DT_LONG_LONG_INT] = 8; remote_sizes[DT_LONG_LONG_INT] = 8;
@ -144,11 +144,11 @@ ompi_convertor_find_or_create_master( uint32_t remote_arch )
* unknown (if Fortran is not supported on the remote library). If this is * unknown (if Fortran is not supported on the remote library). If this is
* the case, just let the remote logical size to match the local size. * the case, just let the remote logical size to match the local size.
*/ */
if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_LOGICALIS8 ) ) { if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_LOGICALIS8 ) ) {
remote_sizes[DT_LOGIC] = 1; remote_sizes[DT_LOGIC] = 1;
} else if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_LOGICALIS16 ) ) { } else if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_LOGICALIS16 ) ) {
remote_sizes[DT_LOGIC] = 2; remote_sizes[DT_LOGIC] = 2;
} else if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_LOGICALIS32 ) ) { } else if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_LOGICALIS32 ) ) {
remote_sizes[DT_LOGIC] = 4; remote_sizes[DT_LOGIC] = 4;
} else { } else {
opal_output( 0, "Unknown sizeof(fortran logical) for the remote architecture\n" ); opal_output( 0, "Unknown sizeof(fortran logical) for the remote architecture\n" );
@ -164,8 +164,8 @@ ompi_convertor_find_or_create_master( uint32_t remote_arch )
if( remote_sizes[i] != ompi_ddt_local_sizes[i] ) if( remote_sizes[i] != ompi_ddt_local_sizes[i] )
master->hetero_mask |= (((uint64_t)1) << i); master->hetero_mask |= (((uint64_t)1) << i);
} }
if( ompi_arch_checkmask( &master->remote_arch, OMPI_ARCH_ISBIGENDIAN ) != if( opal_arch_checkmask( &master->remote_arch, OPAL_ARCH_ISBIGENDIAN ) !=
ompi_arch_checkmask( &ompi_mpi_local_arch, OMPI_ARCH_ISBIGENDIAN ) ) { opal_arch_checkmask( &ompi_mpi_local_arch, OPAL_ARCH_ISBIGENDIAN ) ) {
uint64_t hetero_mask = 0; uint64_t hetero_mask = 0;
for( i = DT_CHAR; i < DT_MAX_PREDEFINED; i++ ) { for( i = DT_CHAR; i < DT_MAX_PREDEFINED; i++ ) {

Просмотреть файл

@ -13,9 +13,9 @@
#include "ompi_config.h" #include "ompi_config.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/arch.h"
#include "opal/types.h" #include "opal/types.h"
#include "ompi/datatype/dt_arch.h"
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/convertor.h" #include "ompi/datatype/convertor.h"
#include "ompi/datatype/datatype_internal.h" #include "ompi/datatype/datatype_internal.h"
@ -47,8 +47,8 @@ copy_##TYPENAME##_heterogeneous(ompi_convertor_t *pConvertor, uint32_t count,
from, from_len, from_extent, \ from, from_len, from_extent, \
to, to_length, to_extent); \ to, to_length, to_extent); \
\ \
if ((pConvertor->remoteArch & OMPI_ARCH_ISBIGENDIAN) != \ if ((pConvertor->remoteArch & OPAL_ARCH_ISBIGENDIAN) != \
(ompi_mpi_local_arch & OMPI_ARCH_ISBIGENDIAN)) { \ (ompi_mpi_local_arch & OPAL_ARCH_ISBIGENDIAN)) { \
for( i = 0; i < count; i++ ) { \ for( i = 0; i < count; i++ ) { \
ompi_dt_swap_bytes(to, from, sizeof(TYPE)); \ ompi_dt_swap_bytes(to, from, sizeof(TYPE)); \
to += to_extent; \ to += to_extent; \
@ -84,8 +84,8 @@ copy_##TYPENAME##_heterogeneous(ompi_convertor_t *pConvertor, uint32_t count, \
from, from_len, from_extent, \ from, from_len, from_extent, \
to, to_length, to_extent); \ to, to_length, to_extent); \
\ \
if ((pConvertor->remoteArch & OMPI_ARCH_ISBIGENDIAN) != \ if ((pConvertor->remoteArch & OPAL_ARCH_ISBIGENDIAN) != \
(ompi_mpi_local_arch & OMPI_ARCH_ISBIGENDIAN)) { \ (ompi_mpi_local_arch & OPAL_ARCH_ISBIGENDIAN)) { \
/* source and destination are different endianness */ \ /* source and destination are different endianness */ \
for( i = 0; i < count; i++ ) { \ for( i = 0; i < count; i++ ) { \
TYPE1* to_1, *from_1; \ TYPE1* to_1, *from_1; \
@ -131,8 +131,8 @@ copy_2complex_##TYPENAME##_heterogeneous(ompi_convertor_t *pConvertor, uint32_t
from, from_len, from_extent, \ from, from_len, from_extent, \
to, to_length, to_extent); \ to, to_length, to_extent); \
\ \
if ((pConvertor->remoteArch & OMPI_ARCH_ISBIGENDIAN) != \ if ((pConvertor->remoteArch & OPAL_ARCH_ISBIGENDIAN) != \
(ompi_mpi_local_arch & OMPI_ARCH_ISBIGENDIAN)) { \ (ompi_mpi_local_arch & OPAL_ARCH_ISBIGENDIAN)) { \
/* source and destination are different endianness */ \ /* source and destination are different endianness */ \
for( i = 0; i < count; i++ ) { \ for( i = 0; i < count; i++ ) { \
TYPE *to_p = (TYPE*) to, *from_p = (TYPE*) from; \ TYPE *to_p = (TYPE*) to, *from_p = (TYPE*) from; \
@ -228,16 +228,16 @@ copy_cxx_bool_heterogeneous(ompi_convertor_t *pConvertor, uint32_t count,
uint32_t i; uint32_t i;
/* fix up the from extent */ /* fix up the from extent */
if ((pConvertor->remoteArch & OMPI_ARCH_BOOLISxx) != if ((pConvertor->remoteArch & OPAL_ARCH_BOOLISxx) !=
(ompi_mpi_local_arch & OMPI_ARCH_BOOLISxx)) { (ompi_mpi_local_arch & OPAL_ARCH_BOOLISxx)) {
switch (pConvertor->remoteArch & OMPI_ARCH_BOOLISxx) { switch (pConvertor->remoteArch & OPAL_ARCH_BOOLISxx) {
case OMPI_ARCH_BOOLIS8: case OPAL_ARCH_BOOLIS8:
from_extent = 1; from_extent = 1;
break; break;
case OMPI_ARCH_BOOLIS16: case OPAL_ARCH_BOOLIS16:
from_extent = 2; from_extent = 2;
break; break;
case OMPI_ARCH_BOOLIS32: case OPAL_ARCH_BOOLIS32:
from_extent = 4; from_extent = 4;
break; break;
} }
@ -248,16 +248,16 @@ copy_cxx_bool_heterogeneous(ompi_convertor_t *pConvertor, uint32_t count,
to, to_length, to_extent); to, to_length, to_extent);
if ((to_extent != sizeof(bool) || from_extent != sizeof(bool)) || if ((to_extent != sizeof(bool) || from_extent != sizeof(bool)) ||
((pConvertor->remoteArch & OMPI_ARCH_BOOLISxx) != ((pConvertor->remoteArch & OPAL_ARCH_BOOLISxx) !=
(ompi_mpi_local_arch & OMPI_ARCH_BOOLISxx))) { (ompi_mpi_local_arch & OPAL_ARCH_BOOLISxx))) {
switch (pConvertor->remoteArch & OMPI_ARCH_BOOLISxx) { switch (pConvertor->remoteArch & OPAL_ARCH_BOOLISxx) {
case OMPI_ARCH_BOOLIS8: case OPAL_ARCH_BOOLIS8:
CXX_BOOL_COPY_LOOP(int8_t); CXX_BOOL_COPY_LOOP(int8_t);
break; break;
case OMPI_ARCH_BOOLIS16: case OPAL_ARCH_BOOLIS16:
CXX_BOOL_COPY_LOOP(int16_t); CXX_BOOL_COPY_LOOP(int16_t);
break; break;
case OMPI_ARCH_BOOLIS32: case OPAL_ARCH_BOOLIS32:
CXX_BOOL_COPY_LOOP(int32_t); CXX_BOOL_COPY_LOOP(int32_t);
break; break;
} }
@ -285,16 +285,16 @@ copy_fortran_logical_heterogeneous(ompi_convertor_t *pConvertor, uint32_t count,
uint32_t i; uint32_t i;
/* fix up the from extent */ /* fix up the from extent */
if ((pConvertor->remoteArch & OMPI_ARCH_LOGICALISxx) != if ((pConvertor->remoteArch & OPAL_ARCH_LOGICALISxx) !=
(ompi_mpi_local_arch & OMPI_ARCH_LOGICALISxx)) { (ompi_mpi_local_arch & OPAL_ARCH_LOGICALISxx)) {
switch (pConvertor->remoteArch & OMPI_ARCH_LOGICALISxx) { switch (pConvertor->remoteArch & OPAL_ARCH_LOGICALISxx) {
case OMPI_ARCH_LOGICALIS8: case OPAL_ARCH_LOGICALIS8:
from_extent = 1; from_extent = 1;
break; break;
case OMPI_ARCH_LOGICALIS16: case OPAL_ARCH_LOGICALIS16:
from_extent = 2; from_extent = 2;
break; break;
case OMPI_ARCH_LOGICALIS32: case OPAL_ARCH_LOGICALIS32:
from_extent = 4; from_extent = 4;
break; break;
} }
@ -307,16 +307,16 @@ copy_fortran_logical_heterogeneous(ompi_convertor_t *pConvertor, uint32_t count,
if ((to_extent != sizeof(ompi_fortran_logical_t) || if ((to_extent != sizeof(ompi_fortran_logical_t) ||
from_extent != sizeof(ompi_fortran_logical_t)) || from_extent != sizeof(ompi_fortran_logical_t)) ||
((pConvertor->remoteArch & OMPI_ARCH_LOGICALISxx) != ((pConvertor->remoteArch & OPAL_ARCH_LOGICALISxx) !=
(ompi_mpi_local_arch & OMPI_ARCH_LOGICALISxx))) { (ompi_mpi_local_arch & OPAL_ARCH_LOGICALISxx))) {
switch (pConvertor->remoteArch & OMPI_ARCH_LOGICALISxx) { switch (pConvertor->remoteArch & OPAL_ARCH_LOGICALISxx) {
case OMPI_ARCH_LOGICALIS8: case OPAL_ARCH_LOGICALIS8:
FORTRAN_LOGICAL_COPY_LOOP(int8_t); FORTRAN_LOGICAL_COPY_LOOP(int8_t);
break; break;
case OMPI_ARCH_LOGICALIS16: case OPAL_ARCH_LOGICALIS16:
FORTRAN_LOGICAL_COPY_LOOP(int16_t); FORTRAN_LOGICAL_COPY_LOOP(int16_t);
break; break;
case OMPI_ARCH_LOGICALIS32: case OPAL_ARCH_LOGICALIS32:
FORTRAN_LOGICAL_COPY_LOOP(int32_t); FORTRAN_LOGICAL_COPY_LOOP(int32_t);
break; break;
} }

Просмотреть файл

@ -18,11 +18,12 @@
*/ */
#include "ompi_config.h" #include "ompi_config.h"
#include "ompi/constants.h"
#include "mpi.h" #include "mpi.h"
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/datatype_internal.h" #include "ompi/datatype/datatype_internal.h"
#include "ompi/datatype/dt_arch.h" #include "opal/util/arch.h"
#include "ompi/proc/proc.h" #include "ompi/proc/proc.h"
static inline int static inline int
@ -499,7 +500,7 @@ __ompi_ddt_create_from_packed_description( void** packed_buffer,
bool need_swap = false; bool need_swap = false;
if( (remote_processor->proc_arch ^ ompi_proc_local()->proc_arch) & if( (remote_processor->proc_arch ^ ompi_proc_local()->proc_arch) &
OMPI_ARCH_ISBIGENDIAN ) { OPAL_ARCH_ISBIGENDIAN ) {
need_swap = true; need_swap = true;
} }
#endif #endif

Просмотреть файл

@ -22,7 +22,7 @@
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/convertor.h" #include "ompi/datatype/convertor.h"
#include "ompi/datatype/datatype_internal.h" #include "ompi/datatype/datatype_internal.h"
#include "ompi/datatype/dt_arch.h" #include "opal/util/arch.h"
/* From the MPI standard. external32 use the following types: /* From the MPI standard. external32 use the following types:
* Type Length * Type Length
@ -68,10 +68,10 @@
* consider the data stored in external32 as being packed. * consider the data stored in external32 as being packed.
*/ */
uint32_t ompi_ddt_external32_arch_id = OMPI_ARCH_LDEXPSIZEIS15 | OMPI_ARCH_LDMANTDIGIS113 | uint32_t ompi_ddt_external32_arch_id = OPAL_ARCH_LDEXPSIZEIS15 | OPAL_ARCH_LDMANTDIGIS113 |
OMPI_ARCH_LONGDOUBLEIS128 | OMPI_ARCH_ISBIGENDIAN | OPAL_ARCH_LONGDOUBLEIS128 | OPAL_ARCH_ISBIGENDIAN |
OMPI_ARCH_HEADERMASK | OMPI_ARCH_HEADERMASK2 | OPAL_ARCH_HEADERMASK | OPAL_ARCH_HEADERMASK2 |
OMPI_ARCH_BOOLIS8 | OMPI_ARCH_LOGICALIS8; OPAL_ARCH_BOOLIS8 | OPAL_ARCH_LOGICALIS8;
ompi_convertor_t* ompi_mpi_external32_convertor = NULL; ompi_convertor_t* ompi_mpi_external32_convertor = NULL;
ompi_convertor_t* ompi_mpi_local_convertor = NULL; ompi_convertor_t* ompi_mpi_local_convertor = NULL;
@ -79,7 +79,7 @@ uint32_t ompi_mpi_local_arch = 0xFFFFFFFF;
int32_t ompi_ddt_default_convertors_init( void ) int32_t ompi_ddt_default_convertors_init( void )
{ {
ompi_arch_compute_local_id( &ompi_mpi_local_arch ); opal_arch_compute_local_id( &ompi_mpi_local_arch );
/* create the extern32 convertor */ /* create the extern32 convertor */
ompi_mpi_external32_convertor = ompi_convertor_create( ompi_ddt_external32_arch_id, 0 ); ompi_mpi_external32_convertor = ompi_convertor_create( ompi_ddt_external32_arch_id, 0 );

Просмотреть файл

@ -28,6 +28,8 @@
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/if.h" #include "opal/util/if.h"
#include "opal/util/show_help.h" #include "opal/util/show_help.h"
#include "opal/util/arch.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/mca/btl/btl.h" #include "ompi/mca/btl/btl.h"
#include "ompi/mca/btl/base/btl_base_error.h" #include "ompi/mca/btl/base/btl_base_error.h"
@ -38,7 +40,6 @@
#include "btl_openib_xrc.h" #include "btl_openib_xrc.h"
#include "ompi/datatype/convertor.h" #include "ompi/datatype/convertor.h"
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/dt_arch.h"
#include "ompi/mca/mpool/base/base.h" #include "ompi/mca/mpool/base/base.h"
#include "ompi/mca/mpool/mpool.h" #include "ompi/mca/mpool/mpool.h"
#include "ompi/mca/mpool/rdma/mpool_rdma.h" #include "ompi/mca/mpool/rdma/mpool_rdma.h"
@ -1114,8 +1115,8 @@ int mca_btl_openib_put( mca_btl_base_module_t* btl,
} }
/* post descriptor */ /* post descriptor */
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT #if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if((ep->endpoint_proc->proc_ompi->proc_arch & OMPI_ARCH_ISBIGENDIAN) if((ep->endpoint_proc->proc_ompi->proc_arch & OPAL_ARCH_ISBIGENDIAN)
!= (ompi_proc_local()->proc_arch & OMPI_ARCH_ISBIGENDIAN)) { != (ompi_proc_local()->proc_arch & OPAL_ARCH_ISBIGENDIAN)) {
rem_addr = opal_swap_bytes8(rem_addr); rem_addr = opal_swap_bytes8(rem_addr);
rkey = opal_swap_bytes4(rkey); rkey = opal_swap_bytes4(rkey);
} }
@ -1193,8 +1194,8 @@ int mca_btl_openib_get(mca_btl_base_module_t* btl,
} }
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT #if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if((ep->endpoint_proc->proc_ompi->proc_arch & OMPI_ARCH_ISBIGENDIAN) if((ep->endpoint_proc->proc_ompi->proc_arch & OPAL_ARCH_ISBIGENDIAN)
!= (ompi_proc_local()->proc_arch & OMPI_ARCH_ISBIGENDIAN)) { != (ompi_proc_local()->proc_arch & OPAL_ARCH_ISBIGENDIAN)) {
rem_addr = opal_swap_bytes8(rem_addr); rem_addr = opal_swap_bytes8(rem_addr);
rkey = opal_swap_bytes4(rkey); rkey = opal_swap_bytes4(rkey);
} }

Просмотреть файл

@ -21,8 +21,9 @@
#include "ompi_config.h" #include "ompi_config.h"
#include "opal/class/opal_hash_table.h" #include "opal/class/opal_hash_table.h"
#include "opal/util/arch.h"
#include "ompi/runtime/ompi_module_exchange.h" #include "ompi/runtime/ompi_module_exchange.h"
#include "ompi/datatype/dt_arch.h"
#include "btl_openib.h" #include "btl_openib.h"
#include "btl_openib_proc.h" #include "btl_openib_proc.h"
@ -212,14 +213,14 @@ int mca_btl_openib_proc_insert(mca_btl_openib_proc_t* module_proc,
Network Byte Order) and expect all information received to Network Byte Order) and expect all information received to
be in NBO. Since big endian machines always send and receive be in NBO. Since big endian machines always send and receive
in NBO, we don't care so much about that case. */ in NBO, we don't care so much about that case. */
if (module_proc->proc_ompi->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (module_proc->proc_ompi->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
module_endpoint->nbo = true; module_endpoint->nbo = true;
} }
#endif #endif
/* only allow eager rdma if the peers agree on the size of a long */ /* only allow eager rdma if the peers agree on the size of a long */
if((module_proc->proc_ompi->proc_arch & OMPI_ARCH_LONGISxx) != if((module_proc->proc_ompi->proc_arch & OPAL_ARCH_LONGISxx) !=
(ompi_proc_local()->proc_arch & OMPI_ARCH_LONGISxx)) { (ompi_proc_local()->proc_arch & OPAL_ARCH_LONGISxx)) {
module_endpoint->use_eager_rdma = false; module_endpoint->use_eager_rdma = false;
} }

Просмотреть файл

@ -26,9 +26,10 @@
#endif #endif
#include "opal/class/opal_hash_table.h" #include "opal/class/opal_hash_table.h"
#include "opal/util/arch.h"
#include "ompi/mca/btl/base/btl_base_error.h" #include "ompi/mca/btl/base/btl_base_error.h"
#include "ompi/runtime/ompi_module_exchange.h" #include "ompi/runtime/ompi_module_exchange.h"
#include "ompi/datatype/dt_arch.h"
#include "btl_sctp.h" #include "btl_sctp.h"
#include "btl_sctp_proc.h" #include "btl_sctp_proc.h"
@ -181,7 +182,7 @@ int mca_btl_sctp_proc_insert(
Network Byte Order) and expect all information received to Network Byte Order) and expect all information received to
be in NBO. Since big endian machines always send and receive be in NBO. Since big endian machines always send and receive
in NBO, we don't care so much about that case. */ in NBO, we don't care so much about that case. */
if (btl_proc->proc_ompi->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (btl_proc->proc_ompi->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
btl_endpoint->endpoint_nbo = true; btl_endpoint->endpoint_nbo = true;
} }
#endif #endif

Просмотреть файл

@ -28,7 +28,7 @@
#include "opal/class/opal_hash_table.h" #include "opal/class/opal_hash_table.h"
#include "ompi/mca/btl/base/btl_base_error.h" #include "ompi/mca/btl/base/btl_base_error.h"
#include "ompi/runtime/ompi_module_exchange.h" #include "ompi/runtime/ompi_module_exchange.h"
#include "ompi/datatype/dt_arch.h" #include "opal/util/arch.h"
#include "opal/util/if.h" #include "opal/util/if.h"
#include "opal/util/net.h" #include "opal/util/net.h"
#include "orte/mca/oob/tcp/oob_tcp_addr.h" #include "orte/mca/oob/tcp/oob_tcp_addr.h"
@ -255,7 +255,7 @@ int mca_btl_tcp_proc_insert( mca_btl_tcp_proc_t* btl_proc,
Network Byte Order) and expect all information received to Network Byte Order) and expect all information received to
be in NBO. Since big endian machines always send and receive be in NBO. Since big endian machines always send and receive
in NBO, we don't care so much about that case. */ in NBO, we don't care so much about that case. */
if (btl_proc->proc_ompi->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (btl_proc->proc_ompi->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
btl_endpoint->endpoint_nbo = true; btl_endpoint->endpoint_nbo = true;
} }
#endif #endif

Просмотреть файл

@ -167,6 +167,7 @@
#include "opal/util/show_help.h" #include "opal/util/show_help.h"
#include "opal/util/argv.h" #include "opal/util/argv.h"
#include "opal/util/opal_environ.h" #include "opal/util/opal_environ.h"
#include "opal/util/arch.h"
#include "opal/mca/mca.h" #include "opal/mca/mca.h"
#include "opal/mca/base/base.h" #include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_param.h" #include "opal/mca/base/mca_base_param.h"
@ -174,7 +175,6 @@
#include "orte/runtime/orte_globals.h" #include "orte/runtime/orte_globals.h"
#include "orte/util/name_fns.h" #include "orte/util/name_fns.h"
#include "ompi/request/request.h" #include "ompi/request/request.h"
#include "ompi/datatype/dt_arch.h"
#include "ompi/mca/dpm/dpm.h" #include "ompi/mca/dpm/dpm.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/mca/pml/base/base.h" #include "ompi/mca/pml/base/base.h"

Просмотреть файл

@ -28,13 +28,14 @@
#include "osc_pt2pt_buffer.h" #include "osc_pt2pt_buffer.h"
#include "opal/threads/mutex.h" #include "opal/threads/mutex.h"
#include "opal/util/arch.h"
#include "ompi/info/info.h" #include "ompi/info/info.h"
#include "ompi/communicator/communicator.h" #include "ompi/communicator/communicator.h"
#include "ompi/mca/osc/osc.h" #include "ompi/mca/osc/osc.h"
#include "ompi/mca/osc/base/base.h" #include "ompi/mca/osc/base/base.h"
#include "ompi/mca/osc/base/osc_base_obj_convert.h" #include "ompi/mca/osc/base/osc_base_obj_convert.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/datatype/dt_arch.h"
static int component_open(void); static int component_open(void);
static void component_fragment_cb(ompi_osc_pt2pt_mpireq_t *mpireq); static void component_fragment_cb(ompi_osc_pt2pt_mpireq_t *mpireq);

Просмотреть файл

@ -23,10 +23,10 @@
#include "osc_pt2pt_buffer.h" #include "osc_pt2pt_buffer.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/arch.h"
#include "opal/sys/atomic.h" #include "opal/sys/atomic.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/dt_arch.h"
#include "ompi/mca/osc/base/base.h" #include "ompi/mca/osc/base/base.h"
#include "ompi/mca/osc/base/osc_base_obj_convert.h" #include "ompi/mca/osc/base/osc_base_obj_convert.h"
#include "ompi/memchecker.h" #include "ompi/memchecker.h"
@ -270,7 +270,7 @@ ompi_osc_pt2pt_sendreq_send(ompi_osc_pt2pt_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (sendreq->req_target_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (sendreq->req_target_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO;
OMPI_OSC_PT2PT_SEND_HDR_HTON(*header); OMPI_OSC_PT2PT_SEND_HDR_HTON(*header);
} }
@ -472,7 +472,7 @@ ompi_osc_pt2pt_replyreq_send(ompi_osc_pt2pt_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (replyreq->rep_origin_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (replyreq->rep_origin_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO;
OMPI_OSC_PT2PT_REPLY_HDR_HTON(*header); OMPI_OSC_PT2PT_REPLY_HDR_HTON(*header);
} }
@ -1078,7 +1078,7 @@ ompi_osc_pt2pt_control_send(ompi_osc_pt2pt_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_PT2PT_HDR_FLAG_NBO;
OMPI_OSC_PT2PT_CONTROL_HDR_HTON(*header); OMPI_OSC_PT2PT_CONTROL_HDR_HTON(*header);
} }

Просмотреть файл

@ -29,6 +29,8 @@
#include "opal/threads/condition.h" #include "opal/threads/condition.h"
#include "opal/threads/mutex.h" #include "opal/threads/mutex.h"
#include "opal/util/arch.h"
#include "ompi/info/info.h" #include "ompi/info/info.h"
#include "ompi/communicator/communicator.h" #include "ompi/communicator/communicator.h"
#include "ompi/mca/osc/osc.h" #include "ompi/mca/osc/osc.h"
@ -38,7 +40,6 @@
#include "ompi/mca/bml/bml.h" #include "ompi/mca/bml/bml.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/mca/bml/base/base.h" #include "ompi/mca/bml/base/base.h"
#include "ompi/datatype/dt_arch.h"
static int component_open(void); static int component_open(void);
static void component_fragment_cb(struct mca_btl_base_module_t *btl, static void component_fragment_cb(struct mca_btl_base_module_t *btl,
@ -1075,7 +1076,7 @@ rdma_send_info_send(ompi_osc_rdma_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (peer_send_info->proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (peer_send_info->proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
OMPI_OSC_RDMA_RDMA_INFO_HDR_HTON(*header); OMPI_OSC_RDMA_RDMA_INFO_HDR_HTON(*header);
} }

Просмотреть файл

@ -25,6 +25,7 @@
#include "osc_rdma_obj_convert.h" #include "osc_rdma_obj_convert.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/arch.h"
#include "opal/sys/atomic.h" #include "opal/sys/atomic.h"
#include "ompi/mca/bml/bml.h" #include "ompi/mca/bml/bml.h"
#include "ompi/mca/bml/base/base.h" #include "ompi/mca/bml/base/base.h"
@ -32,7 +33,6 @@
#include "ompi/mca/osc/base/base.h" #include "ompi/mca/osc/base/base.h"
#include "ompi/mca/osc/base/osc_base_obj_convert.h" #include "ompi/mca/osc/base/osc_base_obj_convert.h"
#include "ompi/datatype/datatype.h" #include "ompi/datatype/datatype.h"
#include "ompi/datatype/dt_arch.h"
#include "ompi/memchecker.h" #include "ompi/memchecker.h"
static inline int32_t static inline int32_t
@ -551,7 +551,7 @@ ompi_osc_rdma_sendreq_send(ompi_osc_rdma_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (sendreq->req_target_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (sendreq->req_target_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
OMPI_OSC_RDMA_SEND_HDR_HTON(*header); OMPI_OSC_RDMA_SEND_HDR_HTON(*header);
} }
@ -570,7 +570,7 @@ ompi_osc_rdma_sendreq_send(ompi_osc_rdma_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (sendreq->req_target_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (sendreq->req_target_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
OMPI_OSC_RDMA_SEND_HDR_HTON(*header); OMPI_OSC_RDMA_SEND_HDR_HTON(*header);
} }
@ -754,7 +754,7 @@ ompi_osc_rdma_replyreq_send(ompi_osc_rdma_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (replyreq->rep_origin_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (replyreq->rep_origin_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
OMPI_OSC_RDMA_REPLY_HDR_HTON(*header); OMPI_OSC_RDMA_REPLY_HDR_HTON(*header);
} }
@ -1324,7 +1324,7 @@ ompi_osc_rdma_control_send(ompi_osc_rdma_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
OMPI_OSC_RDMA_CONTROL_HDR_HTON(*header); OMPI_OSC_RDMA_CONTROL_HDR_HTON(*header);
} }
@ -1386,7 +1386,7 @@ ompi_osc_rdma_rdma_ack_send(ompi_osc_rdma_module_t *module,
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
#elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT #elif OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if (proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) { if (proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) {
header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO; header->hdr_base.hdr_flags |= OMPI_OSC_RDMA_HDR_FLAG_NBO;
OMPI_OSC_RDMA_CONTROL_HDR_HTON(*header); OMPI_OSC_RDMA_CONTROL_HDR_HTON(*header);
} }

Просмотреть файл

@ -31,7 +31,7 @@
#include "opal/types.h" #include "opal/types.h"
#include "ompi/proc/proc.h" #include "ompi/proc/proc.h"
#include "ompi/datatype/dt_arch.h" #include "opal/util/arch.h"
#define MCA_PML_OB1_HDR_TYPE_MATCH (MCA_BTL_TAG_PML + 1) #define MCA_PML_OB1_HDR_TYPE_MATCH (MCA_BTL_TAG_PML + 1)
#define MCA_PML_OB1_HDR_TYPE_RNDV (MCA_BTL_TAG_PML + 2) #define MCA_PML_OB1_HDR_TYPE_RNDV (MCA_BTL_TAG_PML + 2)
@ -326,7 +326,7 @@ ob1_hdr_hton_intr(mca_pml_ob1_hdr_t *hdr, const uint8_t hdr_type,
hdr->hdr_common.hdr_flags |= MCA_PML_OB1_HDR_FLAGS_NBO; hdr->hdr_common.hdr_flags |= MCA_PML_OB1_HDR_FLAGS_NBO;
#else #else
if(!(proc->proc_arch & OMPI_ARCH_ISBIGENDIAN)) if(!(proc->proc_arch & OPAL_ARCH_ISBIGENDIAN))
return; return;
hdr->hdr_common.hdr_flags |= MCA_PML_OB1_HDR_FLAGS_NBO; hdr->hdr_common.hdr_flags |= MCA_PML_OB1_HDR_FLAGS_NBO;

Просмотреть файл

@ -29,7 +29,7 @@
#include "pml_ob1_rdmafrag.h" #include "pml_ob1_rdmafrag.h"
#include "ompi/mca/bml/base/base.h" #include "ompi/mca/bml/base/base.h"
#include "orte/mca/errmgr/errmgr.h" #include "orte/mca/errmgr/errmgr.h"
#include "ompi/datatype/dt_arch.h" #include "opal/util/arch.h"
#include "ompi/memchecker.h" #include "ompi/memchecker.h"
void mca_pml_ob1_recv_request_process_pending(void) void mca_pml_ob1_recv_request_process_pending(void)
@ -426,8 +426,8 @@ static void mca_pml_ob1_recv_request_rget(
for(i = 0; i < hdr->hdr_seg_cnt; i++) { for(i = 0; i < hdr->hdr_seg_cnt; i++) {
frag->rdma_segs[i] = hdr->hdr_segs[i]; frag->rdma_segs[i] = hdr->hdr_segs[i];
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT #if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if ((recvreq->req_recv.req_base.req_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) != if ((recvreq->req_recv.req_base.req_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) !=
(ompi_proc_local()->proc_arch & OMPI_ARCH_ISBIGENDIAN)) { (ompi_proc_local()->proc_arch & OPAL_ARCH_ISBIGENDIAN)) {
size += opal_swap_bytes4(hdr->hdr_segs[i].seg_len); size += opal_swap_bytes4(hdr->hdr_segs[i].seg_len);
} else } else
#endif #endif

Просмотреть файл

@ -1142,8 +1142,8 @@ void mca_pml_ob1_send_request_put( mca_pml_ob1_send_request_t* sendreq,
frag->rdma_segs[i].seg_key.key64 = hdr->hdr_segs[i].seg_key.key64; frag->rdma_segs[i].seg_key.key64 = hdr->hdr_segs[i].seg_key.key64;
#if OMPI_ENABLE_HETEROGENEOUS_SUPPORT #if OMPI_ENABLE_HETEROGENEOUS_SUPPORT
if ((sendreq->req_send.req_base.req_proc->proc_arch & OMPI_ARCH_ISBIGENDIAN) != if ((sendreq->req_send.req_base.req_proc->proc_arch & OPAL_ARCH_ISBIGENDIAN) !=
(ompi_proc_local()->proc_arch & OMPI_ARCH_ISBIGENDIAN)) { (ompi_proc_local()->proc_arch & OPAL_ARCH_ISBIGENDIAN)) {
size += opal_swap_bytes4(frag->rdma_segs[i].seg_len); size += opal_swap_bytes4(frag->rdma_segs[i].seg_len);
} else } else
#endif #endif

Просмотреть файл

@ -24,6 +24,7 @@
#include "opal/threads/mutex.h" #include "opal/threads/mutex.h"
#include "opal/util/output.h" #include "opal/util/output.h"
#include "opal/util/show_help.h" #include "opal/util/show_help.h"
#include "opal/util/arch.h"
#include "opal/dss/dss.h" #include "opal/dss/dss.h"
#include "orte/mca/errmgr/errmgr.h" #include "orte/mca/errmgr/errmgr.h"
@ -33,7 +34,6 @@
#include "ompi/proc/proc.h" #include "ompi/proc/proc.h"
#include "ompi/mca/pml/pml.h" #include "ompi/mca/pml/pml.h"
#include "ompi/datatype/dt_arch.h"
#include "ompi/datatype/convertor.h" #include "ompi/datatype/convertor.h"
#include "ompi/runtime/params.h" #include "ompi/runtime/params.h"
#include "ompi/runtime/mpiruntime.h" #include "ompi/runtime/mpiruntime.h"
@ -119,7 +119,7 @@ int ompi_proc_init(void)
} }
/* Fill in our local information */ /* Fill in our local information */
rc = ompi_arch_compute_local_id(&ui32); rc = opal_arch_compute_local_id(&ui32);
if (OMPI_SUCCESS != rc) return rc; if (OMPI_SUCCESS != rc) return rc;
ompi_proc_local_proc->proc_nodeid = orte_process_info.nodeid; ompi_proc_local_proc->proc_nodeid = orte_process_info.nodeid;
@ -598,7 +598,7 @@ int ompi_proc_refresh(void) {
} }
/* Fill in our local information */ /* Fill in our local information */
rc = ompi_arch_compute_local_id(&ui32); rc = opal_arch_compute_local_id(&ui32);
if (OMPI_SUCCESS != rc) { if (OMPI_SUCCESS != rc) {
return rc; return rc;
} }

Просмотреть файл

@ -27,6 +27,7 @@ noinst_LTLIBRARIES = libopalutil.la
# Source code files # Source code files
headers = \ headers = \
arch.h \
argv.h \ argv.h \
basename.h \ basename.h \
bit_ops.h \ bit_ops.h \
@ -61,6 +62,7 @@ headers = \
libopalutil_la_SOURCES = \ libopalutil_la_SOURCES = \
$(headers) \ $(headers) \
arch.c \
argv.c \ argv.c \
basename.c \ basename.c \
cmd_line.c \ cmd_line.c \

Просмотреть файл

@ -16,76 +16,87 @@
* *
* $HEADER$ * $HEADER$
*/ */
#include "ompi_config.h" #include "opal_config.h"
#include "dt_arch.h"
int32_t ompi_arch_compute_local_id( uint32_t *me ) #include "opal/util/arch.h"
int32_t opal_arch_compute_local_id( uint32_t *me )
{ {
*me = (OMPI_ARCH_HEADERMASK | OMPI_ARCH_UNUSEDMASK); *me = (OPAL_ARCH_HEADERMASK | OPAL_ARCH_UNUSEDMASK);
/* Handle the size of long (can hold a pointer) */ /* Handle the size of long (can hold a pointer) */
if( 8 == sizeof(long) ) if( 8 == sizeof(long) )
ompi_arch_setmask( me, OMPI_ARCH_LONGIS64 ); opal_arch_setmask( me, OPAL_ARCH_LONGIS64 );
/* sizeof bool */ /* sizeof bool */
if (1 == sizeof(bool) ) { if (1 == sizeof(bool) ) {
ompi_arch_setmask( me, OMPI_ARCH_BOOLIS8); opal_arch_setmask( me, OPAL_ARCH_BOOLIS8);
} else if (2 == sizeof(bool)) { } else if (2 == sizeof(bool)) {
ompi_arch_setmask( me, OMPI_ARCH_BOOLIS16); opal_arch_setmask( me, OPAL_ARCH_BOOLIS16);
} else if (4 == sizeof(bool)) { } else if (4 == sizeof(bool)) {
ompi_arch_setmask( me, OMPI_ARCH_BOOLIS32); opal_arch_setmask( me, OPAL_ARCH_BOOLIS32);
} }
/* sizeof fortran logical */ /* sizeof fortran logical
*
* RHC: technically, use of the ompi_ prefix is
* an abstraction violation. However, this is actually
* an error in our configure scripts that transcends
* all the data types and eventually should be fixed.
* The guilty part is f77_check.m4. Fixing it right
* now is beyond a reasonable scope - this comment is
* placed here to explain the abstraction break and
* indicate that it will eventually be fixed
*/
if (1 == sizeof(ompi_fortran_logical_t) ) { if (1 == sizeof(ompi_fortran_logical_t) ) {
ompi_arch_setmask( me, OMPI_ARCH_LOGICALIS8); opal_arch_setmask( me, OPAL_ARCH_LOGICALIS8);
} else if (2 == sizeof(ompi_fortran_logical_t)) { } else if (2 == sizeof(ompi_fortran_logical_t)) {
ompi_arch_setmask( me, OMPI_ARCH_LOGICALIS16); opal_arch_setmask( me, OPAL_ARCH_LOGICALIS16);
} else if (4 == sizeof(ompi_fortran_logical_t)) { } else if (4 == sizeof(ompi_fortran_logical_t)) {
ompi_arch_setmask( me, OMPI_ARCH_LOGICALIS32); opal_arch_setmask( me, OPAL_ARCH_LOGICALIS32);
} }
/* Initialize the information regarding the long double */ /* Initialize the information regarding the long double */
if( 12 == sizeof(long double) ) if( 12 == sizeof(long double) )
ompi_arch_setmask( me, OMPI_ARCH_LONGDOUBLEIS96 ); opal_arch_setmask( me, OPAL_ARCH_LONGDOUBLEIS96 );
else if( 16 == sizeof(long double) ) else if( 16 == sizeof(long double) )
ompi_arch_setmask( me, OMPI_ARCH_LONGDOUBLEIS128 ); opal_arch_setmask( me, OPAL_ARCH_LONGDOUBLEIS128 );
/* Big endian or little endian ? That's the question */ /* Big endian or little endian ? That's the question */
if( ompi_arch_isbigendian() ) if( opal_arch_isbigendian() )
ompi_arch_setmask( me, OMPI_ARCH_ISBIGENDIAN ); opal_arch_setmask( me, OPAL_ARCH_ISBIGENDIAN );
/* What's the maximum exponent ? */ /* What's the maximum exponent ? */
if ( LDBL_MAX_EXP == 16384 ) if ( LDBL_MAX_EXP == 16384 )
ompi_arch_setmask( me, OMPI_ARCH_LDEXPSIZEIS15 ); opal_arch_setmask( me, OPAL_ARCH_LDEXPSIZEIS15 );
/* How about the length in bits of the mantissa */ /* How about the length in bits of the mantissa */
if ( LDBL_MANT_DIG == 64 ) if ( LDBL_MANT_DIG == 64 )
ompi_arch_setmask( me, OMPI_ARCH_LDMANTDIGIS64 ); opal_arch_setmask( me, OPAL_ARCH_LDMANTDIGIS64 );
else if ( LDBL_MANT_DIG == 105 ) else if ( LDBL_MANT_DIG == 105 )
ompi_arch_setmask( me, OMPI_ARCH_LDMANTDIGIS105 ); opal_arch_setmask( me, OPAL_ARCH_LDMANTDIGIS105 );
else if ( LDBL_MANT_DIG == 106 ) else if ( LDBL_MANT_DIG == 106 )
ompi_arch_setmask( me, OMPI_ARCH_LDMANTDIGIS106 ); opal_arch_setmask( me, OPAL_ARCH_LDMANTDIGIS106 );
else if ( LDBL_MANT_DIG == 107 ) else if ( LDBL_MANT_DIG == 107 )
ompi_arch_setmask( me, OMPI_ARCH_LDMANTDIGIS107 ); opal_arch_setmask( me, OPAL_ARCH_LDMANTDIGIS107 );
else if ( LDBL_MANT_DIG == 113 ) else if ( LDBL_MANT_DIG == 113 )
ompi_arch_setmask( me, OMPI_ARCH_LDMANTDIGIS113 ); opal_arch_setmask( me, OPAL_ARCH_LDMANTDIGIS113 );
/* Intel data representation or Sparc ? */ /* Intel data representation or Sparc ? */
if( ompi_arch_ldisintel() ) if( opal_arch_ldisintel() )
ompi_arch_setmask( me, OMPI_ARCH_LDISINTEL ); opal_arch_setmask( me, OPAL_ARCH_LDISINTEL );
return OMPI_SUCCESS; return OPAL_SUCCESS;
} }
int32_t ompi_arch_checkmask ( uint32_t *var, uint32_t mask ) int32_t opal_arch_checkmask ( uint32_t *var, uint32_t mask )
{ {
unsigned int tmpvar = *var; unsigned int tmpvar = *var;
/* Check whether the headers are set correctly, /* Check whether the headers are set correctly,
or whether this is an erroneous integer */ or whether this is an erroneous integer */
if( !((*var) & OMPI_ARCH_HEADERMASK) ) { if( !((*var) & OPAL_ARCH_HEADERMASK) ) {
if( (*var) & OMPI_ARCH_HEADERMASK2 ) { if( (*var) & OPAL_ARCH_HEADERMASK2 ) {
char* pcDest, *pcSrc; char* pcDest, *pcSrc;
/* Both ends of this integer have the wrong settings, /* Both ends of this integer have the wrong settings,
maybe its just the wrong endian-representation. Try maybe its just the wrong endian-representation. Try
@ -100,7 +111,7 @@ int32_t ompi_arch_checkmask ( uint32_t *var, uint32_t mask )
*pcDest++ = *pcSrc--; *pcDest++ = *pcSrc--;
*pcDest++ = *pcSrc--; *pcDest++ = *pcSrc--;
if( (tmpvar & OMPI_ARCH_HEADERMASK) && (!(tmpvar & OMPI_ARCH_HEADERMASK2)) ) { if( (tmpvar & OPAL_ARCH_HEADERMASK) && (!(tmpvar & OPAL_ARCH_HEADERMASK2)) ) {
*var = tmpvar; *var = tmpvar;
} else } else
return -1; return -1;

Просмотреть файл

@ -16,12 +16,13 @@
* *
* $HEADER$ * $HEADER$
*/ */
#ifndef DATATYPE_ARCH_H_HAS_BEEN_INCLUDED #ifndef OPAL_ARCH_H_HAS_BEEN_INCLUDED
#define DATATYPE_ARCH_H_HAS_BEEN_INCLUDED #define OPAL_ARCH_H_HAS_BEEN_INCLUDED
#include <float.h> #include <float.h>
#include <assert.h> #include <assert.h>
#include "ompi/constants.h"
#include "opal/constants.h"
/*************************************************** /***************************************************
** This file tries to classify the most relevant ** This file tries to classify the most relevant
@ -190,46 +191,46 @@
/* These masks implement the specification above above */ /* These masks implement the specification above above */
#define OMPI_ARCH_HEADERMASK 0x03000000 /* set the fields for the header */ #define OPAL_ARCH_HEADERMASK 0x03000000 /* set the fields for the header */
#define OMPI_ARCH_HEADERMASK2 0x00000003 /* other end, needed for checks */ #define OPAL_ARCH_HEADERMASK2 0x00000003 /* other end, needed for checks */
#define OMPI_ARCH_UNUSEDMASK 0xfc000000 /* mark the unused fields */ #define OPAL_ARCH_UNUSEDMASK 0xfc000000 /* mark the unused fields */
/* BYTE 1 */ /* BYTE 1 */
#define OMPI_ARCH_ISBIGENDIAN 0x00000008 #define OPAL_ARCH_ISBIGENDIAN 0x00000008
/* BYTE 2 */ /* BYTE 2 */
#define OMPI_ARCH_LONGISxx 0x0000c000 /* mask for sizeof long */ #define OPAL_ARCH_LONGISxx 0x0000c000 /* mask for sizeof long */
#define OMPI_ARCH_LONGIS64 0x00001000 #define OPAL_ARCH_LONGIS64 0x00001000
#define OMPI_ARCH_LONGLONGISxx 0x00003000 /* mask for sizeof long long */ #define OPAL_ARCH_LONGLONGISxx 0x00003000 /* mask for sizeof long long */
#define OMPI_ARCH_BOOLISxx 0x00000c00 /* mask for sizeof bool */ #define OPAL_ARCH_BOOLISxx 0x00000c00 /* mask for sizeof bool */
#define OMPI_ARCH_BOOLIS8 0x00000000 /* bool is 8 bits */ #define OPAL_ARCH_BOOLIS8 0x00000000 /* bool is 8 bits */
#define OMPI_ARCH_BOOLIS16 0x00000400 /* bool is 16 bits */ #define OPAL_ARCH_BOOLIS16 0x00000400 /* bool is 16 bits */
#define OMPI_ARCH_BOOLIS32 0x00000800 /* bool is 32 bits */ #define OPAL_ARCH_BOOLIS32 0x00000800 /* bool is 32 bits */
#define OMPI_ARCH_LOGICALISxx 0x00000300 /* mask for sizeof Fortran logical */ #define OPAL_ARCH_LOGICALISxx 0x00000300 /* mask for sizeof Fortran logical */
#define OMPI_ARCH_LOGICALIS8 0x00000000 /* logical is 8 bits */ #define OPAL_ARCH_LOGICALIS8 0x00000000 /* logical is 8 bits */
#define OMPI_ARCH_LOGICALIS16 0x00000100 /* logical is 16 bits */ #define OPAL_ARCH_LOGICALIS16 0x00000100 /* logical is 16 bits */
#define OMPI_ARCH_LOGICALIS32 0x00000200 /* logical is 32 bits */ #define OPAL_ARCH_LOGICALIS32 0x00000200 /* logical is 32 bits */
/* BYTE 3 */ /* BYTE 3 */
#define OMPI_ARCH_LONGDOUBLEIS96 0x00020000 #define OPAL_ARCH_LONGDOUBLEIS96 0x00020000
#define OMPI_ARCH_LONGDOUBLEIS128 0x00010000 #define OPAL_ARCH_LONGDOUBLEIS128 0x00010000
#define OMPI_ARCH_LDEXPSIZEIS15 0x00080000 #define OPAL_ARCH_LDEXPSIZEIS15 0x00080000
#define OMPI_ARCH_LDMANTDIGIS64 0x00400000 #define OPAL_ARCH_LDMANTDIGIS64 0x00400000
#define OMPI_ARCH_LDMANTDIGIS105 0x00200000 #define OPAL_ARCH_LDMANTDIGIS105 0x00200000
#define OMPI_ARCH_LDMANTDIGIS106 0x00600000 #define OPAL_ARCH_LDMANTDIGIS106 0x00600000
#define OMPI_ARCH_LDMANTDIGIS107 0x00100000 #define OPAL_ARCH_LDMANTDIGIS107 0x00100000
#define OMPI_ARCH_LDMANTDIGIS113 0x00500000 #define OPAL_ARCH_LDMANTDIGIS113 0x00500000
#define OMPI_ARCH_LDISINTEL 0x00800000 #define OPAL_ARCH_LDISINTEL 0x00800000
int32_t ompi_arch_compute_local_id( uint32_t *var); int32_t opal_arch_compute_local_id( uint32_t *var);
int32_t ompi_arch_checkmask ( uint32_t *var, uint32_t mask ); int32_t opal_arch_checkmask ( uint32_t *var, uint32_t mask );
static inline int32_t ompi_arch_isbigendian ( void ) static inline int32_t opal_arch_isbigendian ( void )
{ {
const uint32_t value = 0x12345678; const uint32_t value = 0x12345678;
const char *ptr = (char*)&value; const char *ptr = (char*)&value;
@ -253,7 +254,7 @@ static inline int32_t ompi_arch_isbigendian ( void )
* of the mantissa. If it's 1 then we have an intel representaion, if not * of the mantissa. If it's 1 then we have an intel representaion, if not
* we have a sparc one. QED * we have a sparc one. QED
*/ */
static inline int32_t ompi_arch_ldisintel( void ) static inline int32_t opal_arch_ldisintel( void )
{ {
long double ld = 2.0; long double ld = 2.0;
int i, j; int i, j;
@ -261,7 +262,7 @@ static inline int32_t ompi_arch_ldisintel( void )
j = LDBL_MANT_DIG / 32; j = LDBL_MANT_DIG / 32;
i = (LDBL_MANT_DIG % 32) - 1; i = (LDBL_MANT_DIG % 32) - 1;
if( ompi_arch_isbigendian() ) { /* big endian */ if( opal_arch_isbigendian() ) { /* big endian */
j = (sizeof(long double) / sizeof(unsigned int)) - j; j = (sizeof(long double) / sizeof(unsigned int)) - j;
if( i < 0 ) { if( i < 0 ) {
i = 31; i = 31;
@ -276,10 +277,10 @@ static inline int32_t ompi_arch_ldisintel( void )
return (pui[j] & (1 << i) ? 1 : 0); return (pui[j] & (1 << i) ? 1 : 0);
} }
static inline void ompi_arch_setmask ( uint32_t *var, uint32_t mask) static inline void opal_arch_setmask ( uint32_t *var, uint32_t mask)
{ {
*var |= mask; *var |= mask;
} }
#endif /* DATATYPE_ARCH_H_HAS_BEEN_INCLUDED */ #endif /* OPAL_ARCH_H_HAS_BEEN_INCLUDED */