1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641
|
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2009-2017 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
* Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
* Copyright (c) 2013 Los Alamos National Security, LLC. All rights
* reserved.
* Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2018 FUJITSU LIMITED. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* ompi_datatype_t interface for OMPI internal data type representation
*
* ompi_datatype_t is a class which represents contiguous or
* non-contiguous data together with constituent type-related
* information.
*/
#ifndef OMPI_DATATYPE_INTERNAL_H
#define OMPI_DATATYPE_INTERNAL_H
#include "opal/datatype/opal_datatype_internal.h"
#include "ompi/datatype/ompi_datatype.h"
/*
* This is the OMPI-layered numbering of ALL supported MPI types
* (derived from the old DT_ names).
*/
#define OMPI_DATATYPE_MPI_EMPTY 0x00
#define OMPI_DATATYPE_MPI_INT8_T 0x01
#define OMPI_DATATYPE_MPI_UINT8_T 0x02
#define OMPI_DATATYPE_MPI_INT16_T 0x03
#define OMPI_DATATYPE_MPI_UINT16_T 0x04
#define OMPI_DATATYPE_MPI_INT32_T 0x05
#define OMPI_DATATYPE_MPI_UINT32_T 0x06
#define OMPI_DATATYPE_MPI_INT64_T 0x07
#define OMPI_DATATYPE_MPI_UINT64_T 0x08
#define OMPI_DATATYPE_MPI_FLOAT 0x09
#define OMPI_DATATYPE_MPI_DOUBLE 0x0A
#define OMPI_DATATYPE_MPI_LONG_DOUBLE 0x0B
#define OMPI_DATATYPE_MPI_COMPLEX4 0x0C
#define OMPI_DATATYPE_MPI_COMPLEX8 0x0D
#define OMPI_DATATYPE_MPI_COMPLEX16 0x0E
#define OMPI_DATATYPE_MPI_COMPLEX32 0x0F
#define OMPI_DATATYPE_MPI_WCHAR 0x10
#define OMPI_DATATYPE_MPI_PACKED 0x11
#define OMPI_DATATYPE_MPI_BOOL 0x12
#define OMPI_DATATYPE_MPI_LOGICAL 0x13
#define OMPI_DATATYPE_MPI_CHARACTER 0x14
#define OMPI_DATATYPE_MPI_INTEGER 0x15
#define OMPI_DATATYPE_MPI_REAL 0x16
#define OMPI_DATATYPE_MPI_DOUBLE_PRECISION 0x17
/*
* Derived datatypes supposedly contiguous
*/
#define OMPI_DATATYPE_MPI_COMPLEX 0x18 /* Was COMPLEX_FLOAT */
#define OMPI_DATATYPE_MPI_DOUBLE_COMPLEX 0x19 /* Was COMPLEX_DOUBLE */
#define OMPI_DATATYPE_MPI_LONG_DOUBLE_COMPLEX 0x1A /* Was COMPLEX_LONG_DOUBLE */
#define OMPI_DATATYPE_MPI_2INT 0x1B
#define OMPI_DATATYPE_MPI_2INTEGER 0x1C
#define OMPI_DATATYPE_MPI_2REAL 0x1D
#define OMPI_DATATYPE_MPI_2DBLPREC 0x1E
#define OMPI_DATATYPE_MPI_2COMPLEX 0x1F
#define OMPI_DATATYPE_MPI_2DOUBLE_COMPLEX 0x20
/*
* Derived datatypes which will definitively be non contiguous on some architectures.
*/
#define OMPI_DATATYPE_MPI_FLOAT_INT 0x21
#define OMPI_DATATYPE_MPI_DOUBLE_INT 0x22
#define OMPI_DATATYPE_MPI_LONG_DOUBLE_INT 0x23
#define OMPI_DATATYPE_MPI_LONG_INT 0x24
#define OMPI_DATATYPE_MPI_SHORT_INT 0x25
/*
* Datatypes from the MPI 2.2 standard
*/
#define OMPI_DATATYPE_MPI_AINT 0x26
#define OMPI_DATATYPE_MPI_OFFSET 0x27
#define OMPI_DATATYPE_MPI_C_BOOL 0x28
#define OMPI_DATATYPE_MPI_C_COMPLEX 0x29
#define OMPI_DATATYPE_MPI_C_FLOAT_COMPLEX 0x2A
#define OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX 0x2B
#define OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX 0x2C
#define OMPI_DATATYPE_MPI_LB 0x2D
#define OMPI_DATATYPE_MPI_UB 0x2E
/*
* Datatypes from the MPI 3.0 standard
*/
#define OMPI_DATATYPE_MPI_COUNT 0x2F
/*
* Datatypes proposed to the MPI Forum in June 2017 for proposal in
* the MPI 4.0 standard. As of February 2019, it is not accepted yet.
* See https://github.com/mpi-forum/mpi-issues/issues/65
*/
#define OMPI_DATATYPE_MPI_SHORT_FLOAT 0x30
#define OMPI_DATATYPE_MPI_C_SHORT_FLOAT_COMPLEX 0x31
/*
* Datatypes that have a different external32 length.
*/
#define OMPI_DATATYPE_MPI_LONG 0x32
#define OMPI_DATATYPE_MPI_UNSIGNED_LONG 0x33
/* This should __ALWAYS__ stay last */
#define OMPI_DATATYPE_MPI_UNAVAILABLE 0x34
#define OMPI_DATATYPE_MPI_MAX_PREDEFINED (OMPI_DATATYPE_MPI_UNAVAILABLE+1)
/*
* Ensure we can support the predefined datatypes.
*/
#if OMPI_DATATYPE_MAX_PREDEFINED < OMPI_DATATYPE_MPI_UNAVAILABLE
#error OMPI_DATATYPE_MAX_PREDEFINED should be updated to the value of OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
/*
* Mapped types. The following types have basic equivalents in OPAL. Instead
* of being redefined as independent types, they will be made synonyms to
* the most basic type.
*/
#if SIZEOF_CHAR != 1
#error Open MPI asserts that sizeof(char) is 1. This seems not to be the case here. Please report on Open MPI github (see issue #11815)
#endif
#define OMPI_DATATYPE_MPI_CHAR OMPI_DATATYPE_MPI_INT8_T
#define OMPI_DATATYPE_MPI_SIGNED_CHAR OMPI_DATATYPE_MPI_INT8_T
#define OMPI_DATATYPE_MPI_UNSIGNED_CHAR OMPI_DATATYPE_MPI_UINT8_T
#define OMPI_DATATYPE_MPI_BYTE OMPI_DATATYPE_MPI_UINT8_T
#if SIZEOF_SHORT == 1
#define OMPI_DATATYPE_MPI_SHORT OMPI_DATATYPE_MPI_INT8_T
#define OMPI_DATATYPE_MPI_UNSIGNED_SHORT OMPI_DATATYPE_MPI_UINT8_T
#elif SIZEOF_SHORT == 2
#define OMPI_DATATYPE_MPI_SHORT OMPI_DATATYPE_MPI_INT16_T
#define OMPI_DATATYPE_MPI_UNSIGNED_SHORT OMPI_DATATYPE_MPI_UINT16_T
#elif SIZEOF_SHORT == 4
#define OMPI_DATATYPE_MPI_SHORT OMPI_DATATYPE_MPI_INT32_T
#define OMPI_DATATYPE_MPI_UNSIGNED_SHORT OMPI_DATATYPE_MPI_UINT32_T
#elif SIZEOF_SHORT == 8
#define OMPI_DATATYPE_MPI_SHORT OMPI_DATATYPE_MPI_INT64_T
#define OMPI_DATATYPE_MPI_UNSIGNED_SHORT OMPI_DATATYPE_MPI_UINT64_T
#endif
#if SIZEOF_INT == 1
#define OMPI_DATATYPE_MPI_INT OMPI_DATATYPE_MPI_INT8_T
#define OMPI_DATATYPE_MPI_UNSIGNED OMPI_DATATYPE_MPI_UINT8_T
#elif SIZEOF_INT == 2
#define OMPI_DATATYPE_MPI_INT OMPI_DATATYPE_MPI_INT16_T
#define OMPI_DATATYPE_MPI_UNSIGNED OMPI_DATATYPE_MPI_UINT16_T
#elif SIZEOF_INT == 4
#define OMPI_DATATYPE_MPI_INT OMPI_DATATYPE_MPI_INT32_T
#define OMPI_DATATYPE_MPI_UNSIGNED OMPI_DATATYPE_MPI_UINT32_T
#elif SIZEOF_INT == 8
#define OMPI_DATATYPE_MPI_INT OMPI_DATATYPE_MPI_INT64_T
#define OMPI_DATATYPE_MPI_UNSIGNED OMPI_DATATYPE_MPI_UINT64_T
#endif
#if SIZEOF_LONG_LONG == 1
#define OMPI_DATATYPE_MPI_LONG_LONG_INT OMPI_DATATYPE_MPI_INT8_T
#define OMPI_DATATYPE_MPI_UNSIGNED_LONG_LONG OMPI_DATATYPE_MPI_UINT8_T
#elif SIZEOF_LONG_LONG == 2
#define OMPI_DATATYPE_MPI_LONG_LONG_INT OMPI_DATATYPE_MPI_INT16_T
#define OMPI_DATATYPE_MPI_UNSIGNED_LONG_LONG OMPI_DATATYPE_MPI_UINT16_T
#elif SIZEOF_LONG_LONG == 4
#define OMPI_DATATYPE_MPI_LONG_LONG_INT OMPI_DATATYPE_MPI_INT32_T
#define OMPI_DATATYPE_MPI_UNSIGNED_LONG_LONG OMPI_DATATYPE_MPI_UINT32_T
#elif SIZEOF_LONG_LONG == 8
#define OMPI_DATATYPE_MPI_LONG_LONG_INT OMPI_DATATYPE_MPI_INT64_T
#define OMPI_DATATYPE_MPI_UNSIGNED_LONG_LONG OMPI_DATATYPE_MPI_UINT64_T
#endif
/*
* Optional Fortran datatypes, these map to representable types
* in the lower layer, aka as other Fortran types have to map to C types,
* additionally, if the type has the same size as the mandatory
* Fortran type, map to this one.
*/
/* LOGICAL */
#if OMPI_SIZEOF_FORTRAN_LOGICAL1 == OMPI_SIZEOF_FORTRAN_LOGICAL
# define OMPI_DATATYPE_MPI_LOGICAL1 OMPI_DATATYPE_MPI_LOGICAL
#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == 1
# define OMPI_DATATYPE_MPI_LOGICAL1 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == 2
# define OMPI_DATATYPE_MPI_LOGICAL1 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == 4
# define OMPI_DATATYPE_MPI_LOGICAL1 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL1 == 8
# define OMPI_DATATYPE_MPI_LOGICAL1 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_LOGICAL1 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_LOGICAL2 == OMPI_SIZEOF_FORTRAN_LOGICAL
# define OMPI_DATATYPE_MPI_LOGICAL2 OMPI_DATATYPE_MPI_LOGICAL
#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == 1
# define OMPI_DATATYPE_MPI_LOGICAL2 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == 2
# define OMPI_DATATYPE_MPI_LOGICAL2 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == 4
# define OMPI_DATATYPE_MPI_LOGICAL2 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL2 == 8
# define OMPI_DATATYPE_MPI_LOGICAL2 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_LOGICAL2 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_LOGICAL4 == OMPI_SIZEOF_FORTRAN_LOGICAL
# define OMPI_DATATYPE_MPI_LOGICAL4 OMPI_DATATYPE_MPI_LOGICAL
#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == 1
# define OMPI_DATATYPE_MPI_LOGICAL4 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == 2
# define OMPI_DATATYPE_MPI_LOGICAL4 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == 4
# define OMPI_DATATYPE_MPI_LOGICAL4 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL4 == 8
# define OMPI_DATATYPE_MPI_LOGICAL4 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_LOGICAL4 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_LOGICAL8 == OMPI_SIZEOF_FORTRAN_LOGICAL
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_LOGICAL
#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == 1
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == 2
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == 4
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_LOGICAL8 == 8
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_LOGICAL8 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
/* INTEGER */
#if OMPI_SIZEOF_FORTRAN_INTEGER1 == OMPI_SIZEOF_FORTRAN_INTEGER
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_INTEGER
#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == 1
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == 2
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == 4
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER1 == 8
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_INTEGER1 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_INTEGER2 == OMPI_SIZEOF_FORTRAN_INTEGER
# define OMPI_DATATYPE_MPI_INTEGER2 OMPI_DATATYPE_MPI_INTEGER
#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == 1
# define OMPI_DATATYPE_MPI_INTEGER2 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == 2
# define OMPI_DATATYPE_MPI_INTEGER2 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == 4
# define OMPI_DATATYPE_MPI_INTEGER2 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER2 == 8
# define OMPI_DATATYPE_MPI_INTEGER2 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_INTEGER2 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_INTEGER4 == OMPI_SIZEOF_FORTRAN_INTEGER
# define OMPI_DATATYPE_MPI_INTEGER4 OMPI_DATATYPE_MPI_INTEGER
#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == 1
# define OMPI_DATATYPE_MPI_INTEGER4 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == 2
# define OMPI_DATATYPE_MPI_INTEGER4 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == 4
# define OMPI_DATATYPE_MPI_INTEGER4 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER4 == 8
# define OMPI_DATATYPE_MPI_INTEGER4 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_INTEGER4 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_INTEGER8 == OMPI_SIZEOF_FORTRAN_INTEGER
# define OMPI_DATATYPE_MPI_INTEGER8 OMPI_DATATYPE_MPI_INTEGER
#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == 1
# define OMPI_DATATYPE_MPI_INTEGER8 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == 2
# define OMPI_DATATYPE_MPI_INTEGER8 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == 4
# define OMPI_DATATYPE_MPI_INTEGER8 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER8 == 8
# define OMPI_DATATYPE_MPI_INTEGER8 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_INTEGER8 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_INTEGER16 == OMPI_SIZEOF_FORTRAN_INTEGER
# define OMPI_DATATYPE_MPI_INTEGER16 OMPI_DATATYPE_MPI_INTEGER
#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == 1
# define OMPI_DATATYPE_MPI_INTEGER16 OMPI_DATATYPE_MPI_INT8_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == 2
# define OMPI_DATATYPE_MPI_INTEGER16 OMPI_DATATYPE_MPI_INT16_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == 4
# define OMPI_DATATYPE_MPI_INTEGER16 OMPI_DATATYPE_MPI_INT32_T
#elif OMPI_SIZEOF_FORTRAN_INTEGER16 == 8
# define OMPI_DATATYPE_MPI_INTEGER16 OMPI_DATATYPE_MPI_INT64_T
#else
# define OMPI_DATATYPE_MPI_INTEGER16 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
/* REAL */
#if OMPI_SIZEOF_FORTRAN_REAL2 == OMPI_SIZEOF_FORTRAN_REAL
# define OMPI_DATATYPE_MPI_REAL2 OMPI_DATATYPE_MPI_REAL
#elif (defined(HAVE_SHORT_FLOAT) && OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_SHORT_FLOAT) || \
(defined(HAVE_OPAL_SHORT_FLOAT_T) && OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_OPAL_SHORT_FLOAT_T)
# define OMPI_DATATYPE_MPI_REAL2 OMPI_DATATYPE_MPI_SHORT_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_FLOAT
# define OMPI_DATATYPE_MPI_REAL2 OMPI_DATATYPE_MPI_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_DOUBLE
# define OMPI_DATATYPE_MPI_REAL2 OMPI_DATATYPE_MPI_DOUBLE
#elif OMPI_SIZEOF_FORTRAN_REAL2 == SIZEOF_LONG_DOUBLE
# define OMPI_DATATYPE_MPI_REAL2 OMPI_DATATYPE_MPI_LONG_DOUBLE
#else
# define OMPI_DATATYPE_MPI_REAL2 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_REAL4 == OMPI_SIZEOF_FORTRAN_REAL
# define OMPI_DATATYPE_MPI_REAL4 OMPI_DATATYPE_MPI_REAL
#elif (defined(HAVE_SHORT_FLOAT) && OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_SHORT_FLOAT) || \
(defined(HAVE_OPAL_SHORT_FLOAT_T) && OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_OPAL_SHORT_FLOAT_T)
# define OMPI_DATATYPE_MPI_REAL4 OMPI_DATATYPE_MPI_SHORT_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_FLOAT
# define OMPI_DATATYPE_MPI_REAL4 OMPI_DATATYPE_MPI_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_DOUBLE
# define OMPI_DATATYPE_MPI_REAL4 OMPI_DATATYPE_MPI_DOUBLE
#elif OMPI_SIZEOF_FORTRAN_REAL4 == SIZEOF_LONG_DOUBLE
# define OMPI_DATATYPE_MPI_REAL4 OMPI_DATATYPE_MPI_LONG_DOUBLE
#else
# define OMPI_DATATYPE_MPI_REAL4 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_REAL8 == OMPI_SIZEOF_FORTRAN_REAL
# define OMPI_DATATYPE_MPI_REAL8 OMPI_DATATYPE_MPI_REAL
#elif (defined(HAVE_SHORT_FLOAT) && OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_SHORT_FLOAT) || \
(defined(HAVE_OPAL_SHORT_FLOAT_T) && OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_OPAL_SHORT_FLOAT_T)
# define OMPI_DATATYPE_MPI_REAL8 OMPI_DATATYPE_MPI_SHORT_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_FLOAT
# define OMPI_DATATYPE_MPI_REAL8 OMPI_DATATYPE_MPI_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_DOUBLE
# define OMPI_DATATYPE_MPI_REAL8 OMPI_DATATYPE_MPI_DOUBLE
#elif OMPI_SIZEOF_FORTRAN_REAL8 == SIZEOF_LONG_DOUBLE
# define OMPI_DATATYPE_MPI_REAL8 OMPI_DATATYPE_MPI_LONG_DOUBLE
#else
# define OMPI_DATATYPE_MPI_REAL8 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
#if OMPI_SIZEOF_FORTRAN_REAL16 == OMPI_SIZEOF_FORTRAN_REAL
# define OMPI_DATATYPE_MPI_REAL16 OMPI_DATATYPE_MPI_REAL
#elif (defined(HAVE_SHORT_FLOAT) && OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_SHORT_FLOAT) || \
(defined(HAVE_OPAL_SHORT_FLOAT_T) && OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_OPAL_SHORT_FLOAT_T)
# define OMPI_DATATYPE_MPI_REAL16 OMPI_DATATYPE_MPI_SHORT_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_FLOAT
# define OMPI_DATATYPE_MPI_REAL16 OMPI_DATATYPE_MPI_FLOAT
#elif OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_DOUBLE
# define OMPI_DATATYPE_MPI_REAL16 OMPI_DATATYPE_MPI_DOUBLE
#elif OMPI_SIZEOF_FORTRAN_REAL16 == SIZEOF_LONG_DOUBLE
# define OMPI_DATATYPE_MPI_REAL16 OMPI_DATATYPE_MPI_LONG_DOUBLE
#else
# define OMPI_DATATYPE_MPI_REAL16 OMPI_DATATYPE_MPI_UNAVAILABLE
#endif
/*
* C++ datatypes, these map to C datatypes.
*/
#define OMPI_DATATYPE_MPI_CXX_BOOL OMPI_DATATYPE_MPI_C_BOOL
#define OMPI_DATATYPE_MPI_CXX_SHORT_FLOAT_COMPLEX OMPI_DATATYPE_MPI_C_SHORT_FLOAT_COMPLEX
#define OMPI_DATATYPE_MPI_CXX_FLOAT_COMPLEX OMPI_DATATYPE_MPI_C_FLOAT_COMPLEX
#define OMPI_DATATYPE_MPI_CXX_DOUBLE_COMPLEX OMPI_DATATYPE_MPI_C_DOUBLE_COMPLEX
#define OMPI_DATATYPE_MPI_CXX_LONG_DOUBLE_COMPLEX OMPI_DATATYPE_MPI_C_LONG_DOUBLE_COMPLEX
extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX_PREDEFINED];
/* There 3 types of predefined data types.
* - the basic one composed by just one basic datatype which are
* definitively contiguous
* - the derived ones where the same basic type is used multiple times.
* They should be most of the time contiguous.
* - and finally the derived one where multiple basic types are used.
* Depending on the architecture they can be contiguous or not.
*
* At this level we do not care from which language the datatype came from
* (C, C++ or FORTRAN), we only focus on their internal representation in
* the host memory.
*/
#define OMPI_DATATYPE_EMPTY_DATA(NAME) \
.id = OMPI_DATATYPE_MPI_ ## NAME, \
.d_f_to_c_index = -1, \
.d_keyhash = NULL, \
.args = NULL, \
.packed_description = 0, \
.name = "MPI_" # NAME
#define OMPI_DATATYPE_INITIALIZER_UNAVAILABLE(FLAGS) \
OPAL_DATATYPE_INITIALIZER_UNAVAILABLE(FLAGS)
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_X( TYPE, NAME, FLAGS ) \
{ /*ompi_predefined_datatype_t*/ \
{ /* ompi_datatype_t */ \
OMPI_DATATYPE_INITIALIZER_ ## TYPE (OMPI_DATATYPE_FLAG_PREDEFINED | \
OMPI_DATATYPE_FLAG_ANALYZED | \
OMPI_DATATYPE_FLAG_MONOTONIC | \
(FLAGS)) /*super*/, \
OMPI_DATATYPE_EMPTY_DATA(NAME) /*id,d_f_to_c_index,d_keyhash,args,packed_description,name*/ \
}, \
{0, } /* padding */ \
}
/* Preprocessor hack to make sure TYPE gets expanded properly */
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE(TYPE, NAME, FLAGS) OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_X(TYPE, NAME, FLAGS)
/*
* Two macros for convenience
*/
#define OMPI_DATATYPE_INIT_PREDEFINED( NAME, FLAGS ) \
OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE( NAME, NAME, FLAGS )
#define OMPI_DATATYPE_INIT_UNAVAILABLE( NAME, FLAGS ) \
OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE( UNAVAILABLE, NAME, FLAGS )
#define OMPI_DATATYPE_INIT_UNAVAILABLE_BASIC_TYPE(TYPE, NAME, FLAGS) \
OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE( UNAVAILABLE, NAME, FLAGS )
/*
* Initialization for these types is deferred until runtime.
*
* Using this macro implies that at this point not all information needed
* to fill up the datatype are known. We fill them with zeros and then later
* when the datatype engine will be initialized we complete with the
* correct information. This macro should be used for all composed types.
*/
#define OMPI_DATATYPE_INIT_DEFER(NAME, FLAGS) \
OMPI_DATATYPE_INIT_UNAVAILABLE(NAME, FLAGS)
#if OMPI_BUILD_FORTRAN_BINDINGS
/*
* Fortran types are based on the underlying OPAL types: They share the ID -- however,
* the alignment is overwritten.
*/
#define OMPI_DATATYPE_INITIALIZER_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS ) \
{ \
.super = OPAL_OBJ_STATIC_INIT(opal_datatype_t), \
.flags = OPAL_DATATYPE_FLAG_BASIC | \
OMPI_DATATYPE_FLAG_PREDEFINED | \
OMPI_DATATYPE_FLAG_ANALYZED | \
OMPI_DATATYPE_FLAG_MONOTONIC | \
OMPI_DATATYPE_FLAG_DATA_FORTRAN | (FLAGS), \
.id = OPAL_DATATYPE_ ## TYPE ## SIZE, \
.bdt_used = (((uint32_t)1)<<(OPAL_DATATYPE_ ## TYPE ## SIZE)), \
.size = SIZE, \
.true_lb = 0, .true_ub = SIZE, .lb = 0, .ub = SIZE, \
.align = (ALIGN), \
.nbElems = 1, \
.name = OPAL_DATATYPE_INIT_NAME(TYPE ## SIZE), \
.desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE), \
.opt_desc = OPAL_DATATYPE_INIT_DESC_PREDEFINED(TYPE ## SIZE), \
.ptypes = OPAL_DATATYPE_INIT_PTYPES_ARRAY(TYPE ## SIZE) \
}
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS ) \
{ /*ompi_predefined_datatype_t*/ \
.dt = { \
.super = OMPI_DATATYPE_INITIALIZER_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS), \
OMPI_DATATYPE_EMPTY_DATA(NAME) /*id,d_f_to_c_index,d_keyhash,args,packed_description,name*/ \
}, \
.padding = {0, } \
}
#else
#define OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE_FORTRAN( TYPE, NAME, SIZE, ALIGN, FLAGS ) \
OMPI_DATATYPE_INIT_PREDEFINED_BASIC_TYPE( UNAVAILABLE, NAME, FLAGS )
#endif
/*
* OMPI-Versions of Initializer mapped onto OPAL-Types
*/
#define OMPI_DATATYPE_INITIALIZER_LB OPAL_DATATYPE_INITIALIZER_LB
#define OMPI_DATATYPE_INITIALIZER_UB OPAL_DATATYPE_INITIALIZER_UB
#define OMPI_DATATYPE_INITIALIZER_INT8_T OPAL_DATATYPE_INITIALIZER_INT1
#define OMPI_DATATYPE_INITIALIZER_UINT8_T OPAL_DATATYPE_INITIALIZER_UINT1
#define OMPI_DATATYPE_INITIALIZER_INT16_T OPAL_DATATYPE_INITIALIZER_INT2
#define OMPI_DATATYPE_INITIALIZER_UINT16_T OPAL_DATATYPE_INITIALIZER_UINT2
#define OMPI_DATATYPE_INITIALIZER_INT32_T OPAL_DATATYPE_INITIALIZER_INT4
#define OMPI_DATATYPE_INITIALIZER_UINT32_T OPAL_DATATYPE_INITIALIZER_UINT4
#define OMPI_DATATYPE_INITIALIZER_INT64_T OPAL_DATATYPE_INITIALIZER_INT8
#define OMPI_DATATYPE_INITIALIZER_UINT64_T OPAL_DATATYPE_INITIALIZER_UINT8
#define OMPI_DATATYPE_INITIALIZER_CHAR OPAL_DATATYPE_INITIALIZER_INT1
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_CHAR OPAL_DATATYPE_INITIALIZER_UINT1
#define OMPI_DATATYPE_INITIALIZER_SIGNED_CHAR OPAL_DATATYPE_INITIALIZER_INT1
#define OMPI_DATATYPE_INITIALIZER_BYTE OPAL_DATATYPE_INITIALIZER_UINT1
#if SIZEOF_SHORT == 2
#define OMPI_DATATYPE_INITIALIZER_SHORT OPAL_DATATYPE_INITIALIZER_INT2
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_SHORT OPAL_DATATYPE_INITIALIZER_UINT2
#elif SIZEOF_SHORT == 4
#define OMPI_DATATYPE_INITIALIZER_SHORT OPAL_DATATYPE_INITIALIZER_INT4
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_SHORT OPAL_DATATYPE_INITIALIZER_UINT4
#elif SIZEOF_SHORT == 8
#define OMPI_DATATYPE_INITIALIZER_SHORT OPAL_DATATYPE_INITIALIZER_INT8
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_SHORT OPAL_DATATYPE_INITIALIZER_UINT8
#endif
#if SIZEOF_INT == 2
#define OMPI_DATATYPE_INITIALIZER_INT OPAL_DATATYPE_INITIALIZER_INT2
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED OPAL_DATATYPE_INITIALIZER_UINT2
#elif SIZEOF_INT == 4
#define OMPI_DATATYPE_INITIALIZER_INT OPAL_DATATYPE_INITIALIZER_INT4
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED OPAL_DATATYPE_INITIALIZER_UINT4
#elif SIZEOF_INT == 8
#define OMPI_DATATYPE_INITIALIZER_INT OPAL_DATATYPE_INITIALIZER_INT8
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED OPAL_DATATYPE_INITIALIZER_UINT8
#endif
#define OMPI_DATATYPE_INITIALIZER_LONG OPAL_DATATYPE_INITIALIZER_LONG
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_LONG OPAL_DATATYPE_INITIALIZER_UNSIGNED_LONG
#if SIZEOF_LONG_LONG == 4
#define OMPI_DATATYPE_INITIALIZER_LONG_LONG_INT OPAL_DATATYPE_INITIALIZER_INT4
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_LONG_LONG OPAL_DATATYPE_INITIALIZER_UINT4
#elif SIZEOF_LONG_LONG == 8
#define OMPI_DATATYPE_INITIALIZER_LONG_LONG_INT OPAL_DATATYPE_INITIALIZER_INT8
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_LONG_LONG OPAL_DATATYPE_INITIALIZER_UINT8
#elif SIZEOF_LONG_LONG == 16
#define OMPI_DATATYPE_INITIALIZER_LONG_LONG_INT OPAL_DATATYPE_INITIALIZER_INT16
#define OMPI_DATATYPE_INITIALIZER_UNSIGNED_LONG_LONG OPAL_DATATYPE_INITIALIZER_UINT16
#endif
#if defined(HAVE_SHORT_FLOAT)
#if SIZEOF_SHORT_FLOAT == 2
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT2
#elif SIZEOF_SHORT_FLOAT == 4
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT4
#elif SIZEOF_SHORT_FLOAT == 8
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT8
#endif
#elif defined(HAVE_OPAL_SHORT_FLOAT_T) /* HAVE_SHORT_FLOAT */
#if SIZEOF_OPAL_SHORT_FLOAT_T == 2
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT2
#elif SIZEOF_OPAL_SHORT_FLOAT_T == 4
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT4
#elif SIZEOF_OPAL_SHORT_FLOAT_T == 8
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT8
#endif
#else /* HAVE_SHORT_FLOAT */
#define OMPI_DATATYPE_INITIALIZER_SHORT_FLOAT OPAL_DATATYPE_INITIALIZER_UNAVAILABLE
#endif /* HAVE_SHORT_FLOAT */
#if SIZEOF_FLOAT == 2
#define OMPI_DATATYPE_INITIALIZER_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT2
#elif SIZEOF_FLOAT == 4
#define OMPI_DATATYPE_INITIALIZER_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT4
#elif SIZEOF_FLOAT == 8
#define OMPI_DATATYPE_INITIALIZER_FLOAT OPAL_DATATYPE_INITIALIZER_FLOAT8
#endif
#if SIZEOF_DOUBLE == 4
#define OMPI_DATATYPE_INITIALIZER_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT4
#elif SIZEOF_DOUBLE == 8
#define OMPI_DATATYPE_INITIALIZER_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT8
#elif SIZEOF_DOUBLE == 12
#define OMPI_DATATYPE_INITIALIZER_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT12
#elif SIZEOF_DOUBLE == 16
#define OMPI_DATATYPE_INITIALIZER_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT16
#endif
#if SIZEOF_LONG_DOUBLE == 4
#define OMPI_DATATYPE_INITIALIZER_LONG_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT4
#elif SIZEOF_LONG_DOUBLE == 8
#define OMPI_DATATYPE_INITIALIZER_LONG_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT8
#elif SIZEOF_LONG_DOUBLE == 12
#define OMPI_DATATYPE_INITIALIZER_LONG_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT12
#elif SIZEOF_LONG_DOUBLE == 16
#define OMPI_DATATYPE_INITIALIZER_LONG_DOUBLE OPAL_DATATYPE_INITIALIZER_FLOAT16
#endif
#define OMPI_DATATYPE_INITIALIZER_PACKED OPAL_DATATYPE_INITIALIZER_UINT1
#define OMPI_DATATYPE_INITIALIZER_BOOL OPAL_DATATYPE_INITIALIZER_BOOL
#define OMPI_DATATYPE_INITIALIZER_WCHAR OPAL_DATATYPE_INITIALIZER_WCHAR
#define OMPI_DATATYPE_INITIALIZER_C_SHORT_FLOAT_COMPLEX OPAL_DATATYPE_INITIALIZER_SHORT_FLOAT_COMPLEX
#define OMPI_DATATYPE_INITIALIZER_C_FLOAT_COMPLEX OPAL_DATATYPE_INITIALIZER_FLOAT_COMPLEX
#define OMPI_DATATYPE_INITIALIZER_C_DOUBLE_COMPLEX OPAL_DATATYPE_INITIALIZER_DOUBLE_COMPLEX
#define OMPI_DATATYPE_INITIALIZER_C_LONG_DOUBLE_COMPLEX OPAL_DATATYPE_INITIALIZER_LONG_DOUBLE_COMPLEX
/*
* Following are the structured types, that cannot be represented
* by one single OPAL basic type
*/
#define OMPI_DATATYPE_FIRST_TYPE OPAL_DATATYPE_MAX_PREDEFINED
/*
* Derived datatypes supposedly contiguous
*/
#define OMPI_DATATYPE_2INT (OMPI_DATATYPE_FIRST_TYPE+6)
#define OMPI_DATATYPE_2INTEGER (OMPI_DATATYPE_FIRST_TYPE+7)
#define OMPI_DATATYPE_2REAL (OMPI_DATATYPE_FIRST_TYPE+8)
#define OMPI_DATATYPE_2DBLPREC (OMPI_DATATYPE_FIRST_TYPE+9)
#define OMPI_DATATYPE_2COMPLEX (OMPI_DATATYPE_FIRST_TYPE+10)
#define OMPI_DATATYPE_2DOUBLE_COMPLEX (OMPI_DATATYPE_FIRST_TYPE+11)
/*
* Derived datatypes which will definitively be non contiguous on some architectures.
*/
#define OMPI_DATATYPE_FLOAT_INT (OMPI_DATATYPE_FIRST_TYPE+12)
#define OMPI_DATATYPE_DOUBLE_INT (OMPI_DATATYPE_FIRST_TYPE+13)
#define OMPI_DATATYPE_LONG_DOUBLE_INT (OMPI_DATATYPE_FIRST_TYPE+14)
#define OMPI_DATATYPE_SHORT_INT (OMPI_DATATYPE_FIRST_TYPE+15)
#define OMPI_DATATYPE_LONG_INT (OMPI_DATATYPE_FIRST_TYPE+16)
/* Used locally as a nice marker */
#define OMPI_DATATYPE_UNAVAILABLE (OMPI_DATATYPE_FIRST_TYPE+17)
/* If the number of basic datatype should change update OMPI_DATATYPE_MAX_PREDEFINED in ompi_datatype.h */
#if OMPI_DATATYPE_MAX_PREDEFINED <= OMPI_DATATYPE_UNAVAILABLE
#error OMPI_DATATYPE_MAX_PREDEFINED should be updated to the next value after the OMPI_DATATYPE_UNAVAILABLE define
#endif /* safe check for max predefined datatypes. */
#endif /* OMPI_DATATYPE_INTERNAL_H */
|