Uncovered lines in src/mpid/common/datatype/mpid_type_debug.c.gcov 363: -: 291:char *MPIDU_Datatype_builtin_to_string(MPI_Datatype type) 364: function MPIDU_Datatype_builtin_to_string called 0 returned 0% blocks executed 0% 365: #####: 292:{ 406: -: 333: static char t_character[] = "MPI_CHARACTER"; 407: -: 334: 408: #####: 335: if (type == MPI_CHAR) return t_char; 409: branch 0 never executed 410: branch 1 never executed 411: #####: 336: if (type == MPI_UNSIGNED_CHAR) return t_uchar; 412: branch 0 never executed 413: branch 1 never executed 414: #####: 337: if (type == MPI_SIGNED_CHAR) return t_schar; 415: branch 0 never executed 416: branch 1 never executed 417: #####: 338: if (type == MPI_BYTE) return t_byte; 418: branch 0 never executed 419: branch 1 never executed 420: #####: 339: if (type == MPI_WCHAR) return t_wchar_t; 421: branch 0 never executed 422: branch 1 never executed 423: #####: 340: if (type == MPI_SHORT) return t_short; 424: branch 0 never executed 425: branch 1 never executed 426: #####: 341: if (type == MPI_UNSIGNED_SHORT) return t_ushort; 427: branch 0 never executed 428: branch 1 never executed 429: #####: 342: if (type == MPI_INT) return t_int; 430: branch 0 never executed 431: branch 1 never executed 432: #####: 343: if (type == MPI_UNSIGNED) return t_uint; 433: branch 0 never executed 434: branch 1 never executed 435: #####: 344: if (type == MPI_LONG) return t_long; 436: branch 0 never executed 437: branch 1 never executed 438: #####: 345: if (type == MPI_UNSIGNED_LONG) return t_ulong; 439: branch 0 never executed 440: branch 1 never executed 441: #####: 346: if (type == MPI_FLOAT) return t_float; 442: branch 0 never executed 443: branch 1 never executed 444: #####: 347: if (type == MPI_DOUBLE) return t_double; 445: branch 0 never executed 446: branch 1 never executed 447: #####: 348: if (type == MPI_LONG_DOUBLE) return t_longdouble; 448: branch 0 never executed 449: branch 1 never executed 450: #####: 349: if (type == MPI_LONG_LONG_INT) return t_longlongint; 451: branch 0 never executed 452: branch 1 never executed 453: #####: 350: if (type == MPI_LONG_LONG) return t_longlong; 454: branch 0 never executed 455: branch 1 never executed 456: #####: 351: if (type == MPI_UNSIGNED_LONG_LONG) return t_ulonglong; 458: branch 1 never executed 459: -: 352: 460: #####: 353: if (type == MPI_PACKED) return t_packed; 461: branch 0 never executed 462: branch 1 never executed 463: #####: 354: if (type == MPI_LB) return t_lb; 464: branch 0 never executed 465: branch 1 never executed 466: #####: 355: if (type == MPI_UB) return t_ub; 468: branch 1 never executed 469: -: 356: 470: #####: 357: if (type == MPI_FLOAT_INT) return t_floatint; 471: branch 0 never executed 472: branch 1 never executed 473: #####: 358: if (type == MPI_DOUBLE_INT) return t_doubleint; 474: branch 0 never executed 475: branch 1 never executed 476: #####: 359: if (type == MPI_LONG_INT) return t_longint; 477: branch 0 never executed 478: branch 1 never executed 479: #####: 360: if (type == MPI_SHORT_INT) return t_shortint; 480: branch 0 never executed 481: branch 1 never executed 482: #####: 361: if (type == MPI_2INT) return t_2int; 483: branch 0 never executed 484: branch 1 never executed 485: #####: 362: if (type == MPI_LONG_DOUBLE_INT) return t_longdoubleint; 487: branch 1 never executed 488: -: 363: 489: #####: 364: if (type == MPI_COMPLEX) return t_complex; 490: branch 0 never executed 491: branch 1 never executed 492: #####: 365: if (type == MPI_DOUBLE_COMPLEX) return t_doublecomplex; 493: branch 0 never executed 494: branch 1 never executed 495: #####: 366: if (type == MPI_LOGICAL) return t_logical; 496: branch 0 never executed 497: branch 1 never executed 498: #####: 367: if (type == MPI_REAL) return t_real; 499: branch 0 never executed 500: branch 1 never executed 501: #####: 368: if (type == MPI_DOUBLE_PRECISION) return t_doubleprecision; 502: branch 0 never executed 503: branch 1 never executed 504: #####: 369: if (type == MPI_INTEGER) return t_integer; 505: branch 0 never executed 506: branch 1 never executed 507: #####: 370: if (type == MPI_2INTEGER) return t_2integer; 508: branch 0 never executed 509: branch 1 never executed 510: #####: 371: if (type == MPI_2COMPLEX) return t_2complex; 511: branch 0 never executed 512: branch 1 never executed 513: #####: 372: if (type == MPI_2DOUBLE_COMPLEX) return t_2doublecomplex; 514: branch 0 never executed 515: branch 1 never executed 516: #####: 373: if (type == MPI_2REAL) return t_2real; 517: branch 0 never executed 518: branch 1 never executed 519: #####: 374: if (type == MPI_2DOUBLE_PRECISION) return t_2doubleprecision; 520: branch 0 never executed 521: branch 1 never executed 522: #####: 375: if (type == MPI_CHARACTER) return t_character; 524: branch 1 never executed 525: -: 376: 526: #####: 377: return NULL; 535: -: 386:char *MPIDU_Datatype_combiner_to_string(int combiner) 536: function MPIDU_Datatype_combiner_to_string called 0 returned 0% blocks executed 0% 537: #####: 387:{ 555: -: 405: static char c_resized[] = "resized"; 556: -: 406: 557: #####: 407: if (combiner == MPI_COMBINER_NAMED) return c_named; 558: branch 0 never executed 559: branch 1 never executed 560: #####: 408: if (combiner == MPI_COMBINER_CONTIGUOUS) return c_contig; 561: branch 0 never executed 562: branch 1 never executed 563: #####: 409: if (combiner == MPI_COMBINER_VECTOR) return c_vector; 564: branch 0 never executed 565: branch 1 never executed 566: #####: 410: if (combiner == MPI_COMBINER_HVECTOR) return c_hvector; 567: branch 0 never executed 568: branch 1 never executed 569: #####: 411: if (combiner == MPI_COMBINER_INDEXED) return c_indexed; 570: branch 0 never executed 571: branch 1 never executed 572: #####: 412: if (combiner == MPI_COMBINER_HINDEXED) return c_hindexed; 573: branch 0 never executed 574: branch 1 never executed 575: #####: 413: if (combiner == MPI_COMBINER_STRUCT) return c_struct; 576: branch 0 never executed 577: branch 1 never executed 578: #####: 414: if (combiner == MPI_COMBINER_DUP) return c_dup; 579: branch 0 never executed 580: branch 1 never executed 581: #####: 415: if (combiner == MPI_COMBINER_HVECTOR_INTEGER) return c_hvector_integer; 582: branch 0 never executed 583: branch 1 never executed 584: #####: 416: if (combiner == MPI_COMBINER_HINDEXED_INTEGER) return c_hindexed_integer; 585: branch 0 never executed 586: branch 1 never executed 587: #####: 417: if (combiner == MPI_COMBINER_INDEXED_BLOCK) return c_indexed_block; 588: branch 0 never executed 589: branch 1 never executed 590: #####: 418: if (combiner == MPI_COMBINER_STRUCT_INTEGER) return c_struct_integer; 591: branch 0 never executed 592: branch 1 never executed 593: #####: 419: if (combiner == MPI_COMBINER_SUBARRAY) return c_subarray; 594: branch 0 never executed 595: branch 1 never executed 596: #####: 420: if (combiner == MPI_COMBINER_DARRAY) return c_darray; 597: branch 0 never executed 598: branch 1 never executed 599: #####: 421: if (combiner == MPI_COMBINER_F90_REAL) return c_f90_real; 600: branch 0 never executed 601: branch 1 never executed 602: #####: 422: if (combiner == MPI_COMBINER_F90_COMPLEX) return c_f90_complex; 603: branch 0 never executed 604: branch 1 never executed 605: #####: 423: if (combiner == MPI_COMBINER_F90_INTEGER) return c_f90_integer; 606: branch 0 never executed 607: branch 1 never executed 608: #####: 424: if (combiner == MPI_COMBINER_RESIZED) return c_resized; 610: branch 1 never executed 611: -: 425: 612: #####: 426: return NULL; 60 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_debug.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_segment.c.gcov 113: -: 108: int *lengthp) 114: function MPID_Segment_pack_vector called 0 returned 0% blocks executed 0% 115: #####: 109:{ 119: -: 113:MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_PACK_VECTOR); 120: -: 114: 121: #####: 115:packvec_params.u.pack_vector.vectorp = vectorp; 122: #####: 116:packvec_params.u.pack_vector.index = 0; 123: #####: 117:packvec_params.u.pack_vector.length = *lengthp; 124: -: 118: 125: #####: 119:MPIU_Assert(*lengthp > 0); 129: call 3 never executed 130: -: 120: 131: #####: 121:MPID_Segment_manipulate(segp, 141: -: 130: 142: -: 131:/* last value already handled by MPID_Segment_manipulate */ 143: #####: 132:*lengthp = packvec_params.u.pack_vector.index; 160: -: 149: int *lengthp) 161: function MPID_Segment_unpack_vector called 0 returned 0% blocks executed 0% 162: #####: 150:{ 163: -: 151:MPIDI_STATE_DECL(MPID_STATE_MPID_SEGMENT_UNPACK_VECTOR); 164: -: 152:MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_UNPACK_VECTOR); 165: #####: 153:MPID_Segment_pack_vector(segp, first, lastp, vectorp, lengthp); 190: -: 177: DLOOP_Offset *lengthp) 191: function MPID_Segment_flatten called 0 returned 0% blocks executed 0% 192: #####: 178:{ 196: -: 182:MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_FLATTEN); 197: -: 183: 198: #####: 184:packvec_params.u.flatten.offp = (int64_t *) offp; 199: #####: 185:packvec_params.u.flatten.sizep = sizep; 200: #####: 186:packvec_params.u.flatten.index = 0; 201: #####: 187:packvec_params.u.flatten.length = *lengthp; 202: -: 188: 203: #####: 189:MPIU_Assert(*lengthp > 0); 207: call 3 never executed 208: -: 190: 209: #####: 191:MPID_Segment_manipulate(segp, 219: -: 200: 220: -: 201:/* last value already handled by MPID_Segment_manipulate */ 221: #####: 202:*lengthp = packvec_params.u.flatten.index; 243: -: 224: void *v_paramp) 244: function MPID_Segment_contig_pack_to_iov called 0 returned 0% blocks executed 0% 245: #####: 225:{ 246: -: 226: int el_size, last_idx; 247: -: 227: DLOOP_Offset size; 248: #####: 228: char *last_end = NULL; 249: #####: 229: struct MPID_Segment_piece_params *paramp = v_paramp; 252: -: 232: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_CONTIG_PACK_TO_IOV); 253: -: 233: 254: #####: 234: el_size = MPID_Datatype_get_basic_size(el_type); 255: #####: 235: size = *blocks_p * (DLOOP_Offset) el_size; 263: -: 243: (MPI_Aint) *blocks_p)); 264: -: 244: 265: #####: 245: last_idx = paramp->u.pack_vector.index - 1; 266: #####: 246: if (last_idx >= 0) { 267: branch 0 never executed 268: branch 1 never executed 269: #####: 247: last_end = ((char *) paramp->u.pack_vector.vectorp[last_idx].DLOOP_VECTOR_BUF) + 272: -: 250: 273: -: 251: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (bufp)) + rel_off); 274: #####: 252: if ((last_idx == paramp->u.pack_vector.length-1) && 283: -: 257: * function that we are done (and that we didn't process any blocks). 284: -: 258: */ 285: #####: 259: *blocks_p = 0; 286: #####: 259: *blocks_p = 0; 287: #####: 261: return 1; 288: -: 262: } 289: #####: 263: else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off))) 294: -: 264: { 295: -: 265: /* add this size to the last vector rather than using up another one */ 296: #####: 266: paramp->u.pack_vector.vectorp[last_idx].DLOOP_VECTOR_LEN += size; 297: -: 267: } 298: -: 268: else { 299: #####: 269: paramp->u.pack_vector.vectorp[last_idx+1].DLOOP_VECTOR_BUF = (char *) bufp + rel_off; 300: #####: 270: paramp->u.pack_vector.vectorp[last_idx+1].DLOOP_VECTOR_LEN = size; 301: #####: 271: paramp->u.pack_vector.index++; 302: #####: 271: paramp->u.pack_vector.index++; 303: -: 272: } 304: #####: 274: return 0; 331: -: 301: void *v_paramp) 332: function MPID_Segment_vector_pack_to_iov called 0 returned 0% blocks executed 0% 333: #####: 302:{ 334: -: 303: int i; 335: -: 304: DLOOP_Offset size, blocks_left, basic_size; 336: #####: 305: struct MPID_Segment_piece_params *paramp = v_paramp; 339: -: 308: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_VECTOR_PACK_TO_IOV); 340: -: 309: 341: #####: 310: basic_size = (DLOOP_Offset) MPID_Datatype_get_basic_size(el_type); 342: #####: 311: blocks_left = *blocks_p; 358: -: 327: (MPI_Aint) *blocks_p)); 359: -: 328: 360: #####: 329: for (i=0; i < count && blocks_left > 0; i++) { 362: branch 1 never executed 363: -: 330: int last_idx; 364: #####: 331: char *last_end = NULL; 365: -: 332: 366: #####: 333: if (blocks_left > (DLOOP_Offset) blksz) { 367: branch 0 never executed 368: branch 1 never executed 369: #####: 334: size = ((DLOOP_Offset) blksz) * basic_size; 370: #####: 335: blocks_left -= (DLOOP_Offset) blksz; 372: -: 337: else { 373: -: 338: /* last pass */ 374: #####: 339: size = blocks_left * basic_size; 375: #####: 340: blocks_left = 0; 376: -: 341: } 377: -: 342: 378: #####: 343: last_idx = paramp->u.pack_vector.index - 1; 379: #####: 344: if (last_idx >= 0) { 380: branch 0 never executed 381: branch 1 never executed 382: #####: 345: last_end = ((char *) paramp->u.pack_vector.vectorp[last_idx].DLOOP_VECTOR_BUF) + 385: -: 348: 386: -: 349: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (bufp)) + rel_off); 387: #####: 350: if ((last_idx == paramp->u.pack_vector.length-1) && 395: -: 354: * the end of the last one. 396: -: 355: */ 397: #####: 356: *blocks_p -= (blocks_left + (size / basic_size)); 405: -: 363: (MPI_Aint) *blocks_p); 406: -: 364:#endif 407: #####: 366: return 1; 408: -: 367: } 409: #####: 368: else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off))) 414: -: 369: { 415: -: 370: /* add this size to the last vector rather than using up new one */ 416: #####: 371: paramp->u.pack_vector.vectorp[last_idx].DLOOP_VECTOR_LEN += size; 417: -: 372: } 418: -: 373: else { 419: #####: 374: paramp->u.pack_vector.vectorp[last_idx+1].DLOOP_VECTOR_BUF = 420: -: 375: (char *) bufp + rel_off; 421: #####: 376: paramp->u.pack_vector.vectorp[last_idx+1].DLOOP_VECTOR_LEN = size; 422: #####: 377: paramp->u.pack_vector.index++; 423: -: 378: } 424: -: 379: 425: #####: 380: rel_off += stride; 436: -: 391: * blocks_p 437: -: 392: */ 438: #####: 393: MPIU_Assert(blocks_left == 0); 442: call 2 never executed 443: call 3 never executed 444: #####: 395: return 0; 459: -: 410: void *v_paramp) 460: function MPID_Segment_contig_flatten called 0 returned 0% blocks executed 0% 461: #####: 411:{ 462: -: 412: int index, el_size; 463: -: 413: DLOOP_Offset size; 464: #####: 414: struct MPID_Segment_piece_params *paramp = v_paramp; 467: -: 417: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_CONTIG_FLATTEN); 468: -: 418: 469: #####: 419: el_size = MPID_Datatype_get_basic_size(el_type); 470: #####: 420: size = *blocks_p * (DLOOP_Offset) el_size; 471: #####: 421: index = paramp->u.flatten.index; 480: -: 430:#endif 481: -: 431: 482: #####: 432: if (index > 0 && ((DLOOP_Offset) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off) == 489: -: 435: { 490: -: 436: /* add this size to the last vector rather than using up another one */ 491: #####: 437: paramp->u.flatten.sizep[index - 1] += size; 492: -: 438: } 493: -: 439: else { 494: #####: 440: paramp->u.flatten.offp[index] = ((int64_t) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp) + (int64_t) rel_off; 495: #####: 441: paramp->u.flatten.sizep[index] = size; 496: -: 442: 497: #####: 443: paramp->u.flatten.index++; 499: -: 445: * return 1 to stop processing 500: -: 446: */ 501: #####: 447: if (paramp->u.flatten.index == paramp->u.flatten.length) 504: branch 1 never executed 505: -: 448: { 506: #####: 450: return 1; 508: -: 451: } 509: -: 452: } 510: #####: 454: return 0; 534: -: 478: void *v_paramp) 535: function MPID_Segment_vector_flatten called 0 returned 0% blocks executed 0% 536: #####: 479:{ 537: -: 480: int i; 538: -: 481: DLOOP_Offset size, blocks_left, basic_size; 539: #####: 482: struct MPID_Segment_piece_params *paramp = v_paramp; 542: -: 485: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_VECTOR_FLATTEN); 543: -: 486: 544: #####: 487: basic_size = (DLOOP_Offset) MPID_Datatype_get_basic_size(el_type); 545: #####: 488: blocks_left = *blocks_p; 546: -: 489: 547: #####: 490: for (i=0; i < count && blocks_left > 0; i++) { 548: branch 0 never executed 549: branch 1 never executed 550: #####: 491: int index = paramp->u.flatten.index; 551: -: 492: 552: #####: 493: if (blocks_left > (DLOOP_Offset) blksz) { 553: branch 0 never executed 554: branch 1 never executed 555: #####: 494: size = ((DLOOP_Offset) blksz) * basic_size; 556: #####: 495: blocks_left -= (DLOOP_Offset) blksz; 558: -: 497: else { 559: -: 498: /* last pass */ 560: #####: 499: size = blocks_left * basic_size; 561: #####: 500: blocks_left = 0; 562: -: 501: } 563: -: 502: 564: #####: 503: if (index > 0 && ((DLOOP_Offset) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off) == 570: -: 505: { 571: -: 506: /* add this size to the last region rather than using up another one */ 572: #####: 507: paramp->u.flatten.sizep[index - 1] += size; 573: -: 508: } 574: #####: 509: else if (index < paramp->u.flatten.length) { 576: branch 1 never executed 577: -: 510: /* take up another region */ 578: #####: 511: paramp->u.flatten.offp[index] = (DLOOP_Offset) MPI_VOID_PTR_CAST_TO_MPI_AINT bufp + rel_off; 579: #####: 512: paramp->u.flatten.sizep[index] = size; 580: #####: 513: paramp->u.flatten.index++; 582: -: 515: else { 583: -: 516: /* we tried to add to the end of the last region and failed; add blocks back in */ 584: #####: 517: *blocks_p = *blocks_p - blocks_left + (size / basic_size); 585: #####: 517: *blocks_p = *blocks_p - blocks_left + (size / basic_size); 586: #####: 519: return 1; 587: -: 520: } 588: #####: 521: rel_off += stride; 597: -: 522: 598: -: 523: } 599: #####: 528: return 0; 93 line(s) not covered by tests in src/mpid/common/datatype/mpid_segment.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_ext32_segment.c.gcov 60: -: 55:static inline int is_float_type(DLOOP_Type el_type) 61: function is_float_type called 0 returned 0% blocks executed 0% 62: #####: 56:{ 63: #####: 57: return ((el_type == MPI_FLOAT) || (el_type == MPI_DOUBLE) || 81: -: 69: DLOOP_Offset count) 82: function external32_basic_convert called 0 returned 0% blocks executed 0% 83: #####: 70:{ 84: #####: 71: char *src_ptr = src_buf, *dest_ptr = dest_buf; 85: #####: 72: char *src_end = (char *)(src_buf + ((int)count * src_el_size)); 86: -: 73: 87: #####: 74: MPIU_Assert(dest_buf && src_buf); 91: call 3 never executed 92: -: 75: 93: #####: 76: if (src_el_size == dest_el_size) 95: branch 1 never executed 96: -: 77: { 97: #####: 78: if (src_el_size == 2) 99: branch 1 never executed 100: -: 79: { 101: #####: 80: while(src_ptr != src_end) 103: branch 1 never executed 104: -: 81: { 105: #####: 82: BASIC_convert16((*(TWO_BYTE_BASIC_TYPE *)src_ptr), 106: -: 83: (*(TWO_BYTE_BASIC_TYPE *)dest_ptr)); 107: -: 84: 108: #####: 85: src_ptr += src_el_size; 109: #####: 86: dest_ptr += dest_el_size; 110: -: 87: } 111: -: 88: } 112: #####: 89: else if (src_el_size == 4) 114: branch 1 never executed 115: -: 90: { 116: #####: 91: while(src_ptr != src_end) 118: branch 1 never executed 119: -: 92: { 120: #####: 93: BASIC_convert32((*(FOUR_BYTE_BASIC_TYPE *)src_ptr), 121: -: 94: (*(FOUR_BYTE_BASIC_TYPE *)dest_ptr)); 122: -: 95: 123: #####: 96: src_ptr += src_el_size; 124: #####: 97: dest_ptr += dest_el_size; 125: -: 98: } 126: -: 99: } 127: #####: 100: else if (src_el_size == 8) 129: branch 1 never executed 130: -: 101: { 131: #####: 102: while(src_ptr != src_end) 133: branch 1 never executed 134: -: 103: { 135: #####: 104: BASIC_convert64(src_ptr, dest_ptr); 136: call 0 never executed 137: -: 105: 138: #####: 106: src_ptr += src_el_size; 139: #####: 107: dest_ptr += dest_el_size; 145: -: 113: /* TODO */ 146: -: 114: } 147: #####: 115: return 0; 154: -: 122: int count) 155: function external32_float_convert called 0 returned 0% blocks executed 0% 156: #####: 123:{ 157: #####: 124: char *src_ptr = src_buf, *dest_ptr = dest_buf; 158: #####: 125: char *src_end = (char *)(src_buf + ((int)count * src_el_size)); 159: -: 126: 160: #####: 127: MPIU_Assert(dest_buf && src_buf); 164: call 3 never executed 165: -: 128: 166: #####: 129: if (src_el_size == dest_el_size) 168: branch 1 never executed 169: -: 130: { 170: #####: 131: if (src_el_size == 4) 172: branch 1 never executed 173: -: 132: { 174: #####: 133: while(src_ptr != src_end) 176: branch 1 never executed 177: -: 134: { 178: #####: 135: FLOAT_convert((*(FOUR_BYTE_FLOAT_TYPE *)src_ptr), 187: -: 136: (*(FOUR_BYTE_FLOAT_TYPE *)dest_ptr)); 188: -: 137: 189: #####: 138: src_ptr += src_el_size; 190: #####: 139: dest_ptr += dest_el_size; 191: -: 140: } 192: -: 141: } 193: #####: 142: else if (src_el_size == 8) 195: branch 1 never executed 196: -: 143: { 197: #####: 144: while(src_ptr != src_end) 199: branch 1 never executed 200: -: 145: { 201: #####: 146: FLOAT_convert((*(EIGHT_BYTE_FLOAT_TYPE *)src_ptr), 210: -: 147: (*(EIGHT_BYTE_FLOAT_TYPE *)dest_ptr)); 211: -: 148: 212: #####: 149: src_ptr += src_el_size; 213: #####: 150: dest_ptr += dest_el_size; 219: -: 156: /* TODO */ 220: -: 157: } 221: #####: 158: return 0; 232: -: 169: void *v_paramp) 233: function MPID_Segment_contig_pack_external32_to_buf called 0 returned 0% blocks executed 0% 234: #####: 170:{ 235: -: 171: int src_el_size, dest_el_size; 236: #####: 172: struct MPID_Segment_piece_params *paramp = v_paramp; 239: -: 175: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_CONTIG_PACK_EXTERNAL32_TO_BUF); 240: -: 176: 241: #####: 177: src_el_size = MPID_Datatype_get_basic_size(el_type); 242: #####: 178: dest_el_size = MPIDI_Datatype_get_basic_size_external32(el_type); 243: call 0 never executed 244: #####: 179: MPIU_Assert(dest_el_size); 268: -: 199: 269: -: 200: /* TODO: DEAL WITH CASE WHERE ALL DATA DOESN'T FIT! */ 270: #####: 201: if ((src_el_size == dest_el_size) && (src_el_size == 1)) 272: branch 1 never executed 273: -: 202: { 274: #####: 203: MPIU_Memcpy(paramp->u.pack.pack_buffer, 300: -: 204: ((char *) bufp) + rel_off, *blocks_p); 301: -: 205: } 302: #####: 206: else if (is_float_type(el_type)) 305: branch 2 never executed 306: -: 207: { 307: #####: 208: external32_float_convert(paramp->u.pack.pack_buffer, 312: -: 212: else 313: -: 213: { 314: #####: 214: external32_basic_convert(paramp->u.pack.pack_buffer, 317: -: 216: dest_el_size, src_el_size, *blocks_p); 318: -: 217: } 319: #####: 218: paramp->u.pack.pack_buffer += (dest_el_size * (*blocks_p)); 320: #####: 218: paramp->u.pack.pack_buffer += (dest_el_size * (*blocks_p)); 321: -: 219: 322: #####: 221: return 0; 333: -: 232: void *v_paramp) 334: function MPID_Segment_contig_unpack_external32_to_buf called 0 returned 0% blocks executed 0% 335: #####: 233:{ 336: -: 234: int src_el_size, dest_el_size; 337: #####: 235: struct MPID_Segment_piece_params *paramp = v_paramp; 340: -: 238: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_CONTIG_UNPACK_EXTERNAL32_TO_BUF); 341: -: 239: 342: #####: 240: src_el_size = MPID_Datatype_get_basic_size(el_type); 343: #####: 241: dest_el_size = MPIDI_Datatype_get_basic_size_external32(el_type); 344: call 0 never executed 345: #####: 242: MPIU_Assert(dest_el_size); 369: -: 262: 370: -: 263: /* TODO: DEAL WITH CASE WHERE ALL DATA DOESN'T FIT! */ 371: #####: 264: if ((src_el_size == dest_el_size) && (src_el_size == 1)) 373: branch 1 never executed 374: -: 265: { 375: #####: 266: MPIU_Memcpy(((char *)bufp) + rel_off, 401: -: 267: paramp->u.unpack.unpack_buffer, *blocks_p); 402: -: 268: } 403: #####: 269: else if (is_float_type(el_type)) 406: branch 2 never executed 407: -: 270: { 408: #####: 271: external32_float_convert(((char *) bufp) + rel_off, 413: -: 275: else 414: -: 276: { 415: #####: 277: external32_basic_convert(((char *) bufp) + rel_off, 418: -: 279: dest_el_size, src_el_size, *blocks_p); 419: -: 280: } 420: #####: 281: paramp->u.unpack.unpack_buffer += (dest_el_size * (*blocks_p)); 421: #####: 281: paramp->u.unpack.unpack_buffer += (dest_el_size * (*blocks_p)); 422: -: 282: 423: #####: 284: return 0; 433: -: 294: void *pack_buffer) 434: function MPID_Segment_pack_external32 called 0 returned 0% blocks executed 0% 435: #####: 295:{ 439: -: 299: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_PACK_EXTERNAL); 440: -: 300: 441: #####: 301: pack_params.u.pack.pack_buffer = (DLOOP_Buffer)pack_buffer; 442: #####: 302: MPID_Segment_manipulate(segp, 464: -: 323: DLOOP_Buffer unpack_buffer) 465: function MPID_Segment_unpack_external32 called 0 returned 0% blocks executed 0% 466: #####: 324:{ 470: -: 328: MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEGMENT_UNPACK_EXTERNAL32); 471: -: 329: 472: #####: 330: pack_params.u.unpack.unpack_buffer = unpack_buffer; 473: #####: 331: MPID_Segment_manipulate(segp, 69 line(s) not covered by tests in src/mpid/common/datatype/mpid_ext32_segment.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_ext32_segment.h.gcov 137: -: 132:static inline void BASIC_convert64(char *src, char *dest) 138: function BASIC_convert64 called 0 returned 0% blocks executed 0% 139: #####: 133:{ 141: -: 135: uint32_t tmp_dest[2]; 142: -: 136: 143: #####: 137: tmp_src[0] = (uint32_t)(*((uint64_t *)src) >> 32); 144: #####: 138: tmp_src[1] = (uint32_t)((*((uint64_t *)src) << 32) >> 32); 145: -: 139: 146: #####: 140: BASIC_convert32(tmp_src[0], tmp_dest[0]); 147: #####: 141: BASIC_convert32(tmp_src[1], tmp_dest[1]); 148: -: 142: 149: #####: 143: *((uint64_t *)dest) = (uint64_t)tmp_dest[0]; 150: #####: 144: *((uint64_t *)dest) <<= 32; 151: #####: 145: *((uint64_t *)dest) |= (uint64_t)tmp_dest[1]; 154: -: 148:static inline void BASIC_convert96(char *src, char *dest) 155: function BASIC_convert96 called 0 returned 0% blocks executed 0% 156: #####: 149:{ 157: -: 150: uint32_t tmp_src[3]; 158: -: 151: uint32_t tmp_dest[3]; 159: #####: 152: char *ptr = dest; 160: -: 153: 161: #####: 154: tmp_src[0] = (uint32_t)(*((uint64_t *)src) >> 32); 162: #####: 155: tmp_src[1] = (uint32_t)((*((uint64_t *)src) << 32) >> 32); 163: #####: 156: tmp_src[2] = (uint32_t) 164: -: 157: (*((uint32_t *)((char *)src + sizeof(uint64_t)))); 165: -: 158: 166: #####: 159: BASIC_convert32(tmp_src[0], tmp_dest[0]); 167: #####: 160: BASIC_convert32(tmp_src[1], tmp_dest[1]); 168: #####: 161: BASIC_convert32(tmp_src[2], tmp_dest[2]); 169: -: 162: 170: #####: 163: *((uint32_t *)ptr) = tmp_dest[0]; 171: #####: 164: ptr += sizeof(uint32_t); 172: #####: 165: *((uint32_t *)ptr) = tmp_dest[1]; 173: #####: 166: ptr += sizeof(uint32_t); 174: #####: 167: *((uint32_t *)ptr) = tmp_dest[2]; 177: -: 170:static inline void BASIC_convert128(char *src, char *dest) 178: function BASIC_convert128 called 0 returned 0% blocks executed 0% 179: #####: 171:{ 180: -: 172: uint64_t tmp_src[2]; 181: -: 173: uint64_t tmp_dest[2]; 182: #####: 174: char *ptr = dest; 183: -: 175: 184: #####: 176: tmp_src[0] = *((uint64_t *)src); 185: #####: 177: tmp_src[1] = *((uint64_t *)((char *)src + sizeof(uint64_t))); 186: -: 178: 187: #####: 179: BASIC_convert64((char *) &tmp_src[0], (char *) &tmp_dest[0]); 188: call 0 never executed 189: #####: 180: BASIC_convert64((char *) &tmp_src[1], (char *) &tmp_dest[1]); 190: call 0 never executed 191: -: 181: 192: #####: 182: *((uint64_t *)ptr) = tmp_dest[0]; 193: #####: 183: ptr += sizeof(uint64_t); 194: #####: 184: *((uint64_t *)ptr) = tmp_dest[1]; 30 line(s) not covered by tests in src/mpid/common/datatype/mpid_ext32_segment.h.gcov Uncovered lines in src/mpid/common/datatype/mpiimpl.h.gcov 115: -: 110:static MPIU_DBG_INLINE_KEYWORD void MPIUI_Memcpy(void * dst, const void * src, size_t len) 116: function MPIUI_Memcpy called 0 returned 0% blocks executed 0% 117: #####: 111:{ 118: #####: 112: memcpy(dst, src, len); 2 line(s) not covered by tests in src/mpid/common/datatype/mpiimpl.h.gcov Uncovered lines in src/mpid/common/datatype/mpid_ext32_datatype.c.gcov 76: -: 71:MPI_Aint MPIDI_Datatype_get_basic_size_external32(MPI_Datatype el_type) 77: function MPIDI_Datatype_get_basic_size_external32 called 0 returned 0% blocks executed 0% 78: #####: 72:{ 79: #####: 73: MPI_Aint ret = (MPI_Aint) 0; 80: #####: 74: unsigned int i = 0; 81: #####: 75: for(i = 0; i < (sizeof(external32_basic_size_array) / 82: branch 0 never executed 83: branch 1 never executed 84: #####: 76: sizeof(external32_basic_size_t)); i++) 85: -: 77: { 86: #####: 78: if (external32_basic_size_array[i].el_type == el_type) 88: branch 1 never executed 89: -: 79: { 90: #####: 80: ret = external32_basic_size_array[i].el_size; 91: #####: 81: break; 92: -: 82: } 93: -: 83: } 94: #####: 84: return ret; 97: -: 87:MPI_Aint MPID_Datatype_size_external32(MPI_Datatype type) 98: function MPID_Datatype_size_external32 called 0 returned 0% blocks executed 0% 99: #####: 88:{ 100: #####: 89: if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) { 101: branch 0 never executed 102: branch 1 never executed 103: #####: 90: return MPIDI_Datatype_get_basic_size_external32(type); 105: -: 91: } 106: -: 92: else { 107: #####: 93: MPID_Dataloop *dlp = NULL; 108: -: 94: 109: #####: 95: MPID_Datatype_get_loopptr_macro(type, dlp, MPID_DATALOOP_HETEROGENEOUS); 113: call 3 never executed 114: -: 96: 115: #####: 97: return MPID_Dataloop_stream_size(dlp, 15 line(s) not covered by tests in src/mpid/common/datatype/mpid_ext32_datatype.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_dup.c.gcov 35: -: 30: MPI_Datatype *newtype) 36: function MPID_Type_dup called 0 returned 0% blocks executed 0% 37: #####: 31:{ 38: #####: 32: int mpi_errno = MPI_SUCCESS; 39: #####: 33: MPID_Datatype *new_dtp = 0, *old_dtp; 40: -: 34: 41: #####: 35: if (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN) { 43: branch 1 never executed 44: -: 36: /* create a new type and commit it. */ 45: #####: 37: mpi_errno = MPID_Type_contiguous(1, oldtype, newtype); 52: -: 40: else { 53: -: 41: /* allocate new datatype object and handle */ 54: #####: 42: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 55: call 0 never executed 56: #####: 43: if (!new_dtp) { 66: -: 50: } 67: -: 51: 68: #####: 52: MPID_Datatype_get_ptr(oldtype, old_dtp); 74: -: 53: 75: -: 54: /* fill in datatype */ 76: #####: 55: MPIU_Object_set_ref(new_dtp, 1); 77: -: 56: /* new_dtp->handle is filled in by MPIU_Handle_obj_alloc() */ 78: #####: 57: new_dtp->is_contig = old_dtp->is_contig; 79: #####: 58: new_dtp->size = old_dtp->size; 80: #####: 59: new_dtp->extent = old_dtp->extent; 81: #####: 60: new_dtp->ub = old_dtp->ub; 82: #####: 61: new_dtp->lb = old_dtp->lb; 83: #####: 62: new_dtp->true_ub = old_dtp->true_ub; 84: #####: 63: new_dtp->true_lb = old_dtp->true_lb; 85: #####: 64: new_dtp->alignsize = old_dtp->alignsize; 86: #####: 65: new_dtp->has_sticky_ub = old_dtp->has_sticky_ub; 87: #####: 66: new_dtp->has_sticky_lb = old_dtp->has_sticky_lb; 88: #####: 67: new_dtp->is_permanent = old_dtp->is_permanent; 89: #####: 68: new_dtp->is_committed = old_dtp->is_committed; 90: #####: 69: new_dtp->attributes = NULL; /* ??? */ 91: #####: 70: new_dtp->cache_id = -1; /* ??? */ 92: #####: 71: new_dtp->name[0] = 0; /* ??? */ 93: #####: 72: new_dtp->n_elements = old_dtp->n_elements; 94: #####: 73: new_dtp->element_size = old_dtp->element_size; 95: #####: 74: new_dtp->eltype = old_dtp->eltype; 96: -: 75: 97: #####: 76: new_dtp->dataloop = NULL; 98: #####: 77: new_dtp->dataloop_size = old_dtp->dataloop_size; 99: #####: 78: new_dtp->dataloop_depth = old_dtp->dataloop_depth; 100: #####: 79: new_dtp->hetero_dloop = NULL; 101: #####: 80: new_dtp->hetero_dloop_size = old_dtp->hetero_dloop_size; 102: #####: 81: new_dtp->hetero_dloop_depth = old_dtp->hetero_dloop_depth; 103: -: 82: 104: #####: 83: *newtype = new_dtp->handle; 105: -: 84: 106: #####: 85: if (old_dtp->is_committed) { 107: branch 0 never executed 108: branch 1 never executed 109: #####: 86: MPIU_Assert(old_dtp->dataloop != NULL); 112: call 2 never executed 113: call 3 never executed 114: #####: 87: MPID_Dataloop_dup(old_dtp->dataloop, 116: -: 88: old_dtp->dataloop_size, 117: -: 89: &new_dtp->dataloop); 118: #####: 90: if (old_dtp->hetero_dloop != NULL) { 122: -: 92: * -- RBR, 02/01/2007 123: -: 93: */ 124: #####: 94: MPID_Dataloop_dup(old_dtp->hetero_dloop, 133: -: 101: MPIU_DBG_MSG_D(DATATYPE,VERBOSE, "dup type %x created.", *newtype); 134: -: 102: 135: #####: 104: return mpi_errno; 40 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_dup.c.gcov Uncovered lines in src/mpid/common/datatype/mpir_type_get_contig_blocks.c.gcov 32: -: 27: int *nr_blocks_p) 33: function MPIR_Type_get_contig_blocks called 0 returned 0% blocks executed 0% 34: #####: 28:{ 35: -: 29: MPID_Datatype *datatype_ptr; 36: -: 30: 37: #####: 31: if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) { 38: branch 0 never executed 39: branch 1 never executed 40: #####: 32: *nr_blocks_p = 1; 41: #####: 33: return 0; 42: -: 34: } 43: -: 35: 44: #####: 36: MPID_Datatype_get_ptr(type, datatype_ptr); 48: branch 3 never executed 49: call 4 never executed 50: #####: 37: MPIU_Assert(datatype_ptr->is_committed); 54: call 3 never executed 55: -: 38: 56: #####: 39: *nr_blocks_p = datatype_ptr->max_contig_blocks; 57: #####: 40: return 0; 8 line(s) not covered by tests in src/mpid/common/datatype/mpir_type_get_contig_blocks.c.gcov Uncovered lines in src/mpid/common/datatype/mpir_type_flatten.c.gcov 34: -: 29: MPI_Aint *array_len_p) 35: function MPIR_Type_flatten called 0 returned 0% blocks executed 0% 36: #####: 30:{ 39: -: 33: MPID_Segment *segp; 40: -: 34: 41: #####: 35: if (HANDLE_GET_KIND(type) == HANDLE_KIND_BUILTIN) { 42: branch 0 never executed 43: branch 1 never executed 44: #####: 36: off_array[0] = 0; 45: #####: 37: MPID_Datatype_get_size_macro(type, size_array[0]); 49: branch 3 never executed 50: call 4 never executed 51: #####: 38: *array_len_p = 1; 52: #####: 39: return 0; 53: -: 40: } 54: -: 41: 55: #####: 42: MPID_Datatype_get_ptr(type, datatype_ptr); 59: branch 3 never executed 60: call 4 never executed 61: #####: 43: MPIU_Assert(datatype_ptr->is_committed); 64: call 2 never executed 65: call 3 never executed 66: #####: 44: MPIU_Assert(*array_len_p >= datatype_ptr->max_contig_blocks); 70: call 3 never executed 71: -: 45: 72: #####: 46: segp = MPID_Segment_alloc(); 73: call 0 never executed 74: #####: 47: MPID_Segment_init(0, 1, type, segp, 0); /* first 0 is bufptr, 78: -: 50: */ 79: -: 51: 80: #####: 52: first = 0; 81: #####: 53: last = SEGMENT_IGNORE_LAST; 82: -: 54: 83: #####: 55: MPID_Segment_flatten(segp, 89: -: 60: array_len_p); 90: -: 61: 91: #####: 62: MPID_Segment_free(segp); 92: call 0 never executed 93: -: 63: 94: #####: 64: return 0; 16 line(s) not covered by tests in src/mpid/common/datatype/mpir_type_flatten.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_commit.c.gcov 27: -: 22:int MPID_Type_commit(MPI_Datatype *datatype_p) 28: function MPID_Type_commit called 0 returned 0% blocks executed 0% 29: #####: 23:{ 30: #####: 24: int mpi_errno=MPI_SUCCESS; 35: -: 29:#endif 36: -: 30: 37: #####: 31: MPIU_Assert(HANDLE_GET_KIND(*datatype_p) != HANDLE_KIND_BUILTIN); 41: call 3 never executed 42: -: 32: 43: #####: 33: MPID_Datatype_get_ptr(*datatype_p, datatype_ptr); 48: call 4 never executed 49: -: 34: 50: #####: 35: if (datatype_ptr->is_committed == 0) { 51: branch 0 never executed 52: branch 1 never executed 53: #####: 36: datatype_ptr->is_committed = 1; 62: -: 45: MPID_DATALOOP_ALL_BYTES); 63: -: 46:#else 64: #####: 47: MPID_Dataloop_create(*datatype_p, 71: -: 53: 72: -: 54: /* create heterogeneous dataloop */ 73: #####: 55: MPID_Dataloop_create(*datatype_p, 114: -: 95: } 115: -: 96: 116: #####: 97: return mpi_errno; 9 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_commit.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_zerolen.c.gcov 32: -: 27:int MPID_Type_zerolen(MPI_Datatype *newtype) 33: function MPID_Type_zerolen called 0 returned 0% blocks executed 0% 34: #####: 28:{ 37: -: 31: 38: -: 32: /* allocate new datatype object and handle */ 39: #####: 33: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 54: -: 44: 55: -: 45: /* handle is filled in by MPIU_Handle_obj_alloc() */ 56: #####: 46: MPIU_Object_set_ref(new_dtp, 1); 57: #####: 47: new_dtp->is_permanent = 0; 58: #####: 48: new_dtp->is_committed = 0; 59: #####: 49: new_dtp->attributes = NULL; 60: #####: 50: new_dtp->cache_id = 0; 61: #####: 51: new_dtp->name[0] = 0; 62: #####: 52: new_dtp->contents = NULL; 63: -: 53: 64: #####: 54: new_dtp->dataloop = NULL; 65: #####: 55: new_dtp->dataloop_size = -1; 66: #####: 56: new_dtp->dataloop_depth = -1; 67: #####: 57: new_dtp->hetero_dloop = NULL; 68: #####: 58: new_dtp->hetero_dloop_size = -1; 69: #####: 59: new_dtp->hetero_dloop_depth = -1; 70: -: 60: 71: #####: 61: new_dtp->size = 0; 72: #####: 62: new_dtp->has_sticky_ub = 0; 73: #####: 63: new_dtp->has_sticky_lb = 0; 74: #####: 64: new_dtp->lb = 0; 75: #####: 65: new_dtp->ub = 0; 76: #####: 66: new_dtp->true_lb = 0; 77: #####: 67: new_dtp->true_ub = 0; 78: #####: 68: new_dtp->extent = 0; 79: -: 69: 80: #####: 70: new_dtp->alignsize = 0; 81: #####: 71: new_dtp->element_size = 0; 82: #####: 72: new_dtp->eltype = 0; 83: #####: 73: new_dtp->n_elements = 0; 84: #####: 74: new_dtp->is_contig = 1; 85: -: 75: 86: #####: 76: *newtype = new_dtp->handle; 87: #####: 77: return MPI_SUCCESS; 30 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_zerolen.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_vector.c.gcov 42: -: 37: MPI_Datatype *newtype) 43: function MPID_Type_vector called 0 returned 0% blocks executed 0% 44: #####: 38:{ 45: #####: 39: int mpi_errno = MPI_SUCCESS; 51: -: 45: MPID_Datatype *new_dtp; 52: -: 46: 53: #####: 47: if (count == 0) return MPID_Type_zerolen(newtype); 57: -: 48: 58: -: 49: /* allocate new datatype object and handle */ 59: #####: 50: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 60: call 0 never executed 61: #####: 51: if (!new_dtp) { 72: -: 59: 73: -: 60: /* handle is filled in by MPIU_Handle_obj_alloc() */ 74: #####: 61: MPIU_Object_set_ref(new_dtp, 1); 75: #####: 62: new_dtp->is_permanent = 0; 76: #####: 63: new_dtp->is_committed = 0; 77: #####: 64: new_dtp->attributes = NULL; 78: #####: 65: new_dtp->cache_id = 0; 79: #####: 66: new_dtp->name[0] = 0; 80: #####: 67: new_dtp->contents = NULL; 81: -: 68: 82: #####: 69: new_dtp->dataloop = NULL; 83: #####: 70: new_dtp->dataloop_size = -1; 84: #####: 71: new_dtp->dataloop_depth = -1; 85: #####: 72: new_dtp->hetero_dloop = NULL; 86: #####: 73: new_dtp->hetero_dloop_size = -1; 87: #####: 74: new_dtp->hetero_dloop_depth = -1; 88: -: 75: 89: #####: 76: is_builtin = (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN); 90: -: 77: 91: #####: 78: if (is_builtin) { 92: branch 0 never executed 93: branch 1 never executed 94: #####: 79: el_sz = (MPI_Aint) MPID_Datatype_get_basic_size(oldtype); 95: #####: 80: el_type = oldtype; 96: -: 81: 97: #####: 82: old_lb = 0; 98: #####: 83: old_true_lb = 0; 99: #####: 84: old_ub = el_sz; 100: #####: 85: old_true_ub = el_sz; 101: #####: 86: old_sz = el_sz; 102: #####: 87: old_extent = el_sz; 103: #####: 88: old_is_contig = 1; 104: -: 89: 105: #####: 90: new_dtp->size = (MPI_Aint) count * 106: -: 91: (MPI_Aint) blocklength * el_sz; 107: #####: 92: new_dtp->has_sticky_lb = 0; 108: #####: 93: new_dtp->has_sticky_ub = 0; 109: -: 94: 110: #####: 95: new_dtp->alignsize = el_sz; /* ??? */ 111: #####: 96: new_dtp->n_elements = count * blocklength; 112: #####: 97: new_dtp->element_size = el_sz; 113: #####: 98: new_dtp->eltype = el_type; 114: -: 99: 115: #####: 100: new_dtp->max_contig_blocks = count; 116: -: 101: 117: #####: 102: eff_stride = (strideinbytes) ? stride : (stride * el_sz); 122: -: 105: MPID_Datatype *old_dtp; 123: -: 106: 124: #####: 107: MPID_Datatype_get_ptr(oldtype, old_dtp); 128: branch 3 never executed 129: call 4 never executed 130: #####: 108: el_sz = old_dtp->element_size; 131: #####: 109: el_type = old_dtp->eltype; 132: -: 110: 133: #####: 111: old_lb = old_dtp->lb; 134: #####: 112: old_true_lb = old_dtp->true_lb; 135: #####: 113: old_ub = old_dtp->ub; 136: #####: 114: old_true_ub = old_dtp->true_ub; 137: #####: 115: old_sz = old_dtp->size; 138: #####: 116: old_extent = old_dtp->extent; 139: #####: 117: old_is_contig = old_dtp->is_contig; 140: -: 118: 141: #####: 119: new_dtp->size = count * blocklength * old_dtp->size; 142: #####: 120: new_dtp->has_sticky_lb = old_dtp->has_sticky_lb; 143: #####: 121: new_dtp->has_sticky_ub = old_dtp->has_sticky_ub; 144: -: 122: 145: #####: 123: new_dtp->alignsize = old_dtp->alignsize; 146: #####: 124: new_dtp->n_elements = count * blocklength * old_dtp->n_elements; 147: #####: 125: new_dtp->element_size = el_sz; 148: #####: 126: new_dtp->eltype = el_type; 149: -: 127: 150: #####: 128: new_dtp->max_contig_blocks = old_dtp->max_contig_blocks * count * blocklength; 151: -: 129: 152: #####: 130: eff_stride = (strideinbytes) ? stride : (stride * old_dtp->extent); 155: -: 131: } 156: -: 132: 157: #####: 133: MPID_DATATYPE_VECTOR_LB_UB((MPI_Aint) count, 171: -: 139: new_dtp->lb, 172: -: 140: new_dtp->ub); 173: #####: 141: new_dtp->true_lb = new_dtp->lb + (old_true_lb - old_lb); 174: #####: 142: new_dtp->true_ub = new_dtp->ub + (old_true_ub - old_ub); 175: #####: 143: new_dtp->extent = new_dtp->ub - new_dtp->lb; 179: -: 147: * equal to blocklength * size of old type. 180: -: 148: */ 181: #####: 149: if ((MPI_Aint)(new_dtp->size) == new_dtp->extent && 187: -: 151: old_is_contig) 188: -: 152: { 189: #####: 153: new_dtp->is_contig = 1; 190: #####: 154: new_dtp->max_contig_blocks = 1; 191: -: 155: } 192: -: 156: else { 193: #####: 157: new_dtp->is_contig = 0; 194: -: 158: } 195: -: 159: 196: #####: 160: *newtype = new_dtp->handle; 199: -: 163: new_dtp->handle); 200: -: 164: 201: #####: 165: return mpi_errno; 67 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_vector.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_contiguous.c.gcov 34: -: 29: MPI_Datatype *newtype) 35: function MPID_Type_contiguous called 0 returned 0% blocks executed 0% 36: #####: 30:{ 37: #####: 31: int mpi_errno = MPI_SUCCESS; 41: -: 35: MPID_Datatype *new_dtp; 42: -: 36: 43: #####: 37: if (count == 0) return MPID_Type_zerolen(newtype); 47: -: 38: 48: -: 39: /* allocate new datatype object and handle */ 49: #####: 40: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 64: -: 51: 65: -: 52: /* handle is filled in by MPIU_Handle_obj_alloc() */ 66: #####: 53: MPIU_Object_set_ref(new_dtp, 1); 67: #####: 54: new_dtp->is_permanent = 0; 68: #####: 55: new_dtp->is_committed = 0; 69: #####: 56: new_dtp->attributes = NULL; 70: #####: 57: new_dtp->cache_id = 0; 71: #####: 58: new_dtp->name[0] = 0; 72: #####: 59: new_dtp->contents = NULL; 73: -: 60: 74: #####: 61: new_dtp->dataloop = NULL; 75: #####: 62: new_dtp->dataloop_size = -1; 76: #####: 63: new_dtp->dataloop_depth = -1; 77: #####: 64: new_dtp->hetero_dloop = NULL; 78: #####: 65: new_dtp->hetero_dloop_size = -1; 79: #####: 66: new_dtp->hetero_dloop_depth = -1; 80: -: 67: 81: #####: 68: is_builtin = (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN); 82: -: 69: 83: #####: 70: if (is_builtin) 85: branch 1 never executed 86: -: 71: { 87: #####: 72: el_sz = MPID_Datatype_get_basic_size(oldtype); 88: #####: 73: el_type = oldtype; 89: -: 74: 90: #####: 75: new_dtp->size = count * el_sz; 91: #####: 76: new_dtp->has_sticky_ub = 0; 92: #####: 77: new_dtp->has_sticky_lb = 0; 93: #####: 78: new_dtp->true_lb = 0; 94: #####: 79: new_dtp->lb = 0; 95: #####: 80: new_dtp->true_ub = count * el_sz; 96: #####: 81: new_dtp->ub = new_dtp->true_ub; 97: #####: 82: new_dtp->extent = new_dtp->ub - new_dtp->lb; 98: -: 83: 99: #####: 84: new_dtp->alignsize = el_sz; 100: #####: 85: new_dtp->n_elements = count; 101: #####: 86: new_dtp->element_size = el_sz; 102: #####: 87: new_dtp->eltype = el_type; 103: #####: 88: new_dtp->is_contig = 1; 104: #####: 89: new_dtp->max_contig_blocks = 1; 110: -: 95: MPID_Datatype *old_dtp; 111: -: 96: 112: #####: 97: MPID_Datatype_get_ptr(oldtype, old_dtp); 116: branch 3 never executed 117: call 4 never executed 118: #####: 98: el_sz = old_dtp->element_size; 119: #####: 99: el_type = old_dtp->eltype; 120: -: 100: 121: #####: 101: new_dtp->size = count * old_dtp->size; 122: #####: 102: new_dtp->has_sticky_ub = old_dtp->has_sticky_ub; 123: #####: 103: new_dtp->has_sticky_lb = old_dtp->has_sticky_lb; 124: -: 104: 125: #####: 105: MPID_DATATYPE_CONTIG_LB_UB((MPI_Aint) count, 137: -: 113: * if there are sticky lb/ubs or not when doing this. 138: -: 114: */ 139: #####: 115: new_dtp->true_lb = new_dtp->lb + (old_dtp->true_lb - old_dtp->lb); 140: #####: 116: new_dtp->true_ub = new_dtp->ub + (old_dtp->true_ub - old_dtp->ub); 141: #####: 117: new_dtp->extent = new_dtp->ub - new_dtp->lb; 142: -: 118: 143: #####: 119: new_dtp->alignsize = old_dtp->alignsize; 144: #####: 120: new_dtp->n_elements = count * old_dtp->n_elements; 145: #####: 121: new_dtp->element_size = old_dtp->element_size; 146: #####: 122: new_dtp->eltype = el_type; 147: -: 123: 148: #####: 124: new_dtp->is_contig = old_dtp->is_contig; 149: #####: 125: if(old_dtp->is_contig) 150: branch 0 never executed 151: branch 1 never executed 152: #####: 126: new_dtp->max_contig_blocks = 1; 153: -: 127: else 154: #####: 128: new_dtp->max_contig_blocks = count * old_dtp->max_contig_blocks; 155: -: 129: } 156: -: 130: 157: #####: 131: *newtype = new_dtp->handle; 160: -: 134: new_dtp->handle); 161: -: 135: 162: #####: 136: return mpi_errno; 55 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_contiguous.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_create_resized.c.gcov 24: -: 19: MPI_Datatype *newtype_p) 25: function MPID_Type_create_resized called 0 returned 0% blocks executed 0% 26: #####: 20:{ 27: -: 21: MPID_Datatype *new_dtp; 28: -: 22: 29: #####: 23: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 37: -: 27: 38: -: 28: /* handle is filled in by MPIU_Handle_obj_alloc() */ 39: #####: 29: MPIU_Object_set_ref(new_dtp, 1); 40: #####: 30: new_dtp->is_permanent = 0; 41: #####: 31: new_dtp->is_committed = 0; 42: #####: 32: new_dtp->attributes = 0; 43: #####: 33: new_dtp->cache_id = 0; 44: #####: 34: new_dtp->name[0] = 0; 45: #####: 35: new_dtp->contents = 0; 46: -: 36: 47: #####: 37: new_dtp->dataloop = NULL; 48: #####: 38: new_dtp->dataloop_size = -1; 49: #####: 39: new_dtp->dataloop_depth = -1; 50: #####: 40: new_dtp->hetero_dloop = NULL; 51: #####: 41: new_dtp->hetero_dloop_size = -1; 52: #####: 42: new_dtp->hetero_dloop_depth = -1; 53: -: 43: 54: -: 44: /* if oldtype is a basic, we build a contiguous dataloop of count = 1 */ 55: #####: 45: if (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN) 57: branch 1 never executed 58: -: 46: { 59: #####: 47: int oldsize = MPID_Datatype_get_basic_size(oldtype); 60: -: 48: 61: #####: 49: new_dtp->size = oldsize; 62: #####: 50: new_dtp->has_sticky_ub = 1; 63: #####: 51: new_dtp->has_sticky_lb = 1; 64: #####: 52: new_dtp->dataloop_depth = 1; 65: #####: 53: new_dtp->true_lb = 0; 66: #####: 54: new_dtp->lb = lb; 67: #####: 55: new_dtp->true_ub = oldsize; 68: #####: 56: new_dtp->ub = lb + extent; 69: #####: 57: new_dtp->extent = extent; 70: #####: 58: new_dtp->alignsize = oldsize; /* FIXME ??? */ 71: #####: 59: new_dtp->n_elements = 1; 72: #####: 60: new_dtp->element_size = oldsize; 73: #####: 61: new_dtp->is_contig = (extent == oldsize) ? 1 : 0; 74: #####: 62: new_dtp->eltype = oldtype; 79: -: 67: MPID_Datatype *old_dtp; 80: -: 68: 81: #####: 69: MPID_Datatype_get_ptr(oldtype, old_dtp); 86: call 4 never executed 87: -: 70: 88: #####: 71: new_dtp->size = old_dtp->size; 89: #####: 72: new_dtp->has_sticky_ub = 1; 90: #####: 73: new_dtp->has_sticky_lb = 1; 91: #####: 74: new_dtp->dataloop_depth = old_dtp->dataloop_depth; 92: #####: 75: new_dtp->true_lb = old_dtp->true_lb; 93: #####: 76: new_dtp->lb = lb; 94: #####: 77: new_dtp->true_ub = old_dtp->true_ub; 95: #####: 78: new_dtp->ub = lb + extent; 96: #####: 79: new_dtp->extent = extent; 97: #####: 80: new_dtp->alignsize = old_dtp->alignsize; 98: #####: 81: new_dtp->n_elements = old_dtp->n_elements; 99: #####: 82: new_dtp->element_size = old_dtp->element_size; 100: #####: 83: new_dtp->eltype = old_dtp->eltype; 101: -: 84: 102: #####: 85: new_dtp->is_contig = 106: -: 87: } 107: -: 88: 108: #####: 89: *newtype_p = new_dtp->handle; 111: -: 92: new_dtp->handle); 112: -: 93: 113: #####: 94: return MPI_SUCCESS; 48 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_create_resized.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_blockindexed.c.gcov 43: -: 38: MPI_Datatype *newtype) 44: function MPID_Type_blockindexed called 0 returned 0% blocks executed 0% 45: #####: 39:{ 46: #####: 40: int mpi_errno = MPI_SUCCESS, i; 49: -: 43: MPI_Datatype el_type; 50: -: 44: MPI_Aint old_lb, old_ub, old_extent, old_true_lb, old_true_ub; 51: #####: 45: MPI_Aint min_lb = 0, max_ub = 0, eff_disp; 53: -: 47: MPID_Datatype *new_dtp; 54: -: 48: 55: #####: 49: if (count == 0) return MPID_Type_zerolen(newtype); 59: -: 50: 60: -: 51: /* allocate new datatype object and handle */ 61: #####: 52: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 75: -: 62: 76: -: 63: /* handle is filled in by MPIU_Handle_obj_alloc() */ 77: #####: 64: MPIU_Object_set_ref(new_dtp, 1); 78: #####: 65: new_dtp->is_permanent = 0; 79: #####: 66: new_dtp->is_committed = 0; 80: #####: 67: new_dtp->attributes = NULL; 81: #####: 68: new_dtp->cache_id = 0; 82: #####: 69: new_dtp->name[0] = 0; 83: #####: 70: new_dtp->contents = NULL; 84: -: 71: 85: #####: 72: new_dtp->dataloop = NULL; 86: #####: 73: new_dtp->dataloop_size = -1; 87: #####: 74: new_dtp->dataloop_depth = -1; 88: #####: 75: new_dtp->hetero_dloop = NULL; 89: #####: 76: new_dtp->hetero_dloop_size = -1; 90: #####: 77: new_dtp->hetero_dloop_depth = -1; 91: -: 78: 92: #####: 79: is_builtin = (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN); 93: -: 80: 94: #####: 81: if (is_builtin) 96: branch 1 never executed 97: -: 82: { 98: #####: 83: el_sz = (MPI_Aint) MPID_Datatype_get_basic_size(oldtype); 99: #####: 84: el_type = oldtype; 100: -: 85: 101: #####: 86: old_lb = 0; 102: #####: 87: old_true_lb = 0; 103: #####: 88: old_ub = el_sz; 104: #####: 89: old_true_ub = el_sz; 105: #####: 90: old_extent = el_sz; 106: #####: 91: old_is_contig = 1; 107: -: 92: 108: #####: 93: new_dtp->size = (MPI_Aint) count * 109: -: 94: (MPI_Aint) blocklength * el_sz; 110: #####: 95: new_dtp->has_sticky_lb = 0; 111: #####: 96: new_dtp->has_sticky_ub = 0; 112: -: 97: 113: #####: 98: new_dtp->alignsize = el_sz; /* ??? */ 114: #####: 99: new_dtp->n_elements = count * blocklength; 115: #####: 100: new_dtp->element_size = el_sz; 116: #####: 101: new_dtp->eltype = el_type; 117: -: 102: 118: #####: 103: new_dtp->max_contig_blocks = count; 123: -: 108: MPID_Datatype *old_dtp; 124: -: 109: 125: #####: 110: MPID_Datatype_get_ptr(oldtype, old_dtp); 129: branch 3 never executed 130: call 4 never executed 131: #####: 111: el_sz = old_dtp->element_size; 132: #####: 112: el_type = old_dtp->eltype; 133: -: 113: 134: #####: 114: old_lb = old_dtp->lb; 135: #####: 115: old_true_lb = old_dtp->true_lb; 136: #####: 116: old_ub = old_dtp->ub; 137: #####: 117: old_true_ub = old_dtp->true_ub; 138: #####: 118: old_extent = old_dtp->extent; 139: #####: 119: old_is_contig = old_dtp->is_contig; 140: -: 120: 141: #####: 121: new_dtp->size = (MPI_Aint) count * 142: -: 122: (MPI_Aint) blocklength * 143: -: 123: (MPI_Aint) old_dtp->size; 144: #####: 124: new_dtp->has_sticky_lb = old_dtp->has_sticky_lb; 145: #####: 125: new_dtp->has_sticky_ub = old_dtp->has_sticky_ub; 146: -: 126: 147: #####: 127: new_dtp->alignsize = old_dtp->alignsize; 148: #####: 128: new_dtp->n_elements = count * blocklength * old_dtp->n_elements; 149: #####: 129: new_dtp->element_size = el_sz; 150: #####: 130: new_dtp->eltype = el_type; 151: -: 131: 152: #####: 132: new_dtp->max_contig_blocks = old_dtp->max_contig_blocks * count * blocklength; 154: -: 134: 155: -: 135: /* priming for loop */ 156: #####: 136: eff_disp = (dispinbytes) ? ((MPI_Aint *) displacement_array)[0] : 158: branch 1 never executed 159: -: 137: (((MPI_Aint) ((int *) displacement_array)[0]) * old_extent); 160: #####: 138: MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint) blocklength, 171: -: 145: 172: -: 146: /* determine new min lb and max ub */ 173: #####: 147: for (i=1; i < count; i++) 177: -: 149: MPI_Aint tmp_lb, tmp_ub; 178: -: 150: 179: #####: 151: eff_disp = (dispinbytes) ? ((MPI_Aint *) displacement_array)[i] : 181: branch 1 never executed 182: -: 152: (((MPI_Aint) ((int *) displacement_array)[i]) * old_extent); 183: #####: 153: MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint) blocklength, 193: -: 159: tmp_ub); 194: -: 160: 195: #####: 161: if (tmp_lb < min_lb) min_lb = tmp_lb; 196: branch 0 never executed 197: branch 1 never executed 198: #####: 162: if (tmp_ub > max_ub) max_ub = tmp_ub; 201: -: 163: } 202: -: 164: 203: #####: 165: new_dtp->lb = min_lb; 204: #####: 166: new_dtp->ub = max_ub; 205: #####: 167: new_dtp->true_lb = min_lb + (old_true_lb - old_lb); 206: #####: 168: new_dtp->true_ub = max_ub + (old_true_ub - old_ub); 207: #####: 169: new_dtp->extent = max_ub - min_lb; 211: -: 173: * contiguous. 212: -: 174: */ 213: #####: 175: new_dtp->is_contig = 0; 214: #####: 176: if (old_is_contig) 216: branch 1 never executed 217: -: 177: { 218: #####: 178: contig_count = MPID_Type_blockindexed_count_contig(count, 222: -: 181: dispinbytes, 223: -: 182: old_extent); 224: #####: 183: new_dtp->max_contig_blocks = contig_count; 225: #####: 184: if( (contig_count == 1) && 230: -: 185: ((MPI_Aint) new_dtp->size == new_dtp->extent) ) 231: -: 186: { 232: #####: 187: new_dtp->is_contig = 1; 234: -: 189: } 235: -: 190: 236: #####: 191: *newtype = new_dtp->handle; 237: #####: 192: return mpi_errno; 73 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_blockindexed.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_indexed.c.gcov 44: -: 39: MPI_Datatype *newtype) 45: function MPID_Type_indexed called 0 returned 0% blocks executed 0% 46: #####: 40:{ 47: #####: 41: int mpi_errno = MPI_SUCCESS; 50: -: 44: int el_sz, el_ct, old_ct, old_sz; 51: -: 45: MPI_Aint old_lb, old_ub, old_extent, old_true_lb, old_true_ub; 52: #####: 46: MPI_Aint min_lb = 0, max_ub = 0, eff_disp; 55: -: 49: MPID_Datatype *new_dtp; 56: -: 50: 57: #####: 51: if (count == 0) return MPID_Type_zerolen(newtype); 61: -: 52: 62: -: 53: /* allocate new datatype object and handle */ 63: #####: 54: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 81: -: 68: 82: -: 69: /* handle is filled in by MPIU_Handle_obj_alloc() */ 83: #####: 70: MPIU_Object_set_ref(new_dtp, 1); 84: #####: 71: new_dtp->is_permanent = 0; 85: #####: 72: new_dtp->is_committed = 0; 86: #####: 73: new_dtp->attributes = NULL; 87: #####: 74: new_dtp->cache_id = 0; 88: #####: 75: new_dtp->name[0] = 0; 89: #####: 76: new_dtp->contents = NULL; 90: -: 77: 91: #####: 78: new_dtp->dataloop = NULL; 92: #####: 79: new_dtp->dataloop_size = -1; 93: #####: 80: new_dtp->dataloop_depth = -1; 94: #####: 81: new_dtp->hetero_dloop = NULL; 95: #####: 82: new_dtp->hetero_dloop_size = -1; 96: #####: 83: new_dtp->hetero_dloop_depth = -1; 97: -: 84: 98: #####: 85: is_builtin = (HANDLE_GET_KIND(oldtype) == HANDLE_KIND_BUILTIN); 99: -: 86: 100: #####: 87: if (is_builtin) 105: -: 90: * they have no associated dataloop or datatype structure. 106: -: 91: */ 107: #####: 92: el_sz = MPID_Datatype_get_basic_size(oldtype); 108: #####: 93: old_sz = el_sz; 109: #####: 94: el_ct = 1; 110: #####: 95: el_type = oldtype; 111: -: 96: 112: #####: 97: old_lb = 0; 113: #####: 98: old_true_lb = 0; 114: #####: 99: old_ub = (MPI_Aint) el_sz; 115: #####: 100: old_true_ub = (MPI_Aint) el_sz; 116: #####: 101: old_extent = (MPI_Aint) el_sz; 117: #####: 102: old_is_contig = 1; 118: -: 103: 119: #####: 104: new_dtp->has_sticky_ub = 0; 120: #####: 105: new_dtp->has_sticky_lb = 0; 121: -: 106: 122: #####: 107: new_dtp->alignsize = el_sz; /* ??? */ 123: #####: 108: new_dtp->element_size = (MPI_Aint) el_sz; 124: #####: 109: new_dtp->eltype = el_type; 125: -: 110: 126: #####: 111: new_dtp->max_contig_blocks = count; 131: -: 116: MPID_Datatype *old_dtp; 132: -: 117: 133: #####: 118: MPID_Datatype_get_ptr(oldtype, old_dtp); 141: -: 121: MPID_Ensure_Aint_fits_in_int(old_dtp->element_size); 142: -: 122: 143: #####: 123: el_sz = old_dtp->element_size; 144: #####: 124: old_sz = old_dtp->size; 145: #####: 125: el_ct = old_dtp->n_elements; 146: #####: 126: el_type = old_dtp->eltype; 147: -: 127: 148: #####: 128: old_lb = old_dtp->lb; 149: #####: 129: old_true_lb = old_dtp->true_lb; 150: #####: 130: old_ub = old_dtp->ub; 151: #####: 131: old_true_ub = old_dtp->true_ub; 152: #####: 132: old_extent = old_dtp->extent; 153: #####: 133: old_is_contig = old_dtp->is_contig; 154: -: 134: 155: #####: 135: new_dtp->has_sticky_lb = old_dtp->has_sticky_lb; 156: #####: 136: new_dtp->has_sticky_ub = old_dtp->has_sticky_ub; 157: #####: 137: new_dtp->element_size = (MPI_Aint) el_sz; 158: #####: 138: new_dtp->eltype = el_type; 159: -: 139: 160: #####: 140: new_dtp->max_contig_blocks = 0; 161: #####: 141: for(i=0; imax_contig_blocks 168: -: 146: 169: -: 147: /* find the first nonzero blocklength element */ 170: #####: 148: i = 0; 171: #####: 149: while (i < count && blocklength_array[i] == 0) i++; 175: branch 3 never executed 176: -: 150: 177: #####: 151: if (i == count) { 178: branch 0 never executed 179: branch 1 never executed 180: #####: 152: MPIU_Handle_obj_free(&MPID_Datatype_mem, new_dtp); 181: call 0 never executed 182: #####: 153: return MPID_Type_zerolen(newtype); 185: -: 155: 186: -: 156: /* priming for loop */ 187: #####: 157: old_ct = blocklength_array[i]; 188: #####: 158: eff_disp = (dispinbytes) ? ((MPI_Aint *) displacement_array)[i] : 191: -: 159: (((MPI_Aint) ((int *) displacement_array)[i]) * old_extent); 192: -: 160: 193: #####: 161: MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint) blocklength_array[i], 206: -: 170: * nonzero size blocks 207: -: 171: */ 208: #####: 172: for (i++; i < count; i++) 212: -: 174: MPI_Aint tmp_lb, tmp_ub; 213: -: 175: 214: #####: 176: if (blocklength_array[i] > 0) { 215: branch 0 never executed 216: branch 1 never executed 217: #####: 177: old_ct += blocklength_array[i]; /* add more oldtypes */ 218: -: 178: 219: #####: 179: eff_disp = (dispinbytes) ? ((MPI_Aint *) displacement_array)[i] : 223: -: 181: 224: -: 182: /* calculate ub and lb for this block */ 225: #####: 183: MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint)(blocklength_array[i]), 235: -: 189: tmp_ub); 236: -: 190: 237: #####: 191: if (tmp_lb < min_lb) min_lb = tmp_lb; 238: branch 0 never executed 239: branch 1 never executed 240: #####: 192: if (tmp_ub > max_ub) max_ub = tmp_ub; 244: -: 194: } 245: -: 195: 246: #####: 196: new_dtp->size = old_ct * old_sz; 247: -: 197: 248: #####: 198: new_dtp->lb = min_lb; 249: #####: 199: new_dtp->ub = max_ub; 250: #####: 200: new_dtp->true_lb = min_lb + (old_true_lb - old_lb); 251: #####: 201: new_dtp->true_ub = max_ub + (old_true_ub - old_ub); 252: #####: 202: new_dtp->extent = max_ub - min_lb; 253: -: 203: 254: #####: 204: new_dtp->n_elements = old_ct * el_ct; 258: -: 208: * was also contiguous. 259: -: 209: */ 260: #####: 210: new_dtp->is_contig = 0; 261: #####: 211: if(old_is_contig) 263: branch 1 never executed 264: -: 212: { 265: #####: 213: contig_count = MPID_Type_indexed_count_contig(count, 269: -: 216: dispinbytes, 270: -: 217: old_extent); 271: #####: 218: new_dtp->max_contig_blocks = contig_count; 272: #####: 219: if( (contig_count == 1) && 277: -: 220: ((MPI_Aint) new_dtp->size == new_dtp->extent)) 278: -: 221: { 279: #####: 222: new_dtp->is_contig = 1; 281: -: 224: } 282: -: 225: 283: #####: 226: *newtype = new_dtp->handle; 284: #####: 227: return mpi_errno; 84 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_indexed.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_struct.c.gcov 49: -: 44: MPI_Aint *displacement_array) 50: function MPID_Type_struct_alignsize called 0 returned 0% blocks executed 0% 51: #####: 45:{ 52: #####: 46: int i, max_alignsize = 0, tmp_alignsize, derived_alignsize = 0; 53: -: 47: 54: #####: 48: for (i=0; i < count; i++) 57: -: 49: { 58: -: 50: /* shouldn't be called with an LB or UB, but we'll handle it nicely */ 59: #####: 51: if (oldtype_array[i] == MPI_LB || oldtype_array[i] == MPI_UB) continue; 60: branch 0 never executed 61: branch 1 never executed 62: #####: 52: else if (HANDLE_GET_KIND(oldtype_array[i]) == HANDLE_KIND_BUILTIN) 64: branch 1 never executed 65: -: 53: { 66: #####: 54: tmp_alignsize = MPID_Datatype_get_basic_size(oldtype_array[i]); 72: -: 60:#endif 73: -: 61: 74: #####: 62: switch(oldtype_array[i]) 97: -: 83: } 98: -: 84:#elif defined(HAVE_MAX_FP_ALIGNMENT) 99: #####: 85: if (tmp_alignsize > HAVE_MAX_FP_ALIGNMENT) 100: branch 0 never executed 101: branch 1 never executed 102: #####: 86: tmp_alignsize = HAVE_MAX_FP_ALIGNMENT; 113: -: 97: default: 114: -: 98:#ifdef HAVE_MAX_INTEGER_ALIGNMENT 115: #####: 99: if (tmp_alignsize > HAVE_MAX_INTEGER_ALIGNMENT) 116: branch 0 never executed 117: branch 1 never executed 118: #####: 100: tmp_alignsize = HAVE_MAX_INTEGER_ALIGNMENT; 132: -: 114: MPID_Datatype *dtp; 133: -: 115: 134: #####: 116: MPID_Datatype_get_ptr(oldtype_array[i], dtp); 138: branch 3 never executed 139: call 4 never executed 140: #####: 117: tmp_alignsize = dtp->alignsize; 141: #####: 118: if (derived_alignsize < tmp_alignsize) 142: branch 0 never executed 143: branch 1 never executed 144: #####: 119: derived_alignsize = tmp_alignsize; 145: -: 120: } 146: #####: 121: if (max_alignsize < tmp_alignsize) max_alignsize = tmp_alignsize; 150: -: 123: } 151: -: 124: 152: #####: 125: return max_alignsize; 175: -: 148: MPI_Datatype *newtype) 176: function MPID_Type_struct called 0 returned 0% blocks executed 0% 177: #####: 149:{ 178: #####: 150: int mpi_errno = MPI_SUCCESS; 179: #####: 151: int i, old_are_contig = 1, definitely_not_contig = 0; 180: #####: 152: int found_sticky_lb = 0, found_sticky_ub = 0, found_true_lb = 0, 181: #####: 153: found_true_ub = 0, found_el_type = 0; 182: #####: 154: MPI_Aint el_sz = 0; 183: #####: 155: int size = 0; 184: #####: 156: MPI_Datatype el_type = MPI_DATATYPE_NULL; 185: #####: 157: MPI_Aint true_lb_disp = 0, true_ub_disp = 0, sticky_lb_disp = 0, 186: #####: 158: sticky_ub_disp = 0; 188: -: 160: MPID_Datatype *new_dtp; 189: -: 161: 190: #####: 162: if (count == 0) return MPID_Type_zerolen(newtype); 204: -: 173: 205: -: 174: /* allocate new datatype object and handle */ 206: #####: 175: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 221: -: 186: 222: -: 187: /* handle is filled in by MPIU_Handle_obj_alloc() */ 223: #####: 188: MPIU_Object_set_ref(new_dtp, 1); 224: #####: 189: new_dtp->is_permanent = 0; 225: #####: 190: new_dtp->is_committed = 0; 226: #####: 191: new_dtp->attributes = NULL; 227: #####: 192: new_dtp->cache_id = 0; 228: #####: 193: new_dtp->name[0] = 0; 229: #####: 194: new_dtp->contents = NULL; 230: -: 195: 231: #####: 196: new_dtp->dataloop = NULL; 232: #####: 197: new_dtp->dataloop_size = -1; 233: #####: 198: new_dtp->dataloop_depth = -1; 234: #####: 199: new_dtp->hetero_dloop = NULL; 235: #####: 200: new_dtp->hetero_dloop_size = -1; 236: #####: 201: new_dtp->hetero_dloop_depth = -1; 237: -: 202: 238: -: 203: /* check for junk struct with all zero blocks */ 239: #####: 204: for (i=0; i < count; i++) if (blocklength_array[i] != 0) break; 243: branch 3 never executed 244: -: 205: 245: #####: 206: if (i == count) 247: branch 1 never executed 248: -: 207: { 249: #####: 208: MPIU_Handle_obj_free(&MPID_Datatype_mem, new_dtp); 250: call 0 never executed 251: #####: 209: return MPID_Type_zerolen(newtype); 253: -: 210: } 254: -: 211: 255: #####: 212: new_dtp->max_contig_blocks = 0; 256: #####: 213: for (i=0; i < count; i++) 259: -: 214: { 260: -: 215: int is_builtin = 261: #####: 216: (HANDLE_GET_KIND(oldtype_array[i]) == HANDLE_KIND_BUILTIN); 263: -: 218: MPI_Aint tmp_el_sz; 264: -: 219: MPI_Datatype tmp_el_type; 265: #####: 220: MPID_Datatype *old_dtp = NULL; 268: -: 223: * MPI_LB and MPI_UB. -- Rob Ross, 10/31/2005 269: -: 224: */ 270: #####: 225: if (blocklength_array[i] == 0) continue; 272: branch 1 never executed 273: -: 226: 274: #####: 227: if (is_builtin) 276: branch 1 never executed 277: -: 228: { 278: #####: 229: tmp_el_sz = MPID_Datatype_get_basic_size(oldtype_array[i]); 279: #####: 230: tmp_el_type = oldtype_array[i]; 280: -: 231: 281: #####: 232: MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint)(blocklength_array[i]), 290: -: 237: tmp_lb, 291: -: 238: tmp_ub); 292: #####: 239: tmp_true_lb = tmp_lb; 293: #####: 240: tmp_true_ub = tmp_ub; 294: -: 241: 295: #####: 242: size += tmp_el_sz * blocklength_array[i]; 296: -: 243: 297: #####: 244: new_dtp->max_contig_blocks++; 299: -: 246: else 300: -: 247: { 301: #####: 248: MPID_Datatype_get_ptr(oldtype_array[i], old_dtp); 309: -: 251: MPID_Ensure_Aint_fits_in_int(old_dtp->element_size); 310: -: 252: 311: #####: 253: tmp_el_sz = old_dtp->element_size; 312: #####: 254: tmp_el_type = old_dtp->eltype; 313: -: 255: 314: #####: 256: MPID_DATATYPE_BLOCK_LB_UB((MPI_Aint) blocklength_array[i], 323: -: 261: tmp_lb, 324: -: 262: tmp_ub); 325: #####: 263: tmp_true_lb = tmp_lb + (old_dtp->true_lb - old_dtp->lb); 326: #####: 264: tmp_true_ub = tmp_ub + (old_dtp->true_ub - old_dtp->ub); 327: -: 265: 328: #####: 266: size += old_dtp->size * blocklength_array[i]; 329: -: 267: 330: #####: 268: new_dtp->max_contig_blocks += old_dtp->max_contig_blocks; 332: -: 270: 333: -: 271: /* element size and type */ 334: #####: 272: if (oldtype_array[i] != MPI_LB && oldtype_array[i] != MPI_UB) 336: branch 1 never executed 337: -: 273: { 338: #####: 274: if (found_el_type == 0) 340: branch 1 never executed 341: -: 275: { 342: #####: 276: el_sz = tmp_el_sz; 343: #####: 277: el_type = tmp_el_type; 344: #####: 278: found_el_type = 1; 345: -: 279: } 346: #####: 280: else if (el_sz != tmp_el_sz) 348: branch 1 never executed 349: -: 281: { 350: #####: 282: el_sz = -1; 351: #####: 283: el_type = MPI_DATATYPE_NULL; 352: -: 284: } 353: #####: 285: else if (el_type != tmp_el_type) 356: -: 286: { 357: -: 287: /* Q: should we set el_sz = -1 even though the same? */ 358: #####: 288: el_type = MPI_DATATYPE_NULL; 361: -: 291: 362: -: 292: /* keep lowest sticky lb */ 363: #####: 293: if ((oldtype_array[i] == MPI_LB) || 370: -: 294: (!is_builtin && old_dtp->has_sticky_lb)) 371: -: 295: { 372: #####: 296: if (!found_sticky_lb) 374: branch 1 never executed 375: -: 297: { 376: #####: 298: found_sticky_lb = 1; 377: #####: 299: sticky_lb_disp = tmp_lb; 378: -: 300: } 379: #####: 301: else if (sticky_lb_disp > tmp_lb) 381: branch 1 never executed 382: -: 302: { 383: #####: 303: sticky_lb_disp = tmp_lb; 386: -: 306: 387: -: 307: /* keep highest sticky ub */ 388: #####: 308: if ((oldtype_array[i] == MPI_UB) || 395: -: 309: (!is_builtin && old_dtp->has_sticky_ub)) 396: -: 310: { 397: #####: 311: if (!found_sticky_ub) 399: branch 1 never executed 400: -: 312: { 401: #####: 313: found_sticky_ub = 1; 402: #####: 314: sticky_ub_disp = tmp_ub; 403: -: 315: } 404: #####: 316: else if (sticky_ub_disp < tmp_ub) 406: branch 1 never executed 407: -: 317: { 408: #####: 318: sticky_ub_disp = tmp_ub; 415: -: 325: * yet another pass over the arrays 416: -: 326: */ 417: #####: 327: if (oldtype_array[i] != MPI_UB && oldtype_array[i] != MPI_LB) 419: branch 1 never executed 420: -: 328: { 421: #####: 329: if (!found_true_lb) 423: branch 1 never executed 424: -: 330: { 425: #####: 331: found_true_lb = 1; 426: #####: 332: true_lb_disp = tmp_true_lb; 427: -: 333: } 428: #####: 334: else if (true_lb_disp > tmp_true_lb) 431: -: 335: { 432: -: 336: /* element starts before previous */ 433: #####: 337: true_lb_disp = tmp_true_lb; 434: #####: 338: definitely_not_contig = 1; 435: -: 339: } 436: -: 340: 437: #####: 341: if (!found_true_ub) 439: branch 1 never executed 440: -: 342: { 441: #####: 343: found_true_ub = 1; 442: #####: 344: true_ub_disp = tmp_true_ub; 443: -: 345: } 444: #####: 346: else if (true_ub_disp < tmp_true_ub) 446: branch 1 never executed 447: -: 347: { 448: #####: 348: true_ub_disp = tmp_true_ub; 450: -: 350: else { 451: -: 351: /* element ends before previous ended */ 452: #####: 352: definitely_not_contig = 1; 454: -: 354: } 455: -: 355: 456: #####: 356: if (!is_builtin && !old_dtp->is_contig) 460: branch 3 never executed 461: -: 357: { 462: #####: 358: old_are_contig = 0; 464: -: 360: } 465: -: 361: 466: #####: 362: new_dtp->n_elements = -1; /* TODO */ 467: #####: 363: new_dtp->element_size = el_sz; 468: #####: 364: new_dtp->eltype = el_type; 469: -: 365: 470: #####: 366: new_dtp->has_sticky_lb = found_sticky_lb; 471: #####: 367: new_dtp->true_lb = true_lb_disp; 472: #####: 368: new_dtp->lb = (found_sticky_lb) ? sticky_lb_disp : true_lb_disp; 474: branch 1 never executed 475: -: 369: 476: #####: 370: new_dtp->has_sticky_ub = found_sticky_ub; 477: #####: 371: new_dtp->true_ub = true_ub_disp; 478: #####: 372: new_dtp->ub = (found_sticky_ub) ? sticky_ub_disp : true_ub_disp; 480: branch 1 never executed 481: -: 373: 482: #####: 374: new_dtp->alignsize = MPID_Type_struct_alignsize(count, 485: -: 376: displacement_array); 486: -: 377: 487: #####: 378: new_dtp->extent = new_dtp->ub - new_dtp->lb; 488: #####: 379: if ((!found_sticky_lb) && (!found_sticky_ub)) 492: -: 381: /* account for padding */ 493: -: 382: MPI_Aint epsilon = (new_dtp->alignsize > 0) ? 494: #####: 383: new_dtp->extent % ((MPI_Aint)(new_dtp->alignsize)) : 0; 496: branch 1 never executed 497: -: 384: 498: #####: 385: if (epsilon) 500: branch 1 never executed 501: -: 386: { 502: #####: 387: new_dtp->ub += ((MPI_Aint)(new_dtp->alignsize) - epsilon); 503: #####: 388: new_dtp->extent = new_dtp->ub - new_dtp->lb; 505: -: 390: } 506: -: 391: 507: #####: 392: new_dtp->size = size; 511: -: 396: * something noncontiguous based on true ub/ub. 512: -: 397: */ 513: #####: 398: if (((MPI_Aint)(new_dtp->size) == new_dtp->extent) && 518: -: 399: old_are_contig && (! definitely_not_contig)) 519: -: 400: { 520: #####: 401: new_dtp->is_contig = 1; 522: -: 403: else 523: -: 404: { 524: #####: 405: new_dtp->is_contig = 0; 525: -: 406: } 526: -: 407: 527: #####: 408: *newtype = new_dtp->handle; 528: #####: 409: return mpi_errno; 126 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_struct.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_get_envelope.c.gcov 35: -: 30: int *combiner) 36: function MPID_Type_get_envelope called 0 returned 0% blocks executed 0% 37: #####: 31:{ 38: #####: 32: if (HANDLE_GET_KIND(datatype) == HANDLE_KIND_BUILTIN || 49: -: 37: datatype == MPI_LONG_DOUBLE_INT) 50: -: 38: { 51: #####: 39: *combiner = MPI_COMBINER_NAMED; 52: #####: 40: *num_integers = 0; 53: #####: 41: *num_addresses = 0; 54: #####: 42: *num_datatypes = 0; 57: -: 45: MPID_Datatype *dtp; 58: -: 46: 59: #####: 47: MPID_Datatype_get_ptr(datatype, dtp); 64: call 4 never executed 65: -: 48: 66: #####: 49: *combiner = dtp->contents->combiner; 67: #####: 50: *num_integers = dtp->contents->nr_ints; 68: #####: 51: *num_addresses = dtp->contents->nr_aints; 69: #####: 52: *num_datatypes = dtp->contents->nr_types; 70: -: 53: } 71: -: 54: 72: #####: 55: return MPI_SUCCESS; 12 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_get_envelope.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_datatype_free.c.gcov 41: -: 36:void MPID_Datatype_free(MPID_Datatype *ptr) 42: function MPID_Datatype_free called 0 returned 0% blocks executed 0% 43: #####: 37:{ 51: -: 45: null because it is null in the case of a datatype shipped to the target 52: -: 46: for RMA ops */ 53: #####: 47: if (ptr->contents) { 54: branch 0 never executed 55: branch 1 never executed 56: #####: 48: MPID_Datatype_free_contents(ptr); 57: call 0 never executed 58: -: 49: } 59: #####: 50: if (ptr->dataloop) { 60: branch 0 never executed 61: branch 1 never executed 62: #####: 51: MPID_Dataloop_free(&(ptr->dataloop)); 64: -: 52: } 65: -: 53:#if defined(MPID_HAS_HETERO) || 1 66: #####: 54: if (ptr->hetero_dloop) { 67: branch 0 never executed 68: branch 1 never executed 69: #####: 55: MPID_Dataloop_free(&(ptr->hetero_dloop)); 71: -: 56: } 72: -: 57:#endif /* MPID_HAS_HETERO */ 73: #####: 58: MPIU_Handle_obj_free(&MPID_Datatype_mem, ptr); 8 line(s) not covered by tests in src/mpid/common/datatype/mpid_datatype_free.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_datatype_contents.c.gcov 31: -: 26: MPI_Datatype array_of_types[]) 32: function MPID_Datatype_set_contents called 0 returned 0% blocks executed 0% 33: #####: 27:{ 34: #####: 28: int i, contents_size, align_sz = 8, epsilon, mpi_errno; 39: -: 33: 40: -: 34:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 41: #####: 35: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 42: branch 0 never executed 43: branch 1 never executed 44: #####: 36: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 46: -: 38:#endif 47: -: 39: 48: #####: 40: struct_sz = sizeof(MPID_Datatype_contents); 49: #####: 41: types_sz = nr_types * sizeof(MPI_Datatype); 50: #####: 42: ints_sz = nr_ints * sizeof(int); 51: #####: 43: aints_sz = nr_aints * sizeof(MPI_Aint); 56: -: 48: * because they are last in the region. 57: -: 49: */ 58: #####: 50: if ((epsilon = struct_sz % align_sz)) { 59: branch 0 never executed 60: branch 1 never executed 61: #####: 51: struct_sz += align_sz - epsilon; 62: -: 52: } 63: #####: 53: if ((epsilon = types_sz % align_sz)) { 64: branch 0 never executed 65: branch 1 never executed 66: #####: 54: types_sz += align_sz - epsilon; 67: -: 55: } 68: #####: 56: if ((epsilon = ints_sz % align_sz)) { 69: branch 0 never executed 70: branch 1 never executed 71: #####: 57: ints_sz += align_sz - epsilon; 72: -: 58: } 73: -: 59: 74: #####: 60: contents_size = struct_sz + types_sz + ints_sz + aints_sz; 75: -: 61: 76: #####: 62: cp = (MPID_Datatype_contents *) MPIU_Malloc(contents_size); 92: call 0 never executed 93: -: 75: 94: #####: 76: cp->combiner = combiner; 95: #####: 77: cp->nr_ints = nr_ints; 96: #####: 78: cp->nr_aints = nr_aints; 97: #####: 79: cp->nr_types = nr_types; 100: -: 82: * following the structure itself. 101: -: 83: */ 102: #####: 84: ptr = ((char *) cp) + struct_sz; 103: -: 85: /* Fortran90 combiner types do not have a "base" type */ 104: #####: 86: if (nr_types > 0) { 105: branch 0 never executed 106: branch 1 never executed 107: #####: 87: MPIU_Memcpy(ptr, array_of_types, nr_types * sizeof(MPI_Datatype)); 133: -: 88: } 134: -: 89: 135: #####: 90: ptr = ((char *) cp) + struct_sz + types_sz; 136: #####: 91: if (nr_ints > 0) { 137: branch 0 never executed 138: branch 1 never executed 139: #####: 92: MPIU_Memcpy(ptr, array_of_ints, nr_ints * sizeof(int)); 165: -: 93: } 166: -: 94: 167: #####: 95: ptr = ((char *) cp) + struct_sz + types_sz + ints_sz; 168: #####: 96: if (nr_aints > 0) { 169: branch 0 never executed 170: branch 1 never executed 171: #####: 97: MPIU_Memcpy(ptr, array_of_aints, nr_aints * sizeof(MPI_Aint)); 196: call 24 never executed 197: -: 98: } 198: #####: 99: new_dtp->contents = cp; 199: -: 100: 200: -: 101: /* increment reference counts on all the derived types used here */ 201: #####: 102: for (i=0; i < nr_types; i++) { 202: branch 0 never executed 203: branch 1 never executed 204: #####: 103: if (HANDLE_GET_KIND(array_of_types[i]) != HANDLE_KIND_BUILTIN) { 205: branch 0 never executed 206: branch 1 never executed 207: #####: 104: MPID_Datatype_get_ptr(array_of_types[i], old_dtp); 211: branch 3 never executed 212: call 4 never executed 213: #####: 105: MPID_Datatype_add_ref(old_dtp); 219: -: 107: } 220: -: 108: 221: #####: 109: return MPI_SUCCESS; 224: -: 112:void MPID_Datatype_free_contents(MPID_Datatype *dtp) 225: function MPID_Datatype_free_contents called 0 returned 0% blocks executed 0% 226: #####: 113:{ 227: #####: 114: int i, struct_sz = sizeof(MPID_Datatype_contents); 228: #####: 115: int align_sz = 8, epsilon; 230: -: 117: MPI_Datatype *array_of_types; 231: -: 118: 232: #####: 119: if ((epsilon = struct_sz % align_sz)) { 233: branch 0 never executed 234: branch 1 never executed 235: #####: 120: struct_sz += align_sz - epsilon; 237: -: 122: 238: -: 123: /* note: relies on types being first after structure */ 239: #####: 124: array_of_types = (MPI_Datatype *) ((char *)dtp->contents + struct_sz); 240: -: 125: 241: #####: 126: for (i=0; i < dtp->contents->nr_types; i++) { 242: branch 0 never executed 243: branch 1 never executed 244: #####: 127: if (HANDLE_GET_KIND(array_of_types[i]) != HANDLE_KIND_BUILTIN) { 245: branch 0 never executed 246: branch 1 never executed 247: #####: 128: MPID_Datatype_get_ptr(array_of_types[i], old_dtp); 251: branch 3 never executed 252: call 4 never executed 253: #####: 129: MPID_Datatype_release(old_dtp); 269: -: 131: } 270: -: 132: 271: #####: 133: MPIU_Free(dtp->contents); 272: call 0 never executed 273: #####: 134: dtp->contents = NULL; 277: -: 138: int *user_ints) 278: function MPIDI_Datatype_get_contents_ints called 0 returned 0% blocks executed 0% 279: #####: 139:{ 280: -: 140: char *ptr; 281: #####: 141: int align_sz = 8, epsilon; 283: -: 143: 284: -: 144:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 285: #####: 145: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 286: branch 0 never executed 287: branch 1 never executed 288: #####: 146: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 290: -: 148:#endif 291: -: 149: 292: #####: 150: struct_sz = sizeof(MPID_Datatype_contents); 293: #####: 151: types_sz = cp->nr_types * sizeof(MPI_Datatype); 298: -: 156: * because they are last in the region. 299: -: 157: */ 300: #####: 158: if ((epsilon = struct_sz % align_sz)) { 301: branch 0 never executed 302: branch 1 never executed 303: #####: 159: struct_sz += align_sz - epsilon; 304: -: 160: } 305: #####: 161: if ((epsilon = types_sz % align_sz)) { 306: branch 0 never executed 307: branch 1 never executed 308: #####: 162: types_sz += align_sz - epsilon; 309: -: 163: } 310: -: 164: 311: #####: 165: ptr = ((char *) cp) + struct_sz + types_sz; 312: #####: 166: MPIU_Memcpy(user_ints, ptr, cp->nr_ints * sizeof(int)); 343: -: 172: MPI_Aint *user_aints) 344: function MPIDI_Datatype_get_contents_aints called 0 returned 0% blocks executed 0% 345: #####: 173:{ 346: -: 174: char *ptr; 347: #####: 175: int align_sz = 8, epsilon; 349: -: 177: 350: -: 178:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 351: #####: 179: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 352: branch 0 never executed 353: branch 1 never executed 354: #####: 180: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 356: -: 182:#endif 357: -: 183: 358: #####: 184: struct_sz = sizeof(MPID_Datatype_contents); 359: #####: 185: types_sz = cp->nr_types * sizeof(MPI_Datatype); 360: #####: 186: ints_sz = cp->nr_ints * sizeof(int); 361: -: 187: /* FIXME: Why is this here? The value is never used. Should it be? */ 362: #####: 188: aints_sz = cp->nr_aints * sizeof(MPI_Aint); 367: -: 193: * because they are last in the region. 368: -: 194: */ 369: #####: 195: if ((epsilon = struct_sz % align_sz)) { 370: branch 0 never executed 371: branch 1 never executed 372: #####: 196: struct_sz += align_sz - epsilon; 373: -: 197: } 374: #####: 198: if ((epsilon = types_sz % align_sz)) { 375: branch 0 never executed 376: branch 1 never executed 377: #####: 199: types_sz += align_sz - epsilon; 378: -: 200: } 379: #####: 201: if ((epsilon = ints_sz % align_sz)) { 380: branch 0 never executed 381: branch 1 never executed 382: #####: 202: ints_sz += align_sz - epsilon; 383: -: 203: } 384: -: 204: 385: #####: 205: ptr = ((char *) cp) + struct_sz + types_sz + ints_sz; 386: #####: 206: MPIU_Memcpy(user_aints, ptr, cp->nr_aints * sizeof(MPI_Aint)); 417: -: 212: MPI_Datatype *user_types) 418: function MPIDI_Datatype_get_contents_types called 0 returned 0% blocks executed 0% 419: #####: 213:{ 420: -: 214: char *ptr; 421: #####: 215: int align_sz = 8, epsilon; 423: -: 217: 424: -: 218:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 425: #####: 219: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 426: branch 0 never executed 427: branch 1 never executed 428: #####: 220: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 430: -: 222:#endif 431: -: 223: 432: #####: 224: struct_sz = sizeof(MPID_Datatype_contents); 437: -: 229: * because they are last in the region. 438: -: 230: */ 439: #####: 231: if ((epsilon = struct_sz % align_sz)) { 440: branch 0 never executed 441: branch 1 never executed 442: #####: 232: struct_sz += align_sz - epsilon; 443: -: 233: } 444: -: 234: 445: #####: 235: ptr = ((char *) cp) + struct_sz; 446: #####: 236: MPIU_Memcpy(user_types, ptr, cp->nr_types * sizeof(MPI_Datatype)); 84 line(s) not covered by tests in src/mpid/common/datatype/mpid_datatype_contents.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_get_contents.c.gcov 39: -: 34: MPI_Datatype array_of_datatypes[]) 40: function MPID_Type_get_contents called 0 returned 0% blocks executed 0% 41: #####: 35:{ 66: -: 39: 67: -: 51: 68: #####: 52: MPID_Datatype_get_ptr(datatype, dtp); 72: branch 3 never executed 73: call 4 never executed 74: #####: 53: cp = dtp->contents; 75: #####: 54: MPIU_Assert(cp != NULL); 98: -: 55: 99: -: 67: 100: #####: 68: if (cp->nr_ints > 0) 102: branch 1 never executed 103: -: 69: { 104: #####: 70: MPIDI_Datatype_get_contents_ints(cp, array_of_integers); 106: -: 71: } 107: -: 72: 108: #####: 73: if (cp->nr_aints > 0) { 109: branch 0 never executed 110: branch 1 never executed 111: #####: 74: MPIDI_Datatype_get_contents_aints(cp, array_of_addresses); 113: -: 75: } 114: -: 76: 115: #####: 77: if (cp->nr_types > 0) { 116: branch 0 never executed 117: branch 1 never executed 118: #####: 78: MPIDI_Datatype_get_contents_types(cp, array_of_datatypes); 120: -: 79: } 121: -: 80: 122: #####: 81: for (i=0; i < cp->nr_types; i++) 124: branch 1 never executed 125: -: 82: { 126: #####: 83: if (HANDLE_GET_KIND(array_of_datatypes[i]) != HANDLE_KIND_BUILTIN) 128: branch 1 never executed 129: -: 84: { 130: #####: 85: MPID_Datatype_get_ptr(array_of_datatypes[i], dtp); 134: branch 3 never executed 135: call 4 never executed 136: #####: 86: MPID_Datatype_add_ref(dtp); 142: -: 88: } 143: -: 89: 144: #####: 90: return MPI_SUCCESS; 15 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_get_contents.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_type_create_pairtype.c.gcov 71: -: 66: MPID_Datatype *new_dtp) 72: function MPID_Type_create_pairtype called 0 returned 0% blocks executed 0% 73: #####: 67:{ 74: #####: 68: int err, mpi_errno = MPI_SUCCESS; 77: -: 71: 78: -: 72: /* handle is filled in by MPIU_Handle_obj_alloc() */ 79: #####: 73: MPIU_Object_set_ref(new_dtp, 1); 80: #####: 74: new_dtp->is_permanent = 1; 81: #####: 75: new_dtp->is_committed = 1; /* predefined types are pre-committed */ 82: #####: 76: new_dtp->attributes = NULL; 83: #####: 77: new_dtp->cache_id = 0; 84: #####: 78: new_dtp->name[0] = 0; 85: #####: 79: new_dtp->contents = NULL; 86: -: 80: 87: #####: 81: new_dtp->dataloop = NULL; 88: #####: 82: new_dtp->dataloop_size = -1; 89: #####: 83: new_dtp->dataloop_depth = -1; 90: #####: 84: new_dtp->hetero_dloop = NULL; 91: #####: 85: new_dtp->hetero_dloop_size = -1; 92: #####: 86: new_dtp->hetero_dloop_depth = -1; 93: -: 87: 94: #####: 88: switch(type) { 100: branch 5 never executed 101: -: 89: case MPI_FLOAT_INT: 102: #####: 90: PAIRTYPE_SIZE_EXTENT(MPI_FLOAT, float, MPI_INT, int); 103: #####: 91: break; 104: -: 92: case MPI_DOUBLE_INT: 105: #####: 93: PAIRTYPE_SIZE_EXTENT(MPI_DOUBLE, double, MPI_INT, int); 106: #####: 94: break; 107: -: 95: case MPI_LONG_INT: 108: #####: 96: PAIRTYPE_SIZE_EXTENT(MPI_LONG, long, MPI_INT, int); 109: #####: 97: break; 110: -: 98: case MPI_SHORT_INT: 111: #####: 99: PAIRTYPE_SIZE_EXTENT(MPI_SHORT, short, MPI_INT, int); 112: #####: 100: break; 113: -: 101: case MPI_LONG_DOUBLE_INT: 114: #####: 102: PAIRTYPE_SIZE_EXTENT(MPI_LONG_DOUBLE, long double, MPI_INT, int); 115: #####: 103: break; 127: -: 114: } 128: -: 115: 129: #####: 116: new_dtp->n_elements = 2; 130: #####: 117: new_dtp->element_size = el_size; 131: #####: 118: new_dtp->eltype = MPI_DATATYPE_NULL; 132: -: 119: 133: #####: 120: new_dtp->has_sticky_lb = 0; 134: #####: 121: new_dtp->true_lb = 0; 135: #####: 122: new_dtp->lb = 0; 136: -: 123: 137: #####: 124: new_dtp->has_sticky_ub = 0; 138: #####: 125: new_dtp->true_ub = true_ub; 139: -: 126: 140: #####: 127: new_dtp->size = type_size; 141: #####: 128: new_dtp->ub = type_extent; /* possible padding */ 142: #####: 129: new_dtp->extent = type_extent; 143: #####: 130: new_dtp->alignsize = alignsize; 146: -: 133: /* There are some really wierd rules for structure alignment; 147: -: 134: these capture the ones of which we are aware. */ 148: #####: 135: switch(type) { 155: -: 137: case MPI_LONG_INT: 156: -: 138:#ifdef HAVE_MAX_INTEGER_ALIGNMENT 157: #####: 139: new_dtp->alignsize = MPIR_MIN(new_dtp->alignsize, 158: -: 140: HAVE_MAX_INTEGER_ALIGNMENT); 159: -: 141:#endif 160: #####: 142: break; 161: -: 143: case MPI_FLOAT_INT: 162: -: 144:#ifdef HAVE_MAX_FP_ALIGNMENT 163: #####: 145: new_dtp->alignsize = MPIR_MIN(new_dtp->alignsize, 164: -: 146: HAVE_MAX_FP_ALIGNMENT); 165: -: 147:#endif 166: #####: 148: break; 170: -: 152: HAVE_MAX_DOUBLE_FP_ALIGNMENT); 171: -: 153:#elif defined(HAVE_MAX_FP_ALIGNMENT) 172: #####: 154: new_dtp->alignsize = MPIR_MIN(new_dtp->alignsize, 173: -: 155: HAVE_MAX_FP_ALIGNMENT); 174: -: 156:#endif 175: #####: 157: break; 179: -: 161: HAVE_MAX_LONG_DOUBLE_FP_ALIGNMENT); 180: -: 162:#elif defined(HAVE_MAX_FP_ALIGNMENT) 181: #####: 163: new_dtp->alignsize = MPIR_MIN(new_dtp->alignsize, 185: -: 167: } 186: -: 168: 187: #####: 169: new_dtp->is_contig = (((MPI_Aint) type_size) == type_extent) ? 1 : 0; 188: #####: 170: new_dtp->max_contig_blocks = (((MPI_Aint) type_size) == type_extent) ? 1 : 2; 207: -: 187: MPID_DATALOOP_ALL_BYTES); 208: -: 188:#else 209: #####: 189: err = MPID_Dataloop_create_pairtype(type, 215: -: 194:#endif 216: -: 195: 217: #####: 196: if (!err) { 218: branch 0 never executed 219: branch 1 never executed 220: #####: 197: err = MPID_Dataloop_create_pairtype(type, 243: -: 203: 244: -: 217: 245: #####: 218: return mpi_errno; 52 line(s) not covered by tests in src/mpid/common/datatype/mpid_type_create_pairtype.c.gcov Uncovered lines in src/mpid/common/datatype/mpid_contents_support.c.gcov 19: -: 14: MPI_Datatype **types_p) 20: function MPID_Type_access_contents called 0 returned 0% blocks executed 0% 21: #####: 15:{ 22: -: 16: int nr_ints, nr_aints, nr_types, combiner; 23: #####: 17: int types_sz, struct_sz, ints_sz, epsilon, align_sz = 8; 25: -: 19: MPID_Datatype_contents *cp; 26: -: 20: 27: #####: 21: NMPI_Type_get_envelope(type, &nr_ints, &nr_aints, &nr_types, &combiner); 28: call 0 never executed 29: #####: 22: DLOOP_Assert(combiner != MPI_COMBINER_NAMED); 34: -: 23: 35: -: 24: /* hardcoded handling of MPICH2 contents format... */ 36: #####: 25: MPID_Datatype_get_ptr(type, dtp); 40: branch 3 never executed 41: call 4 never executed 42: #####: 26: DLOOP_Assert(dtp != NULL); 46: call 3 never executed 47: -: 27: 48: #####: 28: cp = dtp->contents; 49: #####: 29: DLOOP_Assert(cp != NULL); 54: -: 30: 55: -: 31:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 56: #####: 32: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 57: branch 0 never executed 58: branch 1 never executed 59: #####: 33: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 61: -: 35:#endif 62: -: 36: 63: #####: 37: struct_sz = sizeof(MPID_Datatype_contents); 64: #####: 38: types_sz = nr_types * sizeof(MPI_Datatype); 65: #####: 39: ints_sz = nr_ints * sizeof(int); 66: -: 40: 67: #####: 41: if ((epsilon = struct_sz % align_sz)) { 68: branch 0 never executed 69: branch 1 never executed 70: #####: 42: struct_sz += align_sz - epsilon; 71: -: 43: } 72: #####: 44: if ((epsilon = types_sz % align_sz)) { 73: branch 0 never executed 74: branch 1 never executed 75: #####: 45: types_sz += align_sz - epsilon; 76: -: 46: } 77: #####: 47: if ((epsilon = ints_sz % align_sz)) { 78: branch 0 never executed 79: branch 1 never executed 80: #####: 48: ints_sz += align_sz - epsilon; 81: -: 49: } 82: #####: 50: *types_p = (MPI_Datatype *) (((char *) cp) + struct_sz); 83: #####: 51: *ints_p = (int *) (((char *) (*types_p)) + types_sz); 84: #####: 52: *aints_p = (MPI_Aint *) (((char *) (*ints_p)) + ints_sz); 96: -: 64: MPI_Datatype **types_p) 97: function MPID_Type_release_contents called 0 returned 0% blocks executed 0% 98: #####: 65:{ 23 line(s) not covered by tests in src/mpid/common/datatype/mpid_contents_support.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/mpiimpl.h.gcov 115: -: 110:static MPIU_DBG_INLINE_KEYWORD void MPIUI_Memcpy(void * dst, const void * src, size_t len) 116: function MPIUI_Memcpy called 0 returned 0% blocks executed 0% 117: #####: 111:{ 118: #####: 112: memcpy(dst, src, len); 2 line(s) not covered by tests in src/mpid/common/datatype/dataloop/mpiimpl.h.gcov Uncovered lines in src/mpid/common/datatype/dataloop/segment.c.gcov 58: -: 53: int flag) 59: function MPID_Segment_init called 0 returned 0% blocks executed 0% 60: #####: 54:{ 61: #####: 55: DLOOP_Offset elmsize = 0; 62: #####: 56: int i, depth = 0; 63: #####: 57: int branch_detected = 0; 64: -: 58: 65: -: 59: struct DLOOP_Dataloop_stackelm *elmp; 66: #####: 60: struct DLOOP_Dataloop *dlp = 0, *sblp = &segp->builtin_loop; 67: -: 61: 68: #####: 62: DLOOP_Assert(flag == DLOOP_DATALOOP_HETEROGENEOUS || 80: -: 70:#endif 81: -: 71: 82: #####: 72: if (!DLOOP_Handle_hasloop_macro(handle)) { 85: -: 73: /* simplest case; datatype has no loop (basic) */ 86: -: 74: 87: #####: 75: DLOOP_Handle_get_size_macro(handle, elmsize); 92: call 4 never executed 93: -: 76: 94: #####: 77: sblp->kind = DLOOP_KIND_CONTIG | DLOOP_FINAL_MASK; 95: #####: 78: sblp->loop_params.c_t.count = count; 96: #####: 79: sblp->loop_params.c_t.dataloop = 0; 97: #####: 80: sblp->el_size = elmsize; 98: #####: 81: DLOOP_Handle_get_basic_type_macro(handle, sblp->el_type); 102: branch 3 never executed 103: call 4 never executed 104: #####: 82: DLOOP_Handle_get_extent_macro(handle, sblp->el_extent); 108: call 3 never executed 109: -: 83: 110: #####: 84: dlp = sblp; 111: #####: 85: depth = 1; 112: -: 86: } 113: #####: 87: else if (count == 0) { 115: branch 1 never executed 116: -: 88: /* only use the builtin */ 117: #####: 89: sblp->kind = DLOOP_KIND_CONTIG | DLOOP_FINAL_MASK; 118: #####: 90: sblp->loop_params.c_t.count = 0; 119: #####: 91: sblp->loop_params.c_t.dataloop = 0; 120: #####: 92: sblp->el_size = 0; 121: #####: 93: sblp->el_extent = 0; 122: -: 94: 123: #####: 95: dlp = sblp; 124: #####: 96: depth = 1; 125: -: 97: } 126: #####: 98: else if (count == 1) { 128: branch 1 never executed 129: -: 99: /* don't use the builtin */ 130: #####: 100: DLOOP_Handle_get_loopptr_macro(handle, dlp, flag); 137: branch 6 never executed 138: branch 7 never executed 139: #####: 101: DLOOP_Handle_get_loopdepth_macro(handle, depth, flag); 155: -: 109: DLOOP_Type el_type; 156: -: 110: 157: #####: 111: DLOOP_Handle_get_loopdepth_macro(handle, depth, flag); 164: branch 6 never executed 165: branch 7 never executed 166: #####: 112: if (depth >= DLOOP_MAX_DATATYPE_DEPTH) return -1; 168: branch 1 never executed 169: -: 113: 170: #####: 114: DLOOP_Handle_get_loopptr_macro(handle, oldloop, flag); 177: branch 6 never executed 178: branch 7 never executed 179: #####: 115: DLOOP_Assert(oldloop != NULL); 182: call 2 never executed 183: call 3 never executed 184: #####: 116: DLOOP_Handle_get_size_macro(handle, type_size); 188: branch 3 never executed 189: call 4 never executed 190: #####: 117: DLOOP_Handle_get_extent_macro(handle, type_extent); 193: branch 2 never executed 194: call 3 never executed 195: #####: 118: DLOOP_Handle_get_basic_type_macro(handle, el_type); 200: call 4 never executed 201: -: 119: 202: #####: 120: if (depth == 1 && ((oldloop->kind & DLOOP_KIND_MASK) == DLOOP_KIND_CONTIG)) 206: branch 3 never executed 207: -: 121: { 208: #####: 122: if (type_size == type_extent) 211: -: 123: { 212: -: 124: /* use a contig */ 213: #####: 125: sblp->kind = DLOOP_KIND_CONTIG | DLOOP_FINAL_MASK; 214: #####: 126: sblp->loop_params.c_t.count = count * oldloop->loop_params.c_t.count; 215: #####: 127: sblp->loop_params.c_t.dataloop = NULL; 216: #####: 128: sblp->el_size = oldloop->el_size; 217: #####: 129: sblp->el_extent = oldloop->el_extent; 218: #####: 130: sblp->el_type = oldloop->el_type; 221: -: 133: { 222: -: 134: /* use a vector, with extent of original type becoming the stride */ 223: #####: 135: sblp->kind = DLOOP_KIND_VECTOR | DLOOP_FINAL_MASK; 224: #####: 136: sblp->loop_params.v_t.count = count; 225: #####: 137: sblp->loop_params.v_t.blocksize = oldloop->loop_params.c_t.count; 226: #####: 138: sblp->loop_params.v_t.stride = type_extent; 227: #####: 139: sblp->loop_params.v_t.dataloop = NULL; 228: #####: 140: sblp->el_size = oldloop->el_size; 229: #####: 141: sblp->el_extent = oldloop->el_extent; 230: #####: 142: sblp->el_type = oldloop->el_type; 234: -: 146: { 235: -: 147: /* general case */ 236: #####: 148: sblp->kind = DLOOP_KIND_CONTIG; 237: #####: 149: sblp->loop_params.c_t.count = count; 238: #####: 150: sblp->loop_params.c_t.dataloop = oldloop; 239: #####: 151: sblp->el_size = type_size; 240: #####: 152: sblp->el_extent = type_extent; 241: #####: 153: sblp->el_type = el_type; 242: -: 154: 243: #####: 155: depth++; /* we're adding to the depth with the builtin */ 244: -: 156: } 245: -: 157: 246: #####: 158: dlp = sblp; 248: -: 160: 249: -: 161: /* initialize the rest of the segment values */ 250: #####: 162: segp->handle = handle; 251: #####: 163: segp->ptr = (DLOOP_Buffer) buf; 252: #####: 164: segp->stream_off = 0; 253: #####: 165: segp->cur_sp = 0; 254: #####: 166: segp->valid_sp = 0; 255: -: 167: 256: -: 168: /* initialize the first stackelm in its entirety */ 257: #####: 169: elmp = &(segp->stackelm[0]); 258: #####: 170: DLOOP_Stackelm_load(elmp, dlp, 0); 259: call 0 never executed 260: #####: 171: branch_detected = elmp->may_require_reloading; 261: -: 172: 262: -: 173: /* Fill in parameters not set by DLOOP_Stackelm_load */ 263: #####: 174: elmp->orig_offset = 0; 264: #####: 175: elmp->curblock = elmp->orig_block; 265: -: 176: /* DLOOP_Stackelm_offset assumes correct orig_count, curcount, loop_p */ 266: #####: 177: elmp->curoffset = /* elmp->orig_offset + */ DLOOP_Stackelm_offset(elmp); 267: call 0 never executed 268: -: 178: 269: #####: 179: i = 1; 270: #####: 180: while(!(dlp->kind & DLOOP_FINAL_MASK)) 273: -: 181: { 274: -: 182: /* get pointer to next dataloop */ 275: #####: 183: switch (dlp->kind & DLOOP_KIND_MASK) 282: -: 187: case DLOOP_KIND_BLOCKINDEXED: 283: -: 188: case DLOOP_KIND_INDEXED: 284: #####: 189: dlp = dlp->loop_params.cm_t.dataloop; 285: #####: 190: break; 286: -: 191: case DLOOP_KIND_STRUCT: 287: #####: 192: dlp = dlp->loop_params.s_t.dataloop_array[0]; 288: #####: 193: break; 299: -: 202: * the rest are filled in at processing time. 300: -: 203: */ 301: #####: 204: elmp = &(segp->stackelm[i]); 302: -: 205: 303: #####: 206: DLOOP_Stackelm_load(elmp, dlp, branch_detected); 304: call 0 never executed 305: #####: 207: branch_detected = elmp->may_require_reloading; 306: #####: 208: i++; 308: -: 210: } 309: -: 211: 310: #####: 212: segp->valid_sp = depth-1; 311: -: 213: 312: #####: 214: return 0; 318: -: 220:struct DLOOP_Segment * PREPEND_PREFIX(Segment_alloc)(void) 319: function MPID_Segment_alloc called 0 returned 0% blocks executed 0% 320: #####: 221:{ 321: #####: 222: return (struct DLOOP_Segment *) DLOOP_Malloc(sizeof(struct DLOOP_Segment)); 330: -: 230:void PREPEND_PREFIX(Segment_free)(struct DLOOP_Segment *segp) 331: function MPID_Segment_free called 0 returned 0% blocks executed 0% 332: #####: 231:{ 333: #####: 232: DLOOP_Free(segp); 459: -: 357: void *pieceparams) 460: function MPID_Segment_manipulate called 0 returned 0% blocks executed 0% 461: #####: 358:{ 465: -: 362: 466: -: 363: struct DLOOP_Dataloop_stackelm *cur_elmp; 467: #####: 364: enum { PF_NULL, PF_CONTIG, PF_VECTOR, PF_BLOCKINDEXED, PF_INDEXED } piecefn_type = PF_NULL; 468: -: 365: 469: #####: 366: DLOOP_SEGMENT_LOAD_LOCAL_VALUES; 470: -: 367: 471: #####: 368: if (first == *lastp) { 473: branch 1 never executed 474: -: 369: /* nothing to do */ 475: #####: 370: DLOOP_dbg_printf("dloop_segment_manipulate: warning: first == last (" MPI_AINT_FMT_DEC_SPEC ")\n", first); 476: call 0 never executed 477: #####: 371: return; 479: -: 373: 480: -: 374: /* first we ensure that stream_off and first are in the same spot */ 481: #####: 375: if (first != stream_off) { 487: -: 379:#endif 488: -: 380: 489: #####: 381: if (first < stream_off) { 490: branch 0 never executed 491: branch 1 never executed 492: #####: 382: DLOOP_SEGMENT_RESET_VALUES; 493: call 0 never executed 494: call 1 never executed 495: #####: 383: stream_off = 0; 496: -: 384: } 497: -: 385: 498: #####: 386: if (first != stream_off) { 499: branch 0 never executed 500: branch 1 never executed 501: #####: 387: DLOOP_Offset tmp_last = first; 504: -: 390: * stream offset 505: -: 391: */ 506: #####: 392: PREPEND_PREFIX(Segment_manipulate)(segp, 525: -: 406: } 526: -: 407: 527: #####: 408: DLOOP_SEGMENT_LOAD_LOCAL_VALUES; 541: -: 422:#endif 542: -: 423: 543: #####: 424: if (cur_elmp->loop_p->kind & DLOOP_FINAL_MASK) { 544: branch 0 never executed 545: branch 1 never executed 546: #####: 425: int piecefn_indicated_exit = -1; 549: -: 428: 550: -: 429: /* structs are never finals (leaves) */ 551: #####: 430: DLOOP_Assert((cur_elmp->loop_p->kind & DLOOP_KIND_MASK) != 557: -: 432: 558: -: 433: /* pop immediately on zero count */ 559: #####: 434: if (cur_elmp->curcount == 0) DLOOP_SEGMENT_POP_AND_MAYBE_EXIT; 566: -: 437: * the elementary type. 567: -: 438: */ 568: #####: 439: local_el_size = cur_elmp->loop_p->el_size; 569: #####: 440: el_type = cur_elmp->loop_p->el_type; 570: #####: 441: stream_el_size = (sizefn) ? sizefn(el_type) : local_el_size; 576: -: 444: * default is to use the contig piecefn (if there is one). 577: -: 445: */ 578: #####: 446: myblocks = cur_elmp->curblock; 579: #####: 447: piecefn_type = (contigfn ? PF_CONTIG : PF_NULL); 580: -: 448: 581: -: 449: /* check for opportunities to use other piecefns */ 582: #####: 450: switch (cur_elmp->loop_p->kind & DLOOP_KIND_MASK) { 590: -: 453: case DLOOP_KIND_BLOCKINDEXED: 591: -: 454: /* only use blkidx piecefn if at start of blkidx type */ 592: #####: 455: if (blkidxfn && 601: -: 458: { 602: -: 459: /* TODO: RELAX CONSTRAINTS */ 603: #####: 460: myblocks = cur_elmp->curblock * cur_elmp->curcount; 604: #####: 461: piecefn_type = PF_BLOCKINDEXED; 610: -: 467: * block test checks that we haven't made progress on first block. 611: -: 468: */ 612: #####: 469: if (indexfn && 621: -: 472: { 622: -: 473: /* TODO: RELAX CONSTRAINT ON COUNT? */ 623: #####: 474: myblocks = cur_elmp->loop_p->loop_params.i_t.total_blocks; 624: #####: 475: piecefn_type = PF_INDEXED; 629: -: 480: * contiguous block. 630: -: 481: */ 631: #####: 482: if (vectorfn && cur_elmp->orig_block == cur_elmp->curblock) 635: branch 3 never executed 636: -: 483: { 637: #####: 484: myblocks = cur_elmp->curblock * cur_elmp->curcount; 638: #####: 485: piecefn_type = PF_VECTOR; 655: -: 500: 656: -: 501: /* enforce the last parameter if necessary by reducing myblocks */ 657: #####: 502: if (last != SEGMENT_IGNORE_LAST && 662: -: 503: (stream_off + (myblocks * stream_el_size) > last)) 663: -: 504: { 664: #####: 505: myblocks = ((last - stream_off) / stream_el_size); 668: -: 509: myblocks * stream_el_size); 669: -: 510:#endif 670: #####: 511: if (myblocks == 0) { 671: branch 0 never executed 672: branch 1 never executed 673: #####: 512: DLOOP_SEGMENT_SAVE_LOCAL_VALUES; 674: #####: 513: return; 677: -: 516: 678: -: 517: /* call piecefn to perform data manipulation */ 679: #####: 518: switch (piecefn_type) { 685: branch 5 never executed 686: -: 519: case PF_NULL: 687: #####: 520: piecefn_indicated_exit = 0; 689: -: 522: DLOOP_dbg_printf("\tNULL piecefn for this piece\n"); 690: -: 523:#endif 691: #####: 524: break; 692: -: 525: case PF_CONTIG: 693: #####: 526: DLOOP_Assert(myblocks <= cur_elmp->curblock); 696: call 2 never executed 697: call 3 never executed 698: #####: 527: piecefn_indicated_exit = 703: -: 531: segp->ptr, /* start of buffer (from segment) */ 704: -: 532: pieceparams); 705: #####: 533: break; 706: -: 534: case PF_VECTOR: 707: #####: 535: piecefn_indicated_exit = 715: -: 542: segp->ptr, 716: -: 543: pieceparams); 717: #####: 544: break; 718: -: 545: case PF_BLOCKINDEXED: 719: #####: 546: piecefn_indicated_exit = 727: -: 553: segp->ptr, 728: -: 554: pieceparams); 729: #####: 555: break; 730: -: 556: case PF_INDEXED: 731: #####: 557: piecefn_indicated_exit = 745: -: 570: * piecefn_indicated_exit) 746: -: 571: */ 747: #####: 572: DLOOP_Assert(piecefn_indicated_exit >= 0); 750: call 2 never executed 751: call 3 never executed 752: #####: 573: DLOOP_Assert(myblocks >= 0); 755: call 2 never executed 756: call 3 never executed 757: #####: 574: stream_off += myblocks * stream_el_size; 760: -: 577: * that we should stop processing and return. 761: -: 578: */ 762: #####: 579: if (myblocks == 0) { 763: branch 0 never executed 764: branch 1 never executed 765: #####: 580: DLOOP_SEGMENT_SAVE_LOCAL_VALUES; 766: #####: 581: return; 767: -: 582: } 768: #####: 583: else if (myblocks < (DLOOP_Offset)(cur_elmp->curblock)) { 769: branch 0 never executed 770: branch 1 never executed 771: #####: 584: cur_elmp->curoffset += myblocks * local_el_size; 772: #####: 585: cur_elmp->curblock -= myblocks; 773: -: 586: 774: #####: 587: DLOOP_SEGMENT_SAVE_LOCAL_VALUES; 775: #####: 588: return; 776: -: 589: } 777: -: 590: else /* myblocks >= cur_elmp->curblock */ { 778: #####: 591: int count_index = 0; 783: -: 596: */ 784: -: 597: 785: #####: 598: switch (cur_elmp->loop_p->kind & DLOOP_KIND_MASK) { 790: branch 4 never executed 791: -: 599: case DLOOP_KIND_INDEXED: 792: #####: 600: while (myblocks > 0 && myblocks >= (DLOOP_Offset)(cur_elmp->curblock)) { 795: branch 2 never executed 796: branch 3 never executed 797: #####: 601: myblocks -= (DLOOP_Offset)(cur_elmp->curblock); 798: #####: 602: cur_elmp->curcount--; 799: #####: 603: DLOOP_Assert(cur_elmp->curcount >= 0); 803: call 3 never executed 804: -: 604: 805: #####: 605: count_index = cur_elmp->orig_count - 806: -: 606: cur_elmp->curcount; 807: #####: 607: cur_elmp->curblock = 810: -: 610: } 811: -: 611: 812: #####: 612: if (cur_elmp->curcount == 0) { 814: branch 1 never executed 815: -: 613: /* don't bother to fill in values; we're popping anyway */ 816: #####: 614: DLOOP_Assert(myblocks == 0); 819: call 2 never executed 820: call 3 never executed 821: #####: 615: DLOOP_SEGMENT_POP_AND_MAYBE_EXIT; 824: -: 616: } 825: -: 617: else { 826: #####: 618: cur_elmp->orig_block = cur_elmp->curblock; 827: #####: 619: cur_elmp->curoffset = cur_elmp->orig_offset + 829: -: 621: count_index); 830: -: 622: 831: #####: 623: cur_elmp->curblock -= myblocks; 832: #####: 624: cur_elmp->curoffset += myblocks * local_el_size; 835: -: 627: case DLOOP_KIND_VECTOR: 836: -: 628: /* this math relies on assertions at top of code block */ 837: #####: 629: cur_elmp->curcount -= myblocks / (DLOOP_Offset)(cur_elmp->curblock); 838: #####: 630: if (cur_elmp->curcount == 0) { 839: branch 0 never executed 840: branch 1 never executed 841: #####: 631: DLOOP_Assert(myblocks % ((DLOOP_Offset)(cur_elmp->curblock)) == 0); 844: call 2 never executed 845: call 3 never executed 846: #####: 632: DLOOP_SEGMENT_POP_AND_MAYBE_EXIT; 852: -: 636: * block 853: -: 637: */ 854: #####: 638: cur_elmp->curblock = cur_elmp->orig_block - 858: -: 642: * leftover bytes 859: -: 643: */ 860: #####: 644: cur_elmp->curoffset = cur_elmp->orig_offset + 869: -: 653: * completely processed 870: -: 654: */ 871: #####: 655: DLOOP_Assert(myblocks == (DLOOP_Offset)(cur_elmp->curblock) && 877: call 5 never executed 878: -: 656: cur_elmp->curcount == 1); 879: #####: 657: DLOOP_SEGMENT_POP_AND_MAYBE_EXIT; 882: -: 658: break; 883: -: 659: case DLOOP_KIND_BLOCKINDEXED: 884: #####: 660: while (myblocks > 0 && myblocks >= (DLOOP_Offset)(cur_elmp->curblock)) 888: branch 3 never executed 889: -: 661: { 890: #####: 662: myblocks -= (DLOOP_Offset)(cur_elmp->curblock); 891: #####: 663: cur_elmp->curcount--; 892: #####: 664: DLOOP_Assert(cur_elmp->curcount >= 0); 896: call 3 never executed 897: -: 665: 898: #####: 666: count_index = cur_elmp->orig_count - 899: -: 667: cur_elmp->curcount; 900: #####: 668: cur_elmp->curblock = cur_elmp->orig_block; 901: -: 669: } 902: #####: 670: if (cur_elmp->curcount == 0) { 904: branch 1 never executed 905: -: 671: /* popping */ 906: #####: 672: DLOOP_Assert(myblocks == 0); 909: call 2 never executed 910: call 3 never executed 911: #####: 673: DLOOP_SEGMENT_POP_AND_MAYBE_EXIT; 915: -: 675: else { 916: -: 676: /* cur_elmp->orig_block = cur_elmp->curblock; */ 917: #####: 677: cur_elmp->curoffset = cur_elmp->orig_offset + 918: -: 678: DLOOP_STACKELM_BLOCKINDEXED_OFFSET(cur_elmp, 919: -: 679: count_index); 920: #####: 680: cur_elmp->curblock -= myblocks; 921: #####: 681: cur_elmp->curoffset += myblocks * local_el_size; 925: -: 685: } 926: -: 686: 927: #####: 687: if (piecefn_indicated_exit) { 929: branch 1 never executed 930: -: 688: /* piece function indicated that we should quit processing */ 931: #####: 689: DLOOP_SEGMENT_SAVE_LOCAL_VALUES; 932: #####: 690: return; 933: -: 691: } 934: -: 692: } /* end of if leaf */ 935: #####: 693: else if (cur_elmp->curblock == 0) { 940: -: 696: (unsigned) cur_elmp, cur_sp); 941: -: 697:#endif 942: #####: 698: cur_elmp->curcount--; 945: -: 701: * reset curblock for all types 946: -: 702: */ 947: #####: 703: switch (cur_elmp->loop_p->kind & DLOOP_KIND_MASK) { 955: -: 707: break; 956: -: 708: case DLOOP_KIND_INDEXED: 957: #####: 709: cur_elmp->orig_block = 959: branch 1 never executed 960: -: 710: DLOOP_STACKELM_INDEXED_BLOCKSIZE(cur_elmp, cur_elmp->curcount ? cur_elmp->orig_count - cur_elmp->curcount : 0); 961: #####: 711: break; 962: -: 712: case DLOOP_KIND_STRUCT: 963: #####: 713: cur_elmp->orig_block = 965: branch 1 never executed 966: -: 714: DLOOP_STACKELM_STRUCT_BLOCKSIZE(cur_elmp, cur_elmp->curcount ? cur_elmp->orig_count - cur_elmp->curcount : 0); 967: #####: 715: break; 974: -: 716: default: 975: -: 721: } 976: #####: 722: cur_elmp->curblock = cur_elmp->orig_block; 977: -: 723: 978: #####: 724: if (cur_elmp->curcount == 0) { 983: -: 727: (unsigned) cur_elmp, cur_sp); 984: -: 728:#endif 985: #####: 729: DLOOP_SEGMENT_POP_AND_MAYBE_EXIT; 992: -: 734: int count_index, block_index; 993: -: 735: 994: #####: 736: count_index = cur_elmp->orig_count - cur_elmp->curcount; 995: #####: 737: block_index = cur_elmp->orig_block - cur_elmp->curblock; 996: -: 738: 997: -: 739: /* reload the next stackelm if necessary */ 998: #####: 740: next_elmp = &(segp->stackelm[cur_sp + 1]); 999: #####: 741: if (cur_elmp->may_require_reloading) { 1000: branch 0 never executed 1001: branch 1 never executed 1002: #####: 742: DLOOP_Dataloop *load_dlp = NULL; 1003: #####: 743: switch (cur_elmp->loop_p->kind & DLOOP_KIND_MASK) { 1009: -: 746: case DLOOP_KIND_BLOCKINDEXED: 1010: -: 747: case DLOOP_KIND_INDEXED: 1011: #####: 748: load_dlp = cur_elmp->loop_p->loop_params.cm_t.dataloop; 1012: #####: 749: break; 1013: -: 750: case DLOOP_KIND_STRUCT: 1014: #####: 751: load_dlp = DLOOP_STACKELM_STRUCT_DATALOOP(cur_elmp, 1015: -: 752: count_index); 1016: #####: 753: break; 1031: -: 766:#endif 1032: -: 767: 1033: #####: 768: DLOOP_Stackelm_load(next_elmp, 1046: -: 780: * current stackelm, then set cur values based on new stackelm. 1047: -: 781: */ 1048: #####: 782: switch (cur_elmp->loop_p->kind & DLOOP_KIND_MASK) { 1054: branch 5 never executed 1055: -: 783: case DLOOP_KIND_CONTIG: 1056: #####: 784: next_elmp->orig_offset = cur_elmp->curoffset + 1057: -: 785: (DLOOP_Offset) block_index * cur_elmp->loop_p->el_extent; 1058: #####: 786: break; 1059: -: 787: case DLOOP_KIND_VECTOR: 1060: -: 788: /* note: stride is in bytes */ 1061: #####: 789: next_elmp->orig_offset = cur_elmp->orig_offset + 1062: -: 790: (DLOOP_Offset) count_index * cur_elmp->loop_p->loop_params.v_t.stride + 1063: -: 791: (DLOOP_Offset) block_index * cur_elmp->loop_p->el_extent; 1064: #####: 792: break; 1065: -: 793: case DLOOP_KIND_BLOCKINDEXED: 1066: #####: 794: next_elmp->orig_offset = cur_elmp->orig_offset + 1068: -: 796: DLOOP_STACKELM_BLOCKINDEXED_OFFSET(cur_elmp, 1069: -: 797: count_index); 1070: #####: 798: break; 1071: -: 799: case DLOOP_KIND_INDEXED: 1072: #####: 800: next_elmp->orig_offset = cur_elmp->orig_offset + 1073: -: 801: (DLOOP_Offset) block_index * cur_elmp->loop_p->el_extent + 1074: -: 802: DLOOP_STACKELM_INDEXED_OFFSET(cur_elmp, count_index); 1075: #####: 803: break; 1076: -: 804: case DLOOP_KIND_STRUCT: 1077: #####: 805: next_elmp->orig_offset = cur_elmp->orig_offset + 1078: -: 806: (DLOOP_Offset) block_index * DLOOP_STACKELM_STRUCT_EL_EXTENT(cur_elmp, count_index) + 1079: -: 807: DLOOP_STACKELM_STRUCT_OFFSET(cur_elmp, count_index); 1080: #####: 808: break; 1094: -: 820:#endif 1095: -: 821: 1096: #####: 822: switch (next_elmp->loop_p->kind & DLOOP_KIND_MASK) { 1102: -: 823: case DLOOP_KIND_CONTIG: 1103: -: 824: case DLOOP_KIND_VECTOR: 1104: #####: 825: next_elmp->curcount = next_elmp->orig_count; 1105: #####: 826: next_elmp->curblock = next_elmp->orig_block; 1106: #####: 827: next_elmp->curoffset = next_elmp->orig_offset; 1107: #####: 828: break; 1108: -: 829: case DLOOP_KIND_BLOCKINDEXED: 1109: #####: 830: next_elmp->curcount = next_elmp->orig_count; 1110: #####: 831: next_elmp->curblock = next_elmp->orig_block; 1111: #####: 832: next_elmp->curoffset = next_elmp->orig_offset + 1112: -: 833: DLOOP_STACKELM_BLOCKINDEXED_OFFSET(next_elmp, 0); 1113: #####: 834: break; 1114: -: 835: case DLOOP_KIND_INDEXED: 1115: #####: 836: next_elmp->curcount = next_elmp->orig_count; 1116: #####: 837: next_elmp->curblock = 1117: -: 838: DLOOP_STACKELM_INDEXED_BLOCKSIZE(next_elmp, 0); 1118: #####: 839: next_elmp->curoffset = next_elmp->orig_offset + 1119: -: 840: DLOOP_STACKELM_INDEXED_OFFSET(next_elmp, 0); 1120: #####: 841: break; 1121: -: 842: case DLOOP_KIND_STRUCT: 1122: #####: 843: next_elmp->curcount = next_elmp->orig_count; 1123: #####: 844: next_elmp->curblock = 1124: -: 845: DLOOP_STACKELM_STRUCT_BLOCKSIZE(next_elmp, 0); 1125: #####: 846: next_elmp->curoffset = next_elmp->orig_offset + 1126: -: 847: DLOOP_STACKELM_STRUCT_OFFSET(next_elmp, 0); 1127: #####: 848: break; 1141: -: 860:#endif 1142: -: 861: 1143: #####: 862: cur_elmp->curblock--; 1144: #####: 863: DLOOP_SEGMENT_PUSH; 1163: -: 882:static inline DLOOP_Count DLOOP_Stackelm_blocksize(struct DLOOP_Dataloop_stackelm *elmp) 1164: function DLOOP_Stackelm_blocksize called 0 returned 0% blocks executed 0% 1165: #####: 883:{ 1166: #####: 884: struct DLOOP_Dataloop *dlp = elmp->loop_p; 1167: -: 885: 1168: #####: 886: switch(dlp->kind & DLOOP_KIND_MASK) { 1178: -: 890: * in the init call. 1179: -: 891: */ 1180: #####: 892: return dlp->loop_params.c_t.count; 1181: -: 893: break; 1182: -: 894: case DLOOP_KIND_VECTOR: 1183: #####: 895: return dlp->loop_params.v_t.blocksize; 1184: -: 896: break; 1185: -: 897: case DLOOP_KIND_BLOCKINDEXED: 1186: #####: 898: return dlp->loop_params.bi_t.blocksize; 1187: -: 899: break; 1188: -: 900: case DLOOP_KIND_INDEXED: 1189: #####: 901: return dlp->loop_params.i_t.blocksize_array[elmp->orig_count - elmp->curcount]; 1190: -: 902: break; 1191: -: 903: case DLOOP_KIND_STRUCT: 1192: #####: 904: return dlp->loop_params.s_t.blocksize_array[elmp->orig_count - elmp->curcount]; 1200: -: 906: default: 1201: -: 911: } 1202: #####: 912: return -1; 1215: -: 925:static inline DLOOP_Offset DLOOP_Stackelm_offset(struct DLOOP_Dataloop_stackelm *elmp) 1216: function DLOOP_Stackelm_offset called 0 returned 0% blocks executed 0% 1217: #####: 926:{ 1218: #####: 927: struct DLOOP_Dataloop *dlp = elmp->loop_p; 1219: -: 928: 1220: #####: 929: switch(dlp->kind & DLOOP_KIND_MASK) { 1226: -: 930: case DLOOP_KIND_VECTOR: 1227: -: 931: case DLOOP_KIND_CONTIG: 1228: #####: 932: return 0; 1229: -: 933: break; 1230: -: 934: case DLOOP_KIND_BLOCKINDEXED: 1231: #####: 935: return dlp->loop_params.bi_t.offset_array[elmp->orig_count - elmp->curcount]; 1232: -: 936: break; 1233: -: 937: case DLOOP_KIND_INDEXED: 1234: #####: 938: return dlp->loop_params.i_t.offset_array[elmp->orig_count - elmp->curcount]; 1235: -: 939: break; 1236: -: 940: case DLOOP_KIND_STRUCT: 1237: #####: 941: return dlp->loop_params.s_t.offset_array[elmp->orig_count - elmp->curcount]; 1245: -: 943: default: 1246: -: 948: } 1247: #####: 949: return -1; 1256: -: 958: int branch_flag) 1257: function DLOOP_Stackelm_load called 0 returned 0% blocks executed 0% 1258: #####: 959:{ 1259: #####: 960: elmp->loop_p = dlp; 1260: -: 961: 1261: #####: 962: if ((dlp->kind & DLOOP_KIND_MASK) == DLOOP_KIND_CONTIG) { 1262: branch 0 never executed 1263: branch 1 never executed 1264: #####: 963: elmp->orig_count = 1; /* put in blocksize instead */ 1265: -: 964: } 1266: -: 965: else { 1267: #####: 966: elmp->orig_count = dlp->loop_params.count; 1268: -: 967: } 1269: -: 968: 1270: #####: 969: if (branch_flag || (dlp->kind & DLOOP_KIND_MASK) == DLOOP_KIND_STRUCT) 1274: branch 3 never executed 1275: -: 970: { 1276: #####: 971: elmp->may_require_reloading = 1; 1277: -: 972: } 1278: -: 973: else { 1279: #####: 974: elmp->may_require_reloading = 0; 1281: -: 976: 1282: -: 977: /* required by DLOOP_Stackelm_blocksize */ 1283: #####: 978: elmp->curcount = elmp->orig_count; 1284: -: 979: 1285: #####: 980: elmp->orig_block = DLOOP_Stackelm_blocksize(elmp); 262 line(s) not covered by tests in src/mpid/common/datatype/dataloop/segment.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create.c.gcov 28: -: 23: int flag) 29: function MPID_Dataloop_create called 0 returned 0% blocks executed 0% 30: #####: 24:{ 45: -: 39: MPI_Aint *disps; 46: -: 40: 47: #####: 41: NMPI_Type_get_envelope(type, &nr_ints, &nr_aints, &nr_types, &combiner); 49: -: 42: 50: -: 43: /* some named types do need dataloops; handle separately. */ 51: #####: 44: if (combiner == MPI_COMBINER_NAMED) { 52: branch 0 never executed 53: branch 1 never executed 54: #####: 45: DLOOP_Dataloop_create_named(type, dlp_p, dlsz_p, dldepth_p, flag); 55: call 0 never executed 56: #####: 46: return; 61: -: 51: * have a loop? 62: -: 52: */ 63: #####: 53: DLOOP_Handle_get_loopptr_macro(type, old_dlp, flag); 70: branch 6 never executed 71: branch 7 never executed 72: #####: 54: if (old_dlp != NULL) { 74: branch 1 never executed 75: -: 55: /* dataloop already created; just return it. */ 76: #####: 56: *dlp_p = old_dlp; 77: #####: 57: DLOOP_Handle_get_loopsize_macro(type, *dlsz_p, flag); 84: branch 6 never executed 85: branch 7 never executed 86: #####: 58: DLOOP_Handle_get_loopdepth_macro(type, *dldepth_p, flag); 96: -: 60: } 97: -: 61: 98: #####: 62: PREPEND_PREFIX(Type_access_contents)(type, &ints, &aints, &types); 100: -: 63: 101: -: 64: /* first check for zero count on types where that makes sense */ 102: #####: 65: switch(combiner) { 113: -: 74: case MPI_COMBINER_STRUCT_INTEGER: 114: -: 75: case MPI_COMBINER_STRUCT: 115: #####: 76: if (ints[0] == 0) { 116: branch 0 never executed 117: branch 1 never executed 118: #####: 77: PREPEND_PREFIX(Dataloop_create_contiguous)(0, 123: -: 81: dldepth_p, 124: -: 82: flag); 125: #####: 83: goto clean_exit; 136: -: 94: * types "below" the current one. 137: -: 95: */ 138: #####: 96: NMPI_Type_get_envelope(types[0], &dummy1, &dummy2, &dummy3, 139: call 0 never executed 140: -: 97: &type0_combiner); 141: #####: 98: if (type0_combiner != MPI_COMBINER_NAMED) 143: branch 1 never executed 144: -: 99: { 145: #####: 100: DLOOP_Handle_get_loopptr_macro(types[0], old_dlp, flag); 152: branch 6 never executed 153: branch 7 never executed 154: #####: 101: if (old_dlp == NULL) 157: -: 102: { 158: -: 103: /* no dataloop already present; create and store one */ 159: #####: 104: PREPEND_PREFIX(Dataloop_create)(types[0], 164: -: 108: flag); 165: -: 109: 166: #####: 110: DLOOP_Handle_set_loopptr_macro(types[0], old_dlp, flag); 173: branch 6 never executed 174: branch 7 never executed 175: #####: 111: DLOOP_Handle_set_loopsize_macro(types[0], old_dlsz, flag); 182: branch 6 never executed 183: branch 7 never executed 184: #####: 112: DLOOP_Handle_set_loopdepth_macro(types[0], old_dldepth, flag); 193: -: 113: } 194: -: 114: else { 195: #####: 115: DLOOP_Handle_get_loopsize_macro(types[0], old_dlsz, flag); 202: branch 6 never executed 203: branch 7 never executed 204: #####: 116: DLOOP_Handle_get_loopdepth_macro(types[0], old_dldepth, flag); 214: -: 118: } 215: -: 119: 216: #####: 120: switch(combiner) 229: -: 121: { 230: -: 122: case MPI_COMBINER_DUP: 231: #####: 123: if (type0_combiner != MPI_COMBINER_NAMED) { 232: branch 0 never executed 233: branch 1 never executed 234: #####: 124: PREPEND_PREFIX(Dataloop_dup)(old_dlp, old_dlsz, dlp_p); 235: call 0 never executed 236: #####: 125: *dlsz_p = old_dlsz; 237: #####: 126: *dldepth_p = old_dldepth; 238: -: 127: } 239: -: 128: else { 240: #####: 129: PREPEND_PREFIX(Dataloop_create_contiguous)(1, 247: -: 135: break; 248: -: 136: case MPI_COMBINER_RESIZED: 249: #####: 137: if (type0_combiner != MPI_COMBINER_NAMED) { 250: branch 0 never executed 251: branch 1 never executed 252: #####: 138: PREPEND_PREFIX(Dataloop_dup)(old_dlp, old_dlsz, dlp_p); 253: call 0 never executed 254: #####: 139: *dlsz_p = old_dlsz; 255: #####: 140: *dldepth_p = old_dldepth; 256: -: 141: } 257: -: 142: else { 258: #####: 143: PREPEND_PREFIX(Dataloop_create_contiguous)(1, 263: -: 147: flag); 264: -: 148: 265: #####: 149: (*dlp_p)->el_extent = aints[1]; /* extent */ 267: -: 151: break; 268: -: 152: case MPI_COMBINER_CONTIGUOUS: 269: #####: 153: PREPEND_PREFIX(Dataloop_create_contiguous)(ints[0] /* count */, 273: -: 156: dldepth_p, 274: -: 157: flag); 275: #####: 158: break; 276: -: 159: case MPI_COMBINER_VECTOR: 277: #####: 160: PREPEND_PREFIX(Dataloop_create_vector)(ints[0] /* count */, 283: -: 165: dlp_p, dlsz_p, dldepth_p, 284: -: 166: flag); 285: #####: 167: break; 287: -: 169: case MPI_COMBINER_HVECTOR: 288: -: 170: /* fortran hvector has integer stride in bytes */ 289: #####: 171: if (combiner == MPI_COMBINER_HVECTOR_INTEGER) { 290: branch 0 never executed 291: branch 1 never executed 292: #####: 172: stride = (MPI_Aint) ints[2]; 293: -: 173: } 294: -: 174: else { 295: #####: 175: stride = aints[0]; 296: -: 176: } 297: -: 177: 298: #####: 178: PREPEND_PREFIX(Dataloop_create_vector)(ints[0] /* count */, 304: -: 183: dlp_p, dlsz_p, dldepth_p, 305: -: 184: flag); 306: #####: 185: break; 307: -: 186: case MPI_COMBINER_INDEXED_BLOCK: 308: #####: 187: PREPEND_PREFIX(Dataloop_create_blockindexed)(ints[0] /* count */, 315: -: 193: dldepth_p, 316: -: 194: flag); 317: #####: 195: break; 318: -: 196: case MPI_COMBINER_INDEXED: 319: #####: 197: PREPEND_PREFIX(Dataloop_create_indexed)(ints[0] /* count */, 325: -: 202: dlp_p, dlsz_p, dldepth_p, 326: -: 203: flag); 327: #####: 204: break; 328: -: 205: case MPI_COMBINER_HINDEXED_INTEGER: 329: -: 206: case MPI_COMBINER_HINDEXED: 330: #####: 207: if (combiner == MPI_COMBINER_HINDEXED_INTEGER) { 331: branch 0 never executed 332: branch 1 never executed 333: #####: 208: disps = (MPI_Aint *) DLOOP_Malloc(ints[0] * sizeof(MPI_Aint)); 334: call 0 never executed 335: -: 209: 336: #####: 210: for (i=0; i < ints[0]; i++) { 337: branch 0 never executed 338: branch 1 never executed 339: #####: 211: disps[i] = (MPI_Aint) ints[ints[0] + 1 + i]; 341: -: 213: } 342: -: 214: else { 343: #####: 215: disps = aints; 344: -: 216: } 345: -: 217: 346: #####: 218: PREPEND_PREFIX(Dataloop_create_indexed)(ints[0] /* count */, 353: -: 224: flag); 354: -: 225: 355: #####: 226: if (combiner == MPI_COMBINER_HINDEXED_INTEGER) { 356: branch 0 never executed 357: branch 1 never executed 358: #####: 227: DLOOP_Free(disps); 363: -: 231: case MPI_COMBINER_STRUCT_INTEGER: 364: -: 232: case MPI_COMBINER_STRUCT: 365: #####: 233: for (i = 1; i < ints[0]; i++) { 367: branch 1 never executed 368: -: 234: int type_combiner; 369: #####: 235: NMPI_Type_get_envelope(types[i], &dummy1, &dummy2, &dummy3, 371: -: 236: &type_combiner); 372: -: 237: 373: #####: 238: if (type_combiner != MPI_COMBINER_NAMED) { 374: branch 0 never executed 375: branch 1 never executed 376: #####: 239: DLOOP_Handle_get_loopptr_macro(types[i], old_dlp, flag); 383: branch 6 never executed 384: branch 7 never executed 385: #####: 240: if (old_dlp == NULL) 387: branch 1 never executed 388: -: 241: { 389: #####: 242: PREPEND_PREFIX(Dataloop_create)(types[i], 394: -: 246: flag); 395: -: 247: 396: #####: 248: DLOOP_Handle_set_loopptr_macro(types[i], old_dlp, 404: branch 7 never executed 405: -: 249: flag); 406: #####: 250: DLOOP_Handle_set_loopsize_macro(types[i], old_dlsz, 414: branch 7 never executed 415: -: 251: flag); 416: #####: 252: DLOOP_Handle_set_loopdepth_macro(types[i], old_dldepth, 427: -: 255: } 428: -: 256: } 429: #####: 257: if (combiner == MPI_COMBINER_STRUCT_INTEGER) { 430: branch 0 never executed 431: branch 1 never executed 432: #####: 258: disps = (MPI_Aint *) DLOOP_Malloc(ints[0] * sizeof(MPI_Aint)); 433: call 0 never executed 434: -: 259: 435: #####: 260: for (i=0; i < ints[0]; i++) { 436: branch 0 never executed 437: branch 1 never executed 438: #####: 261: disps[i] = (MPI_Aint) ints[ints[0] + 1 + i]; 440: -: 263: } 441: -: 264: else { 442: #####: 265: disps = aints; 443: -: 266: } 444: -: 267: 445: #####: 268: PREPEND_PREFIX(Dataloop_create_struct)(ints[0] /* count */, 451: -: 273: flag); 452: -: 274: 453: #####: 275: if (combiner == MPI_COMBINER_STRUCT_INTEGER) { 454: branch 0 never executed 455: branch 1 never executed 456: #####: 276: DLOOP_Free(disps); 459: -: 278: break; 460: -: 279: case MPI_COMBINER_SUBARRAY: 461: #####: 280: ndims = ints[0]; 462: #####: 281: PREPEND_PREFIX(Type_convert_subarray)(ndims, 469: -: 287: &tmptype); 470: -: 288: 471: #####: 289: PREPEND_PREFIX(Dataloop_create)(tmptype, 476: -: 293: flag); 477: -: 294: 478: #####: 295: NMPI_Type_free(&tmptype); 479: call 0 never executed 480: #####: 296: break; 481: -: 297: case MPI_COMBINER_DARRAY: 482: #####: 298: ndims = ints[2]; 483: #####: 299: PREPEND_PREFIX(Type_convert_darray)(ints[0] /* size */, 493: -: 308: &tmptype); 494: -: 309: 495: #####: 310: PREPEND_PREFIX(Dataloop_create)(tmptype, 500: -: 314: flag); 501: -: 315: 502: #####: 316: NMPI_Type_free(&tmptype); 503: call 0 never executed 504: #####: 317: break; 508: -: 321: /* TODO: WHAT DO I DO HERE? */ 509: -: 322: default: 510: #####: 323: DLOOP_Assert(0); 514: -: 325: } 515: -: 326: 516: #####: 327: clean_exit: 517: -: 328: 518: #####: 329: PREPEND_PREFIX(Type_release_contents)(type, &ints, &aints, &types); 523: -: 333: */ 524: -: 334: 525: #####: 335: return; 541: -: 351: int flag) 542: function DLOOP_Dataloop_create_named called 0 returned 0% blocks executed 0% 543: #####: 352:{ 553: -: 362: * case. 554: -: 363: */ 555: #####: 364: if (type == MPI_FLOAT_INT || type == MPI_DOUBLE_INT || 561: -: 366: type == MPI_LONG_DOUBLE_INT) 562: -: 367: { 563: #####: 368: DLOOP_Handle_get_loopptr_macro(type, dlp, flag); 570: branch 6 never executed 571: branch 7 never executed 572: #####: 369: if (dlp != NULL) { 574: branch 1 never executed 575: -: 370: /* dataloop already created; just return it. */ 576: #####: 371: *dlp_p = dlp; 577: #####: 372: DLOOP_Handle_get_loopsize_macro(type, *dlsz_p, flag); 584: branch 6 never executed 585: branch 7 never executed 586: #####: 373: DLOOP_Handle_get_loopdepth_macro(type, *dldepth_p, flag); 595: -: 374: } 596: -: 375: else { 597: #####: 376: PREPEND_PREFIX(Dataloop_create_pairtype)(type, 606: -: 384: /* no other combiners need dataloops; exit. */ 607: -: 385: else { 608: #####: 386: *dlp_p = NULL; 609: #####: 387: *dlsz_p = 0; 610: #####: 388: *dldepth_p = 0; 611: #####: 389: return; 101 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create_vector.c.gcov 40: -: 35: int flag) 41: function MPID_Dataloop_create_vector called 0 returned 0% blocks executed 0% 42: #####: 36:{ 48: -: 42: DLOOP_Dataloop *new_dlp; 49: -: 43: 50: #####: 44: count = (DLOOP_Count) icount; /* avoid subsequent casting */ 51: #####: 45: blocklength = (DLOOP_Count) iblocklength; 52: #####: 46: stride = (DLOOP_Offset) astride; 55: -: 49: * call it a int 56: -: 50: */ 57: #####: 51: if (count == 0 || blocklength == 0) 60: -: 52: { 61: -: 53: 62: #####: 54: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 67: -: 58: dldepth_p, 68: -: 59: flag); 69: #####: 60: return err; 74: -: 65: * if count == 1, store as a contiguous rather than a vector dataloop. 75: -: 66: */ 76: #####: 67: if (count == 1) { 77: branch 0 never executed 78: branch 1 never executed 79: #####: 68: err = PREPEND_PREFIX(Dataloop_create_contiguous)(iblocklength, 84: -: 72: dldepth_p, 85: -: 73: flag); 86: #####: 74: return err; 87: -: 75: } 88: -: 76: 89: #####: 77: is_builtin = (DLOOP_Handle_hasloop_macro(oldtype)) ? 0 : 1; 90: -: 78: 91: #####: 79: if (is_builtin) { 92: branch 0 never executed 93: branch 1 never executed 94: #####: 80: new_loop_sz = sizeof(DLOOP_Dataloop); 95: #####: 81: new_loop_depth = 1; 96: -: 82: } 97: -: 83: else { 98: #####: 84: int old_loop_sz = 0, old_loop_depth = 0; 99: -: 85: 100: #####: 86: DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag); 107: branch 6 never executed 108: branch 7 never executed 109: #####: 87: DLOOP_Handle_get_loopdepth_macro(oldtype, old_loop_depth, flag); 118: -: 88: 119: -: 89: /* TODO: ACCOUNT FOR PADDING IN LOOP_SZ HERE */ 120: #####: 90: new_loop_sz = sizeof(DLOOP_Dataloop) + old_loop_sz; 121: #####: 91: new_loop_depth = old_loop_depth + 1; 123: -: 93: 124: -: 94: 125: #####: 95: if (is_builtin) { 126: branch 0 never executed 127: branch 1 never executed 128: #####: 96: DLOOP_Offset basic_sz = 0; 129: -: 97: 130: #####: 98: PREPEND_PREFIX(Dataloop_alloc)(DLOOP_KIND_VECTOR, 139: -: 101: &new_loop_sz); 140: -: 105: 141: #####: 106: DLOOP_Handle_get_size_macro(oldtype, basic_sz); 145: branch 3 never executed 146: call 4 never executed 147: #####: 107: new_dlp->kind = DLOOP_KIND_VECTOR | DLOOP_FINAL_MASK; 148: -: 108: 149: #####: 109: if (flag == DLOOP_DATALOOP_ALL_BYTES) 152: -: 110: { 153: -: 111: 154: #####: 112: blocklength *= basic_sz; 155: #####: 113: new_dlp->el_size = 1; 156: #####: 114: new_dlp->el_extent = 1; 157: #####: 115: new_dlp->el_type = MPI_BYTE; 158: -: 116: 159: #####: 117: if(!strideinbytes) 163: -: 119: that we're using bytes, rather than oldtype, we 164: -: 120: need to update stride. */ 165: #####: 121: stride *= basic_sz; 167: -: 123: else 168: -: 124: { 169: #####: 125: new_dlp->el_size = basic_sz; 170: #####: 126: new_dlp->el_extent = new_dlp->el_size; 171: #####: 127: new_dlp->el_type = oldtype; 174: -: 130: else /* user-defined base type (oldtype) */ { 175: -: 131: DLOOP_Dataloop *old_loop_ptr; 176: #####: 132: int old_loop_sz = 0; 177: -: 133: 178: #####: 134: DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag); 185: branch 6 never executed 186: branch 7 never executed 187: #####: 135: DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag); 195: branch 7 never executed 196: -: 136: 197: #####: 137: PREPEND_PREFIX(Dataloop_alloc_and_copy)(DLOOP_KIND_VECTOR, 208: -: 142: &new_loop_sz); 209: -: 146: 210: #####: 147: new_dlp->kind = DLOOP_KIND_VECTOR; 211: #####: 148: DLOOP_Handle_get_size_macro(oldtype, new_dlp->el_size); 215: branch 3 never executed 216: call 4 never executed 217: #####: 149: DLOOP_Handle_get_extent_macro(oldtype, new_dlp->el_extent); 220: branch 2 never executed 221: call 3 never executed 222: #####: 150: DLOOP_Handle_get_basic_type_macro(oldtype, new_dlp->el_type); 232: -: 155: * stride stored in dataloop is always in bytes for local rep of type 233: -: 156: */ 234: #####: 157: new_dlp->loop_params.v_t.count = count; 235: #####: 158: new_dlp->loop_params.v_t.blocksize = blocklength; 236: #####: 159: new_dlp->loop_params.v_t.stride = (strideinbytes) ? stride : 239: -: 160: stride * new_dlp->el_extent; 240: -: 161: 241: #####: 162: *dlp_p = new_dlp; 242: #####: 163: *dlsz_p = new_loop_sz; 243: #####: 164: *dldepth_p = new_loop_depth; 244: -: 165: 245: #####: 166: return 0; 49 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create_vector.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create_blockindexed.c.gcov 47: -: 42: int flag) 48: function MPID_Dataloop_create_blockindexed called 0 returned 0% blocks executed 0% 49: #####: 43:{ 50: #####: 44: int err, is_builtin, is_vectorizable = 1; 55: -: 49: DLOOP_Dataloop *new_dlp; 56: -: 50: 57: #####: 51: count = (DLOOP_Count) icount; /* avoid subsequent casting */ 58: #####: 52: blklen = (DLOOP_Count) iblklen; 59: -: 53: 60: -: 54: /* if count or blklen are zero, handle with contig code, call it a int */ 61: #####: 55: if (count == 0 || blklen == 0) 63: branch 1 never executed 64: -: 56: { 65: #####: 57: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 70: -: 61: dldepth_p, 71: -: 62: flag); 72: #####: 63: return err; 73: -: 64: } 74: -: 65: 75: #####: 66: is_builtin = (DLOOP_Handle_hasloop_macro(oldtype)) ? 0 : 1; 76: -: 67: 77: #####: 68: if (is_builtin) 79: branch 1 never executed 80: -: 69: { 81: #####: 70: DLOOP_Handle_get_size_macro(oldtype, old_extent); 85: branch 3 never executed 86: call 4 never executed 87: #####: 71: old_loop_depth = 0; 89: -: 73: else 90: -: 74: { 91: #####: 75: DLOOP_Handle_get_extent_macro(oldtype, old_extent); 94: branch 2 never executed 95: call 3 never executed 96: #####: 76: DLOOP_Handle_get_loopdepth_macro(oldtype, old_loop_depth, flag); 105: -: 77: } 106: -: 78: 107: #####: 79: contig_count = PREPEND_PREFIX(Type_blockindexed_count_contig)(count, 117: -: 88: * store it as a contiguous rather than a blockindexed dataloop. 118: -: 89: */ 119: #####: 90: if ((contig_count == 1) && 125: -: 92: (dispinbytes && ((MPI_Aint *) disp_array)[0] == 0))) 126: -: 93: { 127: #####: 94: err = PREPEND_PREFIX(Dataloop_create_contiguous)(icount * iblklen, 132: -: 98: dldepth_p, 133: -: 99: flag); 134: #####: 100: return err; 140: -: 106: * element rather than as a lot of individual blocks. 141: -: 107: */ 142: #####: 108: if (contig_count == 1) 145: -: 109: { 146: -: 110: /* adjust count and blklen and drop through */ 147: #####: 111: blklen *= count; 148: #####: 112: count = 1; 149: #####: 113: iblklen *= icount; 150: #####: 114: icount = 1; 156: -: 120: * store it as a vector rather than a blockindexed dataloop. 157: -: 121: */ 158: #####: 122: eff_disp0 = (dispinbytes) ? ((DLOOP_Offset) ((MPI_Aint *) disp_array)[0]) : 161: -: 123: (((DLOOP_Offset) ((int *) disp_array)[0]) * old_extent); 162: -: 124: 163: #####: 125: if (count > 1 && eff_disp0 == (DLOOP_Offset) 0) 165: branch 1 never executed 166: -: 126: { 167: #####: 127: eff_disp1 = (dispinbytes) ? 170: -: 128: ((DLOOP_Offset) ((MPI_Aint *) disp_array)[1]) : 171: -: 129: (((DLOOP_Offset) ((int *) disp_array)[1]) * old_extent); 172: #####: 130: last_stride = eff_disp1 - eff_disp0; 173: -: 131: 174: #####: 132: for (i=2; i < count; i++) { 175: branch 0 never executed 176: branch 1 never executed 177: #####: 133: eff_disp0 = eff_disp1; 178: #####: 134: eff_disp1 = (dispinbytes) ? 181: -: 135: ((DLOOP_Offset) ((MPI_Aint *) disp_array)[i]) : 182: -: 136: (((DLOOP_Offset) ((int *) disp_array)[i]) * old_extent); 183: #####: 137: if (eff_disp1 - eff_disp0 != last_stride) { 184: branch 0 never executed 185: branch 1 never executed 186: #####: 138: is_vectorizable = 0; 187: #####: 139: break; 188: -: 140: } 189: -: 141: } 190: #####: 142: if (is_vectorizable) 192: branch 1 never executed 193: -: 143: { 194: #####: 144: err = PREPEND_PREFIX(Dataloop_create_vector)(count, 202: -: 151: dldepth_p, 203: -: 152: flag); 204: #####: 153: return err; 224: -: 173: */ 225: -: 174: 226: #####: 175: if (is_builtin) 228: branch 1 never executed 229: -: 176: { 230: #####: 177: PREPEND_PREFIX(Dataloop_alloc)(DLOOP_KIND_BLOCKINDEXED, 239: -: 180: &new_loop_sz); 240: -: 184: 241: #####: 185: new_dlp->kind = DLOOP_KIND_BLOCKINDEXED | DLOOP_FINAL_MASK; 242: -: 186: 243: #####: 187: if (flag == DLOOP_DATALOOP_ALL_BYTES) 245: branch 1 never executed 246: -: 188: { 247: #####: 189: blklen *= old_extent; 248: #####: 190: new_dlp->el_size = 1; 249: #####: 191: new_dlp->el_extent = 1; 250: #####: 192: new_dlp->el_type = MPI_BYTE; 252: -: 194: else 253: -: 195: { 254: #####: 196: new_dlp->el_size = old_extent; 255: #####: 197: new_dlp->el_extent = old_extent; 256: #####: 198: new_dlp->el_type = oldtype; 259: -: 201: else 260: -: 202: { 261: #####: 203: DLOOP_Dataloop *old_loop_ptr = NULL; 262: #####: 204: int old_loop_sz = 0; 263: -: 205: 264: #####: 206: DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag); 271: branch 6 never executed 272: branch 7 never executed 273: #####: 207: DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag); 281: branch 7 never executed 282: -: 208: 283: #####: 209: PREPEND_PREFIX(Dataloop_alloc_and_copy)(DLOOP_KIND_BLOCKINDEXED, 294: -: 214: &new_loop_sz); 295: -: 218: 296: #####: 219: new_dlp->kind = DLOOP_KIND_BLOCKINDEXED; 297: -: 220: 298: #####: 221: DLOOP_Handle_get_size_macro(oldtype, new_dlp->el_size); 302: branch 3 never executed 303: call 4 never executed 304: #####: 222: DLOOP_Handle_get_extent_macro(oldtype, new_dlp->el_extent); 307: branch 2 never executed 308: call 3 never executed 309: #####: 223: DLOOP_Handle_get_basic_type_macro(oldtype, new_dlp->el_type); 315: -: 224: } 316: -: 225: 317: #####: 226: new_dlp->loop_params.bi_t.count = count; 318: #####: 227: new_dlp->loop_params.bi_t.blocksize = blklen; 322: -: 231: * regardless of dispinbytes, we store displacements in bytes in loop. 323: -: 232: */ 324: #####: 233: DLOOP_Type_blockindexed_array_copy(count, 329: -: 237: old_extent); 330: -: 238: 331: #####: 239: *dlp_p = new_dlp; 332: #####: 240: *dlsz_p = new_loop_sz; 333: #####: 241: *dldepth_p = old_loop_depth + 1; 334: -: 242: 335: #####: 243: return 0; 347: -: 255: DLOOP_Offset old_extent) 348: function DLOOP_Type_blockindexed_array_copy called 0 returned 0% blocks executed 0% 349: #####: 256:{ 350: -: 257: int i; 351: #####: 258: if (!dispinbytes) 353: branch 1 never executed 354: -: 259: { 355: #####: 260: for (i=0; i < count; i++) 357: branch 1 never executed 358: -: 261: { 359: #####: 262: out_disp_array[i] = 363: -: 266: else 364: -: 267: { 365: #####: 268: for (i=0; i < count; i++) 367: branch 1 never executed 368: -: 269: { 369: #####: 270: out_disp_array[i] = 380: -: 281: DLOOP_Offset old_extent) 381: function MPID_Type_blockindexed_count_contig called 0 returned 0% blocks executed 0% 382: #####: 282:{ 383: #####: 283: int i, contig_count = 1; 384: -: 284: 385: #####: 285: if (!dispinbytes) 388: -: 286: { 389: -: 287: /* this is from the MPI type, is of type int */ 390: #####: 288: DLOOP_Offset cur_tdisp = (DLOOP_Offset) ((int *) disp_array)[0]; 391: -: 289: 392: #####: 290: for (i=1; i < count; i++) 394: branch 1 never executed 395: -: 291: { 396: #####: 292: DLOOP_Offset next_tdisp = (DLOOP_Offset) ((int *) disp_array)[i]; 397: -: 293: 398: #####: 294: if (cur_tdisp + (DLOOP_Offset) blklen != next_tdisp) 400: branch 1 never executed 401: -: 295: { 402: #####: 296: contig_count++; 403: -: 297: } 404: #####: 298: cur_tdisp = next_tdisp; 408: -: 302: { 409: -: 303: /* this is from the MPI type, is of type MPI_Aint */ 410: #####: 304: DLOOP_Offset cur_bdisp = (DLOOP_Offset) ((MPI_Aint *) disp_array)[0]; 411: -: 305: 412: #####: 306: for (i=1; i < count; i++) 415: -: 307: { 416: -: 308: DLOOP_Offset next_bdisp = 417: #####: 309: (DLOOP_Offset) ((MPI_Aint *) disp_array)[i]; 418: -: 310: 419: #####: 311: if (cur_bdisp + (DLOOP_Offset) blklen * old_extent != next_bdisp) 421: branch 1 never executed 422: -: 312: { 423: #####: 313: contig_count++; 424: -: 314: } 425: #####: 315: cur_bdisp = next_bdisp; 426: -: 316: } 427: -: 317: } 428: #####: 318: return contig_count; 84 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create_blockindexed.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create_struct.c.gcov 79: -: 74: int flag) 80: function MPID_Dataloop_create_struct called 0 returned 0% blocks executed 0% 81: #####: 75:{ 82: #####: 76: int err, i, nr_basics = 0, nr_derived = 0, type_pos = 0; 83: -: 77: 84: #####: 78: DLOOP_Type first_basic = MPI_DATATYPE_NULL, 85: #####: 79: first_derived = MPI_DATATYPE_NULL; 87: -: 81: /* variables used in general case only */ 88: -: 82: int loop_idx, new_loop_sz, new_loop_depth; 89: #####: 83: int old_loop_sz = 0, old_loop_depth = 0; 92: -: 86: 93: -: 87: /* if count is zero, handle with contig code, call it a int */ 94: #####: 88: if (count == 0) 96: branch 1 never executed 97: -: 89: { 98: #####: 90: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 103: -: 94: dldepth_p, 104: -: 95: flag); 105: #####: 96: return err; 107: -: 98: 108: -: 99: /* browse the old types and characterize */ 109: #####: 100: for (i=0; i < count; i++) 112: -: 101: { 113: -: 102: /* ignore type elements with a zero blklen */ 114: #####: 103: if (blklens[i] == 0) continue; 116: branch 1 never executed 117: -: 104: 118: #####: 105: if (oldtypes[i] != MPI_LB && oldtypes[i] != MPI_UB) 122: -: 107: int is_builtin; 123: -: 108: 124: #####: 109: is_builtin = 125: -: 110: (DLOOP_Handle_hasloop_macro(oldtypes[i])) ? 0 : 1; 126: -: 111: 127: #####: 112: if (is_builtin) 129: branch 1 never executed 130: -: 113: { 131: #####: 114: if (nr_basics == 0) 133: branch 1 never executed 134: -: 115: { 135: #####: 116: first_basic = oldtypes[i]; 136: #####: 117: type_pos = i; 137: -: 118: } 138: #####: 119: else if (oldtypes[i] != first_basic) 140: branch 1 never executed 141: -: 120: { 142: #####: 121: first_basic = MPI_DATATYPE_NULL; 143: -: 122: } 144: #####: 123: nr_basics++; 146: -: 125: else /* derived type */ 147: -: 126: { 148: #####: 127: if (nr_derived == 0) 150: branch 1 never executed 151: -: 128: { 152: #####: 129: first_derived = oldtypes[i]; 153: #####: 130: type_pos = i; 154: -: 131: } 155: #####: 132: else if (oldtypes[i] != first_derived) 157: branch 1 never executed 158: -: 133: { 159: #####: 134: first_derived = MPI_DATATYPE_NULL; 160: -: 135: } 161: #####: 136: nr_derived++; 176: -: 151: * treat it as a zero-element contiguous (just as count == 0). 177: -: 152: */ 178: #####: 153: if (nr_basics == 0 && nr_derived == 0) 180: branch 1 never executed 181: -: 154: { 182: #####: 155: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 187: -: 159: dldepth_p, 188: -: 160: flag); 189: #####: 161: return err; 200: -: 172: * optimize this into a contig. 201: -: 173: */ 202: #####: 174: if (nr_basics + nr_derived == 1) 205: -: 175: { 206: -: 176: /* type_pos is index to only real type in array */ 207: #####: 177: err = PREPEND_PREFIX(Dataloop_create_blockindexed) 217: -: 186: flag); 218: -: 187: 219: #####: 188: return err; 231: -: 200: * 232: -: 201: */ 233: #####: 202: if (((nr_derived == 0) && (first_basic != MPI_DATATYPE_NULL)) || 238: -: 203: ((nr_basics == 0) && (first_derived != MPI_DATATYPE_NULL))) 239: -: 204: { 240: #####: 205: return DLOOP_Dataloop_create_unique_type_struct(count, 256: -: 220: * everything to bytes and use an indexed type. 257: -: 221: */ 258: #####: 222: if (nr_derived == 0 && ((flag == DLOOP_DATALOOP_HOMOGENEOUS) || 263: -: 223: (flag == DLOOP_DATALOOP_ALL_BYTES))) 264: -: 224: { 265: #####: 225: return DLOOP_Dataloop_create_basic_all_bytes_struct(count, 280: -: 239: * there are no branches in the dataloop tree. 281: -: 240: */ 282: #####: 241: if ((flag == DLOOP_DATALOOP_HOMOGENEOUS) || 285: -: 242: (flag == DLOOP_DATALOOP_ALL_BYTES)) 286: -: 243: { 287: #####: 244: return DLOOP_Dataloop_create_flattened_struct(count, 297: -: 253: 298: -: 254: /* scan through types and gather derived type info */ 299: #####: 255: for (i=0; i < count; i++) 302: -: 256: { 303: -: 257: /* ignore type elements with a zero blklen */ 304: #####: 258: if (blklens[i] == 0) continue; 306: branch 1 never executed 307: -: 259: 308: #####: 260: if (DLOOP_Handle_hasloop_macro(oldtypes[i])) 312: -: 262: int tmp_loop_depth, tmp_loop_sz; 313: -: 263: 314: #####: 264: DLOOP_Handle_get_loopdepth_macro(oldtypes[i], tmp_loop_depth, flag); 321: branch 6 never executed 322: branch 7 never executed 323: #####: 265: DLOOP_Handle_get_loopsize_macro(oldtypes[i], tmp_loop_sz, flag); 331: branch 7 never executed 332: -: 266: 333: #####: 267: if (tmp_loop_depth > old_loop_depth) 335: branch 1 never executed 336: -: 268: { 337: #####: 269: old_loop_depth = tmp_loop_depth; 338: -: 270: } 339: #####: 271: old_loop_sz += tmp_loop_sz; 346: -: 278: */ 347: -: 279: 348: #####: 280: if (nr_basics > 0) 353: -: 283: * must be at least 2 if there are basics. 354: -: 284: */ 355: #####: 285: new_loop_depth = ((old_loop_depth+1) > 2) ? (old_loop_depth+1) : 2; 359: -: 287: else 360: -: 288: { 361: #####: 289: new_loop_depth = old_loop_depth + 1; 362: -: 290: } 363: -: 291: 364: #####: 292: PREPEND_PREFIX(Dataloop_struct_alloc)((DLOOP_Count) nr_basics + nr_derived, 380: -: 304: 381: -: 305: 382: #####: 306: new_dlp->kind = DLOOP_KIND_STRUCT; 383: #####: 307: new_dlp->el_size = -1; /* not valid for struct */ 384: #####: 308: new_dlp->el_extent = -1; /* not valid for struct; see el_extent_array */ 385: #####: 309: new_dlp->el_type = MPI_DATATYPE_NULL; /* not valid for struct */ 386: -: 310: 387: #####: 311: new_dlp->loop_params.s_t.count = (DLOOP_Count) nr_basics + nr_derived; 391: -: 315: */ 392: -: 316: 393: #####: 317: for (i=0, loop_idx = 0; i < count; i++) 398: -: 320: 399: -: 321: /* ignore type elements with a zero blklen */ 400: #####: 322: if (blklens[i] == 0) continue; 402: branch 1 never executed 403: -: 323: 404: #####: 324: is_builtin = (DLOOP_Handle_hasloop_macro(oldtypes[i])) ? 0 : 1; 405: -: 325: 406: #####: 326: if (is_builtin) 412: -: 330: 413: -: 331: /* LBs and UBs already taken care of -- skip them */ 414: #####: 332: if (oldtypes[i] == MPI_LB || oldtypes[i] == MPI_UB) 416: branch 1 never executed 417: -: 333: { 418: #####: 334: continue; 426: -: 342: * contig so we can process more at the leaf. 427: -: 343: */ 428: #####: 344: err = PREPEND_PREFIX(Dataloop_create_contiguous)(blklens[i], 446: -: 359: * region 447: -: 360: */ 448: #####: 361: PREPEND_PREFIX(Dataloop_copy)(curpos, dummy_dlp, dummy_sz); 449: call 0 never executed 450: #####: 362: new_dlp->loop_params.s_t.dataloop_array[loop_idx] = curpos; 451: #####: 363: curpos = (DLOOP_Dataloop *) ((char *) curpos + dummy_sz); 452: -: 364: 453: -: 365: /* we stored the block size in the contig -- use 1 here */ 454: #####: 366: new_dlp->loop_params.s_t.blocksize_array[loop_idx] = 1; 455: #####: 367: new_dlp->loop_params.s_t.el_extent_array[loop_idx] = 456: -: 368: ((DLOOP_Offset) blklens[i]) * dummy_dlp->el_extent; 457: #####: 369: PREPEND_PREFIX(Dataloop_free)(&dummy_dlp); 463: -: 374: DLOOP_Offset old_extent; 464: -: 375: 465: #####: 376: DLOOP_Handle_get_loopptr_macro(oldtypes[i], old_loop_ptr, flag); 472: branch 6 never executed 473: branch 7 never executed 474: #####: 377: DLOOP_Handle_get_loopsize_macro(oldtypes[i], old_loop_sz, flag); 481: branch 6 never executed 482: branch 7 never executed 483: #####: 378: DLOOP_Handle_get_extent_macro(oldtypes[i], old_extent); 487: call 3 never executed 488: -: 379: 489: #####: 380: PREPEND_PREFIX(Dataloop_copy)(curpos, old_loop_ptr, old_loop_sz); 490: call 0 never executed 491: #####: 381: new_dlp->loop_params.s_t.dataloop_array[loop_idx] = curpos; 492: #####: 382: curpos = (DLOOP_Dataloop *) ((char *) curpos + old_loop_sz); 493: -: 383: 494: #####: 384: new_dlp->loop_params.s_t.blocksize_array[loop_idx] = 495: -: 385: (DLOOP_Count) blklens[i]; 496: #####: 386: new_dlp->loop_params.s_t.el_extent_array[loop_idx] = 497: -: 387: old_extent; 498: -: 388: } 499: #####: 389: new_dlp->loop_params.s_t.offset_array[loop_idx] = 500: -: 390: (DLOOP_Offset) disps[i]; 501: #####: 391: loop_idx++; 502: -: 392: } 503: -: 393: 504: #####: 394: *dlp_p = new_dlp; 505: #####: 395: *dlsz_p = new_loop_sz; 506: #####: 396: *dldepth_p = new_loop_depth; 507: -: 397: 508: #####: 398: return 0; 527: -: 416: int flag) 528: function DLOOP_Dataloop_create_unique_type_struct called 0 returned 0% blocks executed 0% 529: #####: 417:{ 531: -: 419: * indexes to the first of these. 532: -: 420: */ 533: #####: 421: int i, err, *tmp_blklens, cur_pos = 0; 535: -: 423: 536: -: 424: /* count is an upper bound on number of type instances */ 537: #####: 425: tmp_blklens = (int *) DLOOP_Malloc(count * sizeof(int)); 547: call 0 never executed 548: -: 432: 549: #####: 433: tmp_disps = (DLOOP_Offset *) 562: -: 434: DLOOP_Malloc(count * sizeof(DLOOP_Offset)); 563: -: 442: 564: #####: 443: for (i=type_pos; i < count; i++) 566: branch 1 never executed 567: -: 444: { 568: #####: 445: if (oldtypes[i] == oldtypes[type_pos] && blklens != 0) 570: branch 1 never executed 571: -: 446: { 572: #####: 447: tmp_blklens[cur_pos] = blklens[i]; 573: #####: 448: tmp_disps[cur_pos] = disps[i]; 574: #####: 449: cur_pos++; 576: -: 451: } 577: -: 452: 578: #####: 453: err = PREPEND_PREFIX(Dataloop_create_indexed)(cur_pos, 587: -: 461: flag); 588: -: 462: 589: #####: 463: DLOOP_Free(tmp_blklens); 590: call 0 never executed 591: #####: 464: DLOOP_Free(tmp_disps); 592: call 0 never executed 593: -: 465: 594: #####: 466: return err; 606: -: 478: int flag) 607: function DLOOP_Dataloop_create_basic_all_bytes_struct called 0 returned 0% blocks executed 0% 608: #####: 479:{ 609: #####: 480: int i, err, cur_pos = 0; 612: -: 483: 613: -: 484: /* count is an upper bound on number of type instances */ 614: #####: 485: tmp_blklens = (int *) DLOOP_Malloc(count * sizeof(int)); 625: -: 486: 626: -: 493: 627: #####: 494: tmp_disps = (MPI_Aint *) DLOOP_Malloc(count * sizeof(MPI_Aint)); 640: -: 495: 641: -: 503: 642: #####: 504: for (i=0; i < count; i++) 644: branch 1 never executed 645: -: 505: { 646: #####: 506: if (oldtypes[i] != MPI_LB && oldtypes[i] != MPI_UB && blklens[i] != 0) 652: -: 508: DLOOP_Offset sz; 653: -: 509: 654: #####: 510: DLOOP_Handle_get_size_macro(oldtypes[i], sz); 658: branch 3 never executed 659: call 4 never executed 660: #####: 511: tmp_blklens[cur_pos] = (int) sz * blklens[i]; 661: #####: 512: tmp_disps[cur_pos] = disps[i]; 662: #####: 513: cur_pos++; 663: -: 514: } 664: -: 515: } 665: #####: 516: err = PREPEND_PREFIX(Dataloop_create_indexed)(cur_pos, 674: -: 524: flag); 675: -: 525: 676: #####: 526: DLOOP_Free(tmp_blklens); 677: call 0 never executed 678: #####: 527: DLOOP_Free(tmp_disps); 679: call 0 never executed 680: -: 528: 681: #####: 529: return err; 691: -: 539: int flag) 692: function DLOOP_Dataloop_create_flattened_struct called 0 returned 0% blocks executed 0% 693: #####: 540:{ 694: -: 541: /* arbitrary types, convert to bytes and use indexed */ 695: #####: 542: int i, err, *tmp_blklens, nr_blks = 0; 701: -: 548: int first_ind, last_ind; 702: -: 549: 703: #####: 550: segp = PREPEND_PREFIX(Segment_alloc)(); 713: -: 556: 714: -: 557: /* use segment code once to count contiguous regions */ 715: #####: 558: for (i=0; i < count; i++) 720: -: 561: 721: -: 562: /* ignore type elements with a zero blklen */ 722: #####: 563: if (blklens[i] == 0) continue; 724: branch 1 never executed 725: -: 564: 726: #####: 565: is_basic = (DLOOP_Handle_hasloop_macro(oldtypes[i])) ? 0 : 1; 727: -: 566: 728: #####: 567: if (is_basic && (oldtypes[i] != MPI_LB && 733: -: 568: oldtypes[i] != MPI_UB)) 734: -: 569: { 735: #####: 570: nr_blks++; 739: -: 574: DLOOP_Count tmp_nr_blks, sz; 740: -: 575: 741: #####: 576: DLOOP_Handle_get_size_macro(oldtypes[i], sz); 748: -: 578: /* if the derived type has some data to contribute, 749: -: 579: * add to flattened representation */ 750: #####: 580: if (sz > 0) { 751: branch 0 never executed 752: branch 1 never executed 753: #####: 581: PREPEND_PREFIX(Segment_init)(NULL, 757: -: 584: segp, 758: -: 585: flag); 759: #####: 586: bytes = SEGMENT_IGNORE_LAST; 760: -: 587: 761: #####: 588: PREPEND_PREFIX(Segment_count_contig_blocks)(segp, 765: -: 591: &tmp_nr_blks); 766: -: 592: 767: #####: 593: nr_blks += tmp_nr_blks; 774: -: 600: * do: store a simple contig of zero ints and call it done. 775: -: 601: */ 776: #####: 602: if (nr_blks == 0) { 777: branch 0 never executed 778: branch 1 never executed 779: #####: 603: PREPEND_PREFIX(Segment_free)(segp); 780: call 0 never executed 781: #####: 604: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 786: -: 608: dldepth_p, 787: -: 609: flag); 788: #####: 610: return err; 790: -: 612: } 791: -: 613: 792: #####: 614: nr_blks += 2; /* safety measure */ 793: -: 615: 794: #####: 616: tmp_blklens = (int *) DLOOP_Malloc(nr_blks * sizeof(int)); 806: -: 623: 807: -: 624: 808: #####: 625: tmp_disps = (MPI_Aint *) DLOOP_Malloc(nr_blks * sizeof(MPI_Aint)); 822: -: 633: 823: -: 634: /* use segment code again to flatten the type */ 824: #####: 635: first_ind = 0; 825: #####: 636: for (i=0; i < count; i++) 828: -: 637: { 829: -: 638: int is_basic; 830: #####: 639: DLOOP_Count sz = -1; 831: -: 640: 832: #####: 641: is_basic = (DLOOP_Handle_hasloop_macro(oldtypes[i])) ? 0 : 1; 833: #####: 642: if (!is_basic) DLOOP_Handle_get_size_macro(oldtypes[i], sz); 848: -: 650: * be our new element type. 849: -: 651: */ 850: #####: 652: if (oldtypes[i] != MPI_UB && 859: -: 655: (is_basic || sz > 0)) 860: -: 656: { 861: #####: 657: PREPEND_PREFIX(Segment_init)((char *) MPI_AINT_CAST_TO_VOID_PTR disps[i], 866: -: 661: 0 /* homogeneous */); 867: -: 662: 868: #####: 663: last_ind = nr_blks - first_ind; 869: #####: 664: bytes = SEGMENT_IGNORE_LAST; 870: #####: 665: PREPEND_PREFIX(Segment_mpi_flatten)(segp, 875: -: 669: &tmp_disps[first_ind], 876: -: 670: &last_ind); 877: #####: 671: first_ind += last_ind; 878: -: 672: } 879: -: 673: } 880: #####: 674: nr_blks = first_ind; 892: -: 686:#endif 893: -: 687: 894: #####: 688: PREPEND_PREFIX(Segment_free)(segp); 895: call 0 never executed 896: -: 689: 897: #####: 690: err = PREPEND_PREFIX(Dataloop_create_indexed)(nr_blks, 906: -: 698: flag); 907: -: 699: 908: #####: 700: DLOOP_Free(tmp_blklens); 909: call 0 never executed 910: #####: 701: DLOOP_Free(tmp_disps); 911: call 0 never executed 912: -: 702: 913: #####: 703: return err; 146 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create_struct.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/subarray_support.c.gcov 23: -: 18: MPI_Datatype *newtype) 24: function MPID_Type_convert_subarray called 0 returned 0% blocks executed 0% 25: #####: 19:{ 28: -: 22: MPI_Datatype tmp1, tmp2, types[3]; 29: -: 23: 30: #####: 24: NMPI_Type_extent(oldtype, &extent); 31: call 0 never executed 32: -: 25: 33: #####: 26: if (order == MPI_ORDER_FORTRAN) { 35: branch 1 never executed 36: -: 27: /* dimension 0 changes fastest */ 37: #####: 28: if (ndims == 1) { 38: branch 0 never executed 39: branch 1 never executed 40: #####: 29: NMPI_Type_contiguous(array_of_subsizes[0], oldtype, &tmp1); 42: -: 30: } 43: -: 31: else { 44: #####: 32: NMPI_Type_vector(array_of_subsizes[1], 47: -: 34: array_of_sizes[0], oldtype, &tmp1); 48: -: 35: 49: #####: 36: size = (MPI_Aint)(array_of_sizes[0]) * extent; 50: #####: 37: for (i=2; i=0; i--) { 90: branch 0 never executed 91: branch 1 never executed 92: #####: 67: size *= (MPI_Aint)(array_of_sizes[i+1]); 93: #####: 68: NMPI_Type_hvector(array_of_subsizes[i], 1, size, tmp1, &tmp2); 94: call 0 never executed 95: #####: 69: NMPI_Type_free(&tmp1); 96: call 0 never executed 97: #####: 70: tmp1 = tmp2; 100: -: 73: 101: -: 74: /* add displacement and UB */ 102: #####: 75: disps[1] = (MPI_Aint)(array_of_starts[ndims-1]); 103: #####: 76: size = 1; 104: #####: 77: for (i=ndims-2; i>=0; i--) { 105: branch 0 never executed 106: branch 1 never executed 107: #####: 78: size *= (MPI_Aint)(array_of_sizes[i+1]); 108: #####: 79: disps[1] += size * (MPI_Aint)(array_of_starts[i]); 110: -: 81: } 111: -: 82: 112: #####: 83: disps[1] *= extent; 113: -: 84: 114: #####: 85: disps[2] = extent; 115: #####: 86: for (i=0; i=0; i--) { 125: branch 0 never executed 126: branch 1 never executed 127: #####: 98: switch(array_of_distribs[i]) { 131: branch 3 never executed 132: -: 99: case MPI_DISTRIBUTE_BLOCK: 133: #####: 100: MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], 136: -: 102: orig_extent, type_old, &type_new, 137: -: 103: st_offsets+i); 138: #####: 104: break; 139: -: 105: case MPI_DISTRIBUTE_CYCLIC: 140: #####: 106: MPIOI_Type_cyclic(array_of_gsizes, i, ndims, 144: -: 109: orig_extent, type_old, &type_new, 145: -: 110: st_offsets+i); 146: #####: 111: break; 147: -: 112: case MPI_DISTRIBUTE_NONE: 148: -: 113: /* treat it as a block distribution on 1 process */ 149: #####: 114: MPIOI_Type_block(array_of_gsizes, i, ndims, array_of_psizes[i], 153: -: 117: break; 154: -: 118: } 155: #####: 119: if (i != ndims-1) NMPI_Type_free(&type_old); 157: branch 1 never executed 158: call 2 never executed 159: #####: 120: type_old = type_new; 161: -: 122: 162: -: 123: /* add displacement and UB */ 163: #####: 124: disps[1] = st_offsets[ndims-1]; 164: #####: 125: tmp_size = 1; 165: #####: 126: for (i=ndims-2; i>=0; i--) { 166: branch 0 never executed 167: branch 1 never executed 168: #####: 127: tmp_size *= array_of_gsizes[i+1]; 169: #####: 128: disps[1] += ((MPI_Aint) tmp_size) * st_offsets[i]; 171: -: 130: } 172: -: 131: 173: #####: 132: disps[1] *= orig_extent; 174: -: 133: 175: #####: 134: disps[2] = orig_extent; 176: #####: 135: for (i=0; idim; i--) stride *= (MPI_Aint)(array_of_gsizes[i]); 269: branch 0 never executed 270: branch 1 never executed 271: #####: 202: NMPI_Type_hvector(mysize, 1, stride, type_old, type_new); 274: -: 204: } 275: -: 205: 276: #####: 206: *st_offset = blksize * rank; 277: -: 207: /* in terms of no. of elements of type oldtype in this dimension */ 278: #####: 208: if (mysize == 0) *st_offset = 0; 280: branch 1 never executed 281: -: 209: 282: #####: 210: return MPI_SUCCESS; 292: -: 220: MPI_Aint *st_offset) 293: function MPIOI_Type_cyclic called 0 returned 0% blocks executed 0% 294: #####: 221:{ 299: -: 226: MPI_Datatype type_tmp, types[3]; 300: -: 227: 301: #####: 228: if (darg == MPI_DISTRIBUTE_DFLT_DARG) blksize = 1; 302: branch 0 never executed 303: branch 1 never executed 304: #####: 229: else blksize = darg; 312: -: 230: 313: -: 236: 314: #####: 237: st_index = rank*blksize; 315: #####: 238: end_index = array_of_gsizes[dim] - 1; 316: -: 239: 317: #####: 240: if (end_index < st_index) local_size = 0; 319: branch 1 never executed 320: -: 241: else { 321: #####: 242: local_size = ((end_index - st_index + 1)/(nprocs*blksize))*blksize; 322: #####: 243: rem = (end_index - st_index + 1) % (nprocs*blksize); 323: #####: 244: local_size += (rem < blksize) ? rem : blksize; 324: -: 245: } 325: -: 246: 326: #####: 247: count = local_size/blksize; 327: #####: 248: rem = local_size % blksize; 328: -: 249: 329: #####: 250: stride = ((MPI_Aint) nprocs) * ((MPI_Aint) blksize) * orig_extent; 330: #####: 251: if (order == MPI_ORDER_FORTRAN) 331: branch 0 never executed 332: branch 1 never executed 333: #####: 252: for (i=0; idim; i--) stride *= (MPI_Aint)(array_of_gsizes[i]); 338: branch 1 never executed 339: -: 254: 340: #####: 255: NMPI_Type_hvector(count, blksize, stride, type_old, type_new); 341: call 0 never executed 342: -: 256: 343: #####: 257: if (rem) { 347: -: 259: it separately using MPI_Type_struct */ 348: -: 260: 349: #####: 261: types[0] = *type_new; 350: #####: 262: types[1] = type_old; 351: #####: 263: disps[0] = 0; 352: #####: 264: disps[1] = ((MPI_Aint) count) * stride; 353: #####: 265: blklens[0] = 1; 354: #####: 266: blklens[1] = rem; 355: -: 267: 356: #####: 268: NMPI_Type_struct(2, blklens, disps, types, &type_tmp); 357: call 0 never executed 358: -: 269: 359: #####: 270: NMPI_Type_free(type_new); 360: call 0 never executed 361: #####: 271: *type_new = type_tmp; 364: -: 274: /* In the first iteration, we need to set the displacement in that 365: -: 275: dimension correctly. */ 366: #####: 276: if (((order == MPI_ORDER_FORTRAN) && (dim == 0)) || 372: branch 5 never executed 373: -: 277: ((order == MPI_ORDER_C) && (dim == ndims-1))) { 374: #####: 278: types[0] = MPI_LB; 375: #####: 279: disps[0] = 0; 376: #####: 280: types[1] = *type_new; 377: #####: 281: disps[1] = ((MPI_Aint) rank) * ((MPI_Aint) blksize) * orig_extent; 378: #####: 282: types[2] = MPI_UB; 379: #####: 283: disps[2] = orig_extent * ((MPI_Aint)(array_of_gsizes[dim])); 380: #####: 284: blklens[0] = blklens[1] = blklens[2] = 1; 381: #####: 285: NMPI_Type_struct(3, blklens, disps, types, &type_tmp); 382: call 0 never executed 383: #####: 286: NMPI_Type_free(type_new); 384: call 0 never executed 385: #####: 287: *type_new = type_tmp; 386: -: 288: 387: #####: 289: *st_offset = 0; /* set it to 0 because it is taken care of in 389: -: 291: } 390: -: 292: else { 391: #####: 293: *st_offset = ((MPI_Aint) rank) * ((MPI_Aint) blksize); 394: -: 296: } 395: -: 297: 396: #####: 298: if (local_size == 0) *st_offset = 0; 398: branch 1 never executed 399: -: 299: 400: #####: 300: return MPI_SUCCESS; 116 line(s) not covered by tests in src/mpid/common/datatype/dataloop/darray_support.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop.c.gcov 65: -: 60:void PREPEND_PREFIX(Dataloop_free)(DLOOP_Dataloop **dataloop) 66: function MPID_Dataloop_free called 0 returned 0% blocks executed 0% 67: #####: 61:{ 68: -: 62: 69: #####: 63: if (*dataloop == NULL) return; 76: -: 68:#endif 77: -: 69: 78: #####: 70: memset(*dataloop, 0, sizeof(DLOOP_Dataloop_common)); 79: call 0 never executed 80: #####: 71: DLOOP_Free(*dataloop); 81: call 0 never executed 82: #####: 72: *dataloop = NULL; 83: #####: 73: return; 110: -: 100: int size) 111: function MPID_Dataloop_copy called 0 returned 0% blocks executed 0% 112: #####: 101:{ 119: -: 108: 120: -: 109: /* copy region first */ 121: #####: 110: DLOOP_Memcpy(dest, src, size); 151: -: 115: * structure, including pointers, in one big block. 152: -: 116: */ 153: #####: 117: ptrdiff = (DLOOP_Offset) ((char *) dest - (char *) src); 154: -: 118: 155: -: 119: /* traverse structure updating pointers */ 156: #####: 120: PREPEND_PREFIX(Dataloop_update)(dest, ptrdiff); 174: -: 137: DLOOP_Offset ptrdiff) 175: function MPID_Dataloop_update called 0 returned 0% blocks executed 0% 176: #####: 138:{ 179: -: 141: DLOOP_Dataloop **looparray; 180: -: 142: 181: #####: 143: switch(dataloop->kind & DLOOP_KIND_MASK) { 197: -: 154: */ 198: -: 155: 199: #####: 156: if (dataloop->loop_params.cm_t.dataloop) 203: -: 158: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.cm_t.dataloop + ptrdiff); 204: -: 159: 205: #####: 160: dataloop->loop_params.cm_t.dataloop = 208: -: 163: } 209: -: 164: 210: #####: 165: if (!(dataloop->kind & DLOOP_FINAL_MASK)) 211: branch 0 never executed 212: branch 1 never executed 213: #####: 166: PREPEND_PREFIX(Dataloop_update)(dataloop->loop_params.cm_t.dataloop, ptrdiff); 216: -: 168: 217: -: 169: case DLOOP_KIND_BLOCKINDEXED: 218: #####: 170: if (dataloop->loop_params.bi_t.offset_array) 221: -: 171: { 222: -: 172: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.bi_t.offset_array + ptrdiff); 223: #####: 173: dataloop->loop_params.bi_t.offset_array = 226: -: 176: } 227: -: 177: 228: #####: 178: if (dataloop->loop_params.bi_t.dataloop) 231: -: 179: { 232: -: 180: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.bi_t.dataloop + ptrdiff); 233: #####: 181: dataloop->loop_params.bi_t.dataloop = 236: -: 184: } 237: -: 185: 238: #####: 186: if (!(dataloop->kind & DLOOP_FINAL_MASK)) 239: branch 0 never executed 240: branch 1 never executed 241: #####: 187: PREPEND_PREFIX(Dataloop_update)(dataloop->loop_params.bi_t.dataloop, ptrdiff); 244: -: 189: 245: -: 190: case DLOOP_KIND_INDEXED: 246: #####: 191: if (dataloop->loop_params.i_t.blocksize_array) 249: -: 192: { 250: -: 193: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.i_t.blocksize_array + ptrdiff); 251: #####: 194: dataloop->loop_params.i_t.blocksize_array = 254: -: 197: } 255: -: 198: 256: #####: 199: if (dataloop->loop_params.i_t.offset_array) 259: -: 200: { 260: -: 201: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.i_t.offset_array + ptrdiff); 261: #####: 202: dataloop->loop_params.i_t.offset_array = 264: -: 205: } 265: -: 206: 266: #####: 207: if (dataloop->loop_params.i_t.dataloop) 269: -: 208: { 270: -: 209: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.i_t.dataloop + ptrdiff); 271: #####: 210: dataloop->loop_params.i_t.dataloop = 274: -: 213: } 275: -: 214: 276: #####: 215: if (!(dataloop->kind & DLOOP_FINAL_MASK)) 277: branch 0 never executed 278: branch 1 never executed 279: #####: 216: PREPEND_PREFIX(Dataloop_update)(dataloop->loop_params.i_t.dataloop, ptrdiff); 282: -: 218: 283: -: 219: case DLOOP_KIND_STRUCT: 284: #####: 220: if (dataloop->loop_params.s_t.blocksize_array) 287: -: 221: { 288: -: 222: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.s_t.blocksize_array + ptrdiff); 289: #####: 223: dataloop->loop_params.s_t.blocksize_array = 292: -: 226: } 293: -: 227: 294: #####: 228: if (dataloop->loop_params.s_t.offset_array) 297: -: 229: { 298: -: 230: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.s_t.offset_array + ptrdiff); 299: #####: 231: dataloop->loop_params.s_t.offset_array = 302: -: 234: } 303: -: 235: 304: #####: 236: if (dataloop->loop_params.s_t.dataloop_array) 307: -: 237: { 308: -: 238: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) dataloop->loop_params.s_t.dataloop_array + ptrdiff); 309: #####: 239: dataloop->loop_params.s_t.dataloop_array = 313: -: 243: 314: -: 244: /* fix the N dataloop pointers too */ 315: #####: 245: looparray = dataloop->loop_params.s_t.dataloop_array; 316: #####: 246: for (i=0; i < dataloop->loop_params.s_t.count; i++) { 317: branch 0 never executed 318: branch 1 never executed 319: #####: 247: if (looparray[i]) 322: -: 248: { 323: -: 249: MPID_Ensure_Aint_fits_in_pointer(MPI_VOID_PTR_CAST_TO_MPI_AINT (char *) looparray[i] + ptrdiff); 324: #####: 250: looparray[i] = (DLOOP_Dataloop *) MPI_AINT_CAST_TO_VOID_PTR 327: -: 253: } 328: -: 254: 329: #####: 255: if (dataloop->kind & DLOOP_FINAL_MASK) break; 331: branch 1 never executed 332: -: 256: 333: #####: 257: for (i=0; i < dataloop->loop_params.s_t.count; i++) { 334: branch 0 never executed 335: branch 1 never executed 336: #####: 258: PREPEND_PREFIX(Dataloop_update)(looparray[i], ptrdiff); 368: -: 287: int *new_loop_sz_p) 369: function MPID_Dataloop_alloc called 0 returned 0% blocks executed 0% 370: #####: 288:{ 371: #####: 289: PREPEND_PREFIX(Dataloop_alloc_and_copy)(kind, 403: -: 320: int *new_loop_sz_p) 404: function MPID_Dataloop_alloc_and_copy called 0 returned 0% blocks executed 0% 405: #####: 321:{ 406: #####: 322: int new_loop_sz = 0; 407: #####: 323: int align_sz = 8; /* default aligns everything to 8-byte boundaries */ 408: -: 324: int epsilon; 409: #####: 325: int loop_sz = sizeof(DLOOP_Dataloop); 410: #####: 326: int off_sz = 0, blk_sz = 0, ptr_sz = 0, extent_sz = 0; 414: -: 330: 415: -: 331:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 416: #####: 332: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 417: branch 0 never executed 418: branch 1 never executed 419: #####: 333: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 421: -: 335:#endif 422: -: 336: 423: #####: 337: if (old_loop != NULL) { 424: branch 0 never executed 425: branch 1 never executed 426: #####: 338: DLOOP_Assert((old_loop_sz % align_sz) == 0); 432: -: 340: 433: -: 341: /* calculate the space that we actually need for everything */ 434: #####: 342: switch (kind) { 440: -: 343: case DLOOP_KIND_STRUCT: 441: -: 344: /* need space for dataloop pointers and extents */ 442: #####: 345: ptr_sz = count * sizeof(DLOOP_Dataloop *); 443: #####: 346: extent_sz = count * sizeof(DLOOP_Offset); 444: -: 347: case DLOOP_KIND_INDEXED: 445: -: 348: /* need space for block sizes */ 446: #####: 349: blk_sz = count * sizeof(DLOOP_Count); 447: -: 350: case DLOOP_KIND_BLOCKINDEXED: 448: -: 351: /* need space for block offsets */ 449: #####: 352: off_sz = count * sizeof(DLOOP_Offset); 452: -: 355: break; 453: -: 356: default: 454: #####: 357: DLOOP_Assert(0); 458: -: 359: 459: -: 360: /* pad everything that we're going to allocate */ 460: #####: 361: epsilon = loop_sz % align_sz; 461: #####: 362: if (epsilon) loop_sz += align_sz - epsilon; 463: branch 1 never executed 464: -: 363: 465: #####: 364: epsilon = off_sz % align_sz; 466: #####: 365: if (epsilon) off_sz += align_sz - epsilon; 468: branch 1 never executed 469: -: 366: 470: #####: 367: epsilon = blk_sz % align_sz; 471: #####: 368: if (epsilon) blk_sz += align_sz - epsilon; 473: branch 1 never executed 474: -: 369: 475: #####: 370: epsilon = ptr_sz % align_sz; 476: #####: 371: if (epsilon) ptr_sz += align_sz - epsilon; 478: branch 1 never executed 479: -: 372: 480: #####: 373: epsilon = extent_sz % align_sz; 481: #####: 374: if (epsilon) extent_sz += align_sz - epsilon; 483: branch 1 never executed 484: -: 375: 485: #####: 376: new_loop_sz += loop_sz + off_sz + blk_sz + ptr_sz + 487: -: 378: 488: -: 379: /* allocate space */ 489: #####: 380: new_loop = (DLOOP_Dataloop *) DLOOP_Malloc(new_loop_sz); 490: call 0 never executed 491: #####: 381: if (new_loop == NULL) { 492: branch 0 never executed 493: branch 1 never executed 494: #####: 382: *new_loop_p = NULL; 495: #####: 383: return; 509: -: 397: 510: -: 398: /* set all the pointers in the new dataloop structure */ 511: #####: 399: switch (kind) { 523: -: 405: * - extents 524: -: 406: */ 525: #####: 407: new_loop->loop_params.s_t.dataloop_array = 526: -: 408: (DLOOP_Dataloop **) (((char *) new_loop) + loop_sz); 527: #####: 409: new_loop->loop_params.s_t.blocksize_array = 528: -: 410: (DLOOP_Count *) (((char *) new_loop) + loop_sz + ptr_sz); 529: #####: 411: new_loop->loop_params.s_t.offset_array = 530: -: 412: (DLOOP_Offset *) (((char *) new_loop) + loop_sz + 531: -: 413: ptr_sz + blk_sz); 532: #####: 414: new_loop->loop_params.s_t.el_extent_array = 533: -: 415: (DLOOP_Offset *) (((char *) new_loop) + loop_sz + 534: -: 416: ptr_sz + blk_sz + off_sz); 535: #####: 417: break; 539: -: 421: * - offsets 540: -: 422: */ 541: #####: 423: new_loop->loop_params.i_t.blocksize_array = 542: -: 424: (DLOOP_Count *) (((char *) new_loop) + loop_sz); 543: #####: 425: new_loop->loop_params.i_t.offset_array = 544: -: 426: (DLOOP_Offset *) (((char *) new_loop) + loop_sz + blk_sz); 545: #####: 427: if (old_loop == NULL) { 546: branch 0 never executed 547: branch 1 never executed 548: #####: 428: new_loop->loop_params.i_t.dataloop = NULL; 549: -: 429: } 550: -: 430: else { 551: #####: 431: new_loop->loop_params.i_t.dataloop = 555: -: 435: break; 556: -: 436: case DLOOP_KIND_BLOCKINDEXED: 557: #####: 437: new_loop->loop_params.bi_t.offset_array = 558: -: 438: (DLOOP_Offset *) (((char *) new_loop) + loop_sz); 559: #####: 439: if (old_loop == NULL) { 560: branch 0 never executed 561: branch 1 never executed 562: #####: 440: new_loop->loop_params.bi_t.dataloop = NULL; 563: -: 441: } 564: -: 442: else { 565: #####: 443: new_loop->loop_params.bi_t.dataloop = 569: -: 447: break; 570: -: 448: case DLOOP_KIND_CONTIG: 571: #####: 449: if (old_loop == NULL) { 572: branch 0 never executed 573: branch 1 never executed 574: #####: 450: new_loop->loop_params.c_t.dataloop = NULL; 575: -: 451: } 576: -: 452: else { 577: #####: 453: new_loop->loop_params.c_t.dataloop = 581: -: 457: break; 582: -: 458: case DLOOP_KIND_VECTOR: 583: #####: 459: if (old_loop == NULL) { 584: branch 0 never executed 585: branch 1 never executed 586: #####: 460: new_loop->loop_params.v_t.dataloop = NULL; 587: -: 461: } 588: -: 462: else { 589: #####: 463: new_loop->loop_params.v_t.dataloop = 593: -: 467: break; 594: -: 468: default: 595: #####: 469: DLOOP_Assert(0); 598: -: 470: } 599: -: 471: 600: #####: 472: pos = ((char *) new_loop) + (new_loop_sz - old_loop_sz); 601: #####: 473: if (old_loop != NULL) { 602: branch 0 never executed 603: branch 1 never executed 604: #####: 474: PREPEND_PREFIX(Dataloop_copy)(pos, old_loop, old_loop_sz); 606: -: 475: } 607: -: 476: 608: #####: 477: *new_loop_p = new_loop; 609: #####: 478: *new_loop_sz_p = new_loop_sz; 610: #####: 479: return; 641: -: 510: int *new_loop_sz_p) 642: function MPID_Dataloop_struct_alloc called 0 returned 0% blocks executed 0% 643: #####: 511:{ 644: #####: 512: int new_loop_sz = 0; 645: #####: 513: int align_sz = 8; /* default aligns everything to 8-byte boundaries */ 646: -: 514: int epsilon; 647: #####: 515: int loop_sz = sizeof(DLOOP_Dataloop); 651: -: 519: 652: -: 520:#ifdef HAVE_MAX_STRUCT_ALIGNMENT 653: #####: 521: if (align_sz > HAVE_MAX_STRUCT_ALIGNMENT) { 654: branch 0 never executed 655: branch 1 never executed 656: #####: 522: align_sz = HAVE_MAX_STRUCT_ALIGNMENT; 659: -: 525: 660: -: 526: /* calculate the space that we actually need for everything */ 661: #####: 527: ptr_sz = count * sizeof(DLOOP_Dataloop *); 662: #####: 528: extent_sz = count * sizeof(DLOOP_Offset); 663: #####: 529: blk_sz = count * sizeof(DLOOP_Count); 664: #####: 530: off_sz = count * sizeof(DLOOP_Offset); 665: #####: 531: basic_sz = sizeof(DLOOP_Dataloop); 666: -: 532: 667: -: 533: /* pad everything that we're going to allocate */ 668: #####: 534: epsilon = loop_sz % align_sz; 669: #####: 535: if (epsilon) loop_sz += align_sz - epsilon; 671: branch 1 never executed 672: -: 536: 673: #####: 537: epsilon = off_sz % align_sz; 674: #####: 538: if (epsilon) off_sz += align_sz - epsilon; 676: branch 1 never executed 677: -: 539: 678: #####: 540: epsilon = blk_sz % align_sz; 679: #####: 541: if (epsilon) blk_sz += align_sz - epsilon; 681: branch 1 never executed 682: -: 542: 683: #####: 543: epsilon = ptr_sz % align_sz; 684: #####: 544: if (epsilon) ptr_sz += align_sz - epsilon; 686: branch 1 never executed 687: -: 545: 688: #####: 546: epsilon = extent_sz % align_sz; 689: #####: 547: if (epsilon) extent_sz += align_sz - epsilon; 691: branch 1 never executed 692: -: 548: 693: #####: 549: epsilon = basic_sz % align_sz; 694: #####: 550: if (epsilon) basic_sz += align_sz - epsilon; 701: -: 555: */ 702: -: 556: 703: #####: 557: new_loop_sz += loop_sz + off_sz + blk_sz + ptr_sz + 705: -: 559: 706: -: 560: /* allocate space */ 707: #####: 561: new_loop = (DLOOP_Dataloop *) DLOOP_Malloc(new_loop_sz); 708: call 0 never executed 709: #####: 562: if (new_loop == NULL) { 710: branch 0 never executed 711: branch 1 never executed 712: #####: 563: *new_loop_p = NULL; 713: #####: 564: return; 728: -: 579: 729: -: 580: /* set all the pointers in the new dataloop structure */ 730: #####: 581: new_loop->loop_params.s_t.dataloop_array = (DLOOP_Dataloop **) 731: -: 582: (((char *) new_loop) + loop_sz); 732: #####: 583: new_loop->loop_params.s_t.blocksize_array = (DLOOP_Count *) 733: -: 584: (((char *) new_loop) + loop_sz + ptr_sz); 734: #####: 585: new_loop->loop_params.s_t.offset_array = (DLOOP_Offset *) 735: -: 586: (((char *) new_loop) + loop_sz + ptr_sz + blk_sz); 736: #####: 587: new_loop->loop_params.s_t.el_extent_array = (DLOOP_Offset *) 737: -: 588: (((char *) new_loop) + loop_sz + ptr_sz + blk_sz + off_sz); 738: -: 589: 739: #####: 590: *old_loop_p = (DLOOP_Dataloop *) 740: -: 591: (((char *) new_loop) + loop_sz + ptr_sz + blk_sz + off_sz + extent_sz); 741: #####: 592: *new_loop_p = new_loop; 742: #####: 593: *new_loop_sz_p = new_loop_sz; 743: -: 594: 744: #####: 595: return; 754: -: 605: DLOOP_Dataloop **new_loop_p) 755: function MPID_Dataloop_dup called 0 returned 0% blocks executed 0% 756: #####: 606:{ 757: -: 607: DLOOP_Dataloop *new_loop; 758: -: 608: 759: #####: 609: DLOOP_Assert(old_loop != NULL); 762: call 2 never executed 763: call 3 never executed 764: #####: 610: DLOOP_Assert(old_loop_sz > 0); 768: call 3 never executed 769: -: 611: 770: #####: 612: new_loop = (DLOOP_Dataloop *) DLOOP_Malloc(old_loop_sz); 771: call 0 never executed 772: #####: 613: if (new_loop == NULL) { 773: branch 0 never executed 774: branch 1 never executed 775: #####: 614: *new_loop_p = NULL; 776: #####: 615: return; 777: -: 616: } 778: -: 617: 779: #####: 618: PREPEND_PREFIX(Dataloop_copy)(new_loop, old_loop, old_loop_sz); 780: call 0 never executed 781: #####: 619: *new_loop_p = new_loop; 782: #####: 620: return; 796: -: 634: DLOOP_Offset (*sizefn)(DLOOP_Type el_type)) 797: function MPID_Dataloop_stream_size called 0 returned 0% blocks executed 0% 798: #####: 635:{ 799: #####: 636: DLOOP_Offset tmp_sz, tmp_ct = 1; 801: -: 638: for (;;) 802: -: 639: { 803: #####: 640: if ((dl_p->kind & DLOOP_KIND_MASK) == DLOOP_KIND_STRUCT) 807: -: 642: int i; 808: -: 643: 809: #####: 644: tmp_sz = 0; 810: #####: 645: for (i = 0; i < dl_p->loop_params.s_t.count; i++) 812: branch 1 never executed 813: -: 646: { 814: #####: 647: tmp_sz += (DLOOP_Offset)(dl_p->loop_params.s_t.blocksize_array[i]) * 816: -: 648: PREPEND_PREFIX(Dataloop_stream_size)(dl_p->loop_params.s_t.dataloop_array[i], sizefn); 817: -: 649: } 818: #####: 650: return tmp_sz * tmp_ct; 819: -: 651: } 820: -: 652: 821: #####: 653: switch (dl_p->kind & DLOOP_KIND_MASK) { 826: branch 4 never executed 827: -: 654: case DLOOP_KIND_CONTIG: 828: #####: 655: tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.c_t.count); 831: -: 658: (int) dl_p->loop_params.c_t.count, (MPI_Aint) tmp_ct); 832: -: 659:#endif 833: #####: 660: break; 834: -: 661: case DLOOP_KIND_VECTOR: 835: #####: 662: tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.v_t.count) * 841: -: 668: (MPI_Aint) tmp_ct); 842: -: 669:#endif 843: #####: 670: break; 844: -: 671: case DLOOP_KIND_BLOCKINDEXED: 845: #####: 672: tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.bi_t.count) * 851: -: 678: (MPI_Aint) tmp_ct); 852: -: 679:#endif 853: #####: 680: break; 854: -: 681: case DLOOP_KIND_INDEXED: 855: #####: 682: tmp_ct *= (DLOOP_Offset)(dl_p->loop_params.i_t.total_blocks); 859: -: 686: (MPI_Aint) tmp_ct); 860: -: 687:#endif 861: #####: 688: break; 869: -: 694: } 870: -: 695: 871: #####: 696: if (dl_p->kind & DLOOP_FINAL_MASK) break; 873: branch 1 never executed 874: -: 697: else { 875: #####: 698: DLOOP_Assert(dl_p->loop_params.cm_t.dataloop != NULL); 878: call 2 never executed 879: call 3 never executed 880: #####: 699: dl_p = dl_p->loop_params.cm_t.dataloop; 883: -: 702: 884: -: 703: /* call fn for size using bottom type, or use size if fnptr is NULL */ 885: #####: 704: tmp_sz = ((sizefn) ? sizefn(dl_p->el_type) : dl_p->el_size); 888: call 2 never executed 889: -: 705: 890: #####: 706: return tmp_sz * tmp_ct; 170 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/segment_ops.c.gcov 25: -: 20: void *v_paramp) 26: function MPID_Segment_contig_m2m called 0 returned 0% blocks executed 0% 27: #####: 21:{ 28: -: 22: DLOOP_Offset el_size; /* DLOOP_Count? */ 29: -: 23: DLOOP_Offset size; 30: #####: 24: struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp; 31: -: 25: 32: #####: 26: DLOOP_Handle_get_size_macro(el_type, el_size); 36: branch 3 never executed 37: call 4 never executed 38: #####: 27: size = *blocks_p * el_size; 47: -: 36:#endif 48: -: 37: 49: #####: 38: if (paramp->direction == DLOOP_M2M_TO_USERBUF) { 54: -: 41: * used on a memcpy */ 55: -: 42: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->userbuf)) + rel_off); 56: #####: 43: DLOOP_Memcpy((char *) paramp->userbuf + rel_off, paramp->streambuf, size); 85: -: 47: /* userbuf is a pointer (not a displacement) since it is being used on a memcpy */ 86: -: 48: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->userbuf)) + rel_off); 87: #####: 49: DLOOP_Memcpy(paramp->streambuf, (char *) paramp->userbuf + rel_off, size); 115: -: 52: /* streambuf is a pointer (not a displacement) since it was used on a memcpy */ 116: -: 53: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + size); 117: #####: 54: paramp->streambuf += size; 118: #####: 55: return 0; 135: -: 72: void *v_paramp) 136: function MPID_Segment_vector_m2m called 0 returned 0% blocks executed 0% 137: #####: 73:{ 138: -: 74: DLOOP_Count i, blocks_left, whole_count; 139: -: 75: DLOOP_Offset el_size; 140: #####: 76: struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp; 144: -: 80: /* userbuf is a pointer (not a displacement) since it is being used for a memory copy */ 145: -: 81: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->userbuf)) + rel_off); 146: #####: 82: cbufp = (char*) paramp->userbuf + rel_off; 147: #####: 83: DLOOP_Handle_get_size_macro(el_type, el_size); 152: call 4 never executed 153: -: 84: 154: #####: 85: whole_count = (blksz > 0) ? (*blocks_p / (DLOOP_Offset) blksz) : 0; 155: branch 0 never executed 156: branch 1 never executed 157: #####: 86: blocks_left = (blksz > 0) ? (*blocks_p % (DLOOP_Offset) blksz) : 0; 159: branch 1 never executed 160: -: 87: 161: #####: 88: if (paramp->direction == DLOOP_M2M_TO_USERBUF) { 162: branch 0 never executed 163: branch 1 never executed 164: #####: 89: if (el_size == 8 169: -: 90: MPIR_ALIGN8_TEST(paramp->streambuf,cbufp)) 170: -: 91: { 171: #####: 92: MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, stride, 251: branch 79 never executed 252: -: 93: int64_t, blksz, whole_count); 253: #####: 94: MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, 0, 294: -: 95: int64_t, blocks_left, 1); 295: -: 96: } 296: #####: 97: else if (el_size == 4 301: -: 98: MPIR_ALIGN4_TEST(paramp->streambuf,cbufp)) 302: -: 99: { 303: #####: 100: MPIDI_COPY_TO_VEC((paramp->streambuf), cbufp, stride, 383: branch 79 never executed 384: -: 101: int32_t, blksz, whole_count); 385: #####: 102: MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, 0, 426: -: 103: int32_t, blocks_left, 1); 427: -: 104: } 428: #####: 105: else if (el_size == 2) { 429: branch 0 never executed 430: branch 1 never executed 431: #####: 106: MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, stride, 511: branch 79 never executed 512: -: 107: int16_t, blksz, whole_count); 513: #####: 108: MPIDI_COPY_TO_VEC(paramp->streambuf, cbufp, 0, 555: -: 110: } 556: -: 111: else { 557: #####: 112: for (i=0; i < whole_count; i++) { 558: branch 0 never executed 559: branch 1 never executed 560: #####: 113: DLOOP_Memcpy(cbufp, paramp->streambuf, ((DLOOP_Offset) blksz) * el_size); 588: -: 116: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + 589: -: 117: ((DLOOP_Offset) blksz) * el_size); 590: #####: 118: paramp->streambuf += ((DLOOP_Offset) blksz) * el_size; 591: -: 119: 592: -: 120: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (cbufp)) + stride); 593: #####: 121: cbufp += stride; 594: -: 122: } 595: #####: 123: if (blocks_left) { 596: branch 0 never executed 597: branch 1 never executed 598: #####: 124: DLOOP_Memcpy(cbufp, paramp->streambuf, ((DLOOP_Offset) blocks_left) * el_size); 627: -: 128: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + 628: -: 129: ((DLOOP_Offset) blocks_left) * el_size); 629: #####: 130: paramp->streambuf += ((DLOOP_Offset) blocks_left) * el_size; 632: -: 133: } 633: -: 134: else /* M2M_FROM_USERBUF */ { 634: #####: 135: if (el_size == 8 639: -: 136: MPIR_ALIGN8_TEST(cbufp,paramp->streambuf)) 640: -: 137: { 641: #####: 138: MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, stride, 721: branch 79 never executed 722: -: 139: int64_t, blksz, whole_count); 723: #####: 140: MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, 0, 764: -: 141: int64_t, blocks_left, 1); 765: -: 142: } 766: #####: 143: else if (el_size == 4 771: -: 144: MPIR_ALIGN4_TEST(cbufp,paramp->streambuf)) 772: -: 145: { 773: #####: 146: MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, stride, 853: branch 79 never executed 854: -: 147: int32_t, blksz, whole_count); 855: #####: 148: MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, 0, 896: -: 149: int32_t, blocks_left, 1); 897: -: 150: } 898: #####: 151: else if (el_size == 2) { 899: branch 0 never executed 900: branch 1 never executed 901: #####: 152: MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, stride, 981: branch 79 never executed 982: -: 153: int16_t, blksz, whole_count); 983: #####: 154: MPIDI_COPY_FROM_VEC(cbufp, paramp->streambuf, 0, 1025: -: 156: } 1026: -: 157: else { 1027: #####: 158: for (i=0; i < whole_count; i++) { 1028: branch 0 never executed 1029: branch 1 never executed 1030: #####: 159: DLOOP_Memcpy(paramp->streambuf, cbufp, (DLOOP_Offset) blksz * el_size); 1059: -: 163: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + 1060: -: 164: (DLOOP_Offset) blksz * el_size); 1061: #####: 165: paramp->streambuf += (DLOOP_Offset) blksz * el_size; 1062: #####: 166: cbufp += stride; 1063: -: 167: } 1064: #####: 168: if (blocks_left) { 1065: branch 0 never executed 1066: branch 1 never executed 1067: #####: 169: DLOOP_Memcpy(paramp->streambuf, cbufp, (DLOOP_Offset) blocks_left * el_size); 1096: -: 173: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + 1097: -: 174: (DLOOP_Offset) blocks_left * el_size); 1098: #####: 175: paramp->streambuf += (DLOOP_Offset) blocks_left * el_size; 1101: -: 178: } 1102: -: 179: 1103: #####: 180: return 0; 1115: -: 192: void *v_paramp) 1116: function MPID_Segment_blkidx_m2m called 0 returned 0% blocks executed 0% 1117: #####: 193:{ 1118: #####: 194: DLOOP_Count curblock = 0; 1119: -: 195: DLOOP_Offset el_size; 1120: #####: 196: DLOOP_Offset blocks_left = *blocks_p; 1121: -: 197: char *cbufp; 1122: #####: 198: struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp; 1123: -: 199: 1124: #####: 200: DLOOP_Handle_get_size_macro(el_type, el_size); 1129: call 4 never executed 1130: -: 201: 1131: #####: 202: while (blocks_left) { 1134: -: 203: char *src, *dest; 1135: -: 204: 1136: #####: 205: DLOOP_Assert(curblock < count); 1145: -: 210: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->userbuf)) + 1146: -: 211: rel_off + offsetarray[curblock]); 1147: #####: 212: cbufp = (char*) paramp->userbuf + rel_off + offsetarray[curblock]; 1148: -: 213: 1149: #####: 214: if (blocklen > blocks_left) blocklen = blocks_left; 1151: branch 1 never executed 1152: -: 215: 1153: #####: 216: if (paramp->direction == DLOOP_M2M_TO_USERBUF) { 1154: branch 0 never executed 1155: branch 1 never executed 1156: #####: 217: src = paramp->streambuf; 1157: #####: 218: dest = cbufp; 1158: -: 219: } 1159: -: 220: else { 1160: #####: 221: src = cbufp; 1161: #####: 222: dest = paramp->streambuf; 1163: -: 224: 1164: -: 225: /* note: macro modifies dest buffer ptr, so we must reset */ 1165: #####: 226: if (el_size == 8 1170: -: 227: MPIR_ALIGN8_TEST(src, dest)) 1171: -: 228: { 1172: #####: 229: MPIDI_COPY_FROM_VEC(src, dest, 0, int64_t, blocklen, 1); 1212: branch 39 never executed 1213: -: 230: } 1214: #####: 231: else if (el_size == 4 1219: -: 232: MPIR_ALIGN4_TEST(src,dest)) 1220: -: 233: { 1221: #####: 234: MPIDI_COPY_FROM_VEC(src, dest, 0, int32_t, blocklen, 1); 1261: branch 39 never executed 1262: -: 235: } 1263: #####: 236: else if (el_size == 2) { 1264: branch 0 never executed 1265: branch 1 never executed 1266: #####: 237: MPIDI_COPY_FROM_VEC(src, dest, 0, int16_t, blocklen, 1); 1307: -: 238: } 1308: -: 239: else { 1309: #####: 240: DLOOP_Memcpy(dest, src, (DLOOP_Offset) blocklen * el_size); 1340: -: 246: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + 1341: -: 247: (DLOOP_Offset) blocklen * el_size); 1342: #####: 248: paramp->streambuf += (DLOOP_Offset) blocklen * el_size; 1343: #####: 249: blocks_left -= blocklen; 1344: #####: 250: curblock++; 1345: -: 251: } 1346: -: 252: 1347: #####: 253: return 0; 1359: -: 265: void *v_paramp) 1360: function MPID_Segment_index_m2m called 0 returned 0% blocks executed 0% 1361: #####: 266:{ 1362: #####: 267: int curblock = 0; 1363: -: 268: DLOOP_Offset el_size; 1364: #####: 269: DLOOP_Offset cur_block_sz, blocks_left = *blocks_p; 1365: -: 270: char *cbufp; 1366: #####: 271: struct PREPEND_PREFIX(m2m_params) *paramp = v_paramp; 1367: -: 272: 1368: #####: 273: DLOOP_Handle_get_size_macro(el_type, el_size); 1373: call 4 never executed 1374: -: 274: 1375: #####: 275: while (blocks_left) { 1378: -: 276: char *src, *dest; 1379: -: 277: 1380: #####: 278: DLOOP_Assert(curblock < count); 1383: call 2 never executed 1384: call 3 never executed 1385: #####: 279: cur_block_sz = blockarray[curblock]; 1390: -: 284: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->userbuf)) + 1391: -: 285: rel_off + offsetarray[curblock]); 1392: #####: 286: cbufp = (char*) paramp->userbuf + rel_off + offsetarray[curblock]; 1393: -: 287: 1394: #####: 288: if (cur_block_sz > blocks_left) cur_block_sz = blocks_left; 1396: branch 1 never executed 1397: -: 289: 1398: #####: 290: if (paramp->direction == DLOOP_M2M_TO_USERBUF) { 1399: branch 0 never executed 1400: branch 1 never executed 1401: #####: 291: src = paramp->streambuf; 1402: #####: 292: dest = cbufp; 1403: -: 293: } 1404: -: 294: else { 1405: #####: 295: src = cbufp; 1406: #####: 296: dest = paramp->streambuf; 1408: -: 298: 1409: -: 299: /* note: macro modifies dest buffer ptr, so we must reset */ 1410: #####: 300: if (el_size == 8 1415: -: 301: MPIR_ALIGN8_TEST(src, dest)) 1416: -: 302: { 1417: #####: 303: MPIDI_COPY_FROM_VEC(src, dest, 0, int64_t, cur_block_sz, 1); 1457: branch 39 never executed 1458: -: 304: } 1459: #####: 305: else if (el_size == 4 1464: -: 306: MPIR_ALIGN4_TEST(src,dest)) 1465: -: 307: { 1466: #####: 308: MPIDI_COPY_FROM_VEC(src, dest, 0, int32_t, cur_block_sz, 1); 1506: branch 39 never executed 1507: -: 309: } 1508: #####: 310: else if (el_size == 2) { 1509: branch 0 never executed 1510: branch 1 never executed 1511: #####: 311: MPIDI_COPY_FROM_VEC(src, dest, 0, int16_t, cur_block_sz, 1); 1552: -: 312: } 1553: -: 313: else { 1554: #####: 314: DLOOP_Memcpy(dest, src, cur_block_sz * el_size); 1585: -: 320: MPID_Ensure_Aint_fits_in_pointer((MPI_VOID_PTR_CAST_TO_MPI_AINT (paramp->streambuf)) + 1586: -: 321: cur_block_sz * el_size); 1587: #####: 322: paramp->streambuf += cur_block_sz * el_size; 1588: #####: 323: blocks_left -= cur_block_sz; 1589: #####: 324: curblock++; 1590: -: 325: } 1591: -: 326: 1592: #####: 327: return 0; 1598: -: 333: void *streambuf) 1599: function MPID_Segment_pack called 0 returned 0% blocks executed 0% 1600: #####: 334:{ 1605: -: 339: * bit. 1606: -: 340: */ 1607: #####: 341: params.userbuf = segp->ptr; 1608: #####: 342: params.streambuf = streambuf; 1609: #####: 343: params.direction = DLOOP_M2M_FROM_USERBUF; 1610: -: 344: 1611: #####: 345: PREPEND_PREFIX(Segment_manipulate)(segp, first, lastp, 1625: -: 358: void *streambuf) 1626: function MPID_Segment_unpack called 0 returned 0% blocks executed 0% 1627: #####: 359:{ 1632: -: 364: * bit. 1633: -: 365: */ 1634: #####: 366: params.userbuf = segp->ptr; 1635: #####: 367: params.streambuf = streambuf; 1636: #####: 368: params.direction = DLOOP_M2M_TO_USERBUF; 1637: -: 369: 1638: #####: 370: PREPEND_PREFIX(Segment_manipulate)(segp, first, lastp, 1663: -: 394: void *v_paramp) 1664: function DLOOP_Segment_contig_count_block called 0 returned 0% blocks executed 0% 1665: #####: 395:{ 1666: -: 396: DLOOP_Offset size, el_size; 1667: #####: 397: struct PREPEND_PREFIX(contig_blocks_params) *paramp = v_paramp; 1668: -: 398: 1669: #####: 399: DLOOP_Assert(*blocks_p > 0); 1673: call 3 never executed 1674: -: 400: 1675: #####: 401: DLOOP_Handle_get_size_macro(el_type, el_size); 1679: branch 3 never executed 1680: call 4 never executed 1681: #####: 402: size = *blocks_p * el_size; 1688: -: 409:#endif 1689: -: 410: 1690: #####: 411: if (paramp->count > 0 && rel_off == paramp->last_loc) 1695: -: 412: { 1696: -: 413: /* this region is adjacent to the last */ 1697: #####: 414: paramp->last_loc += size; 1699: -: 416: else { 1700: -: 417: /* new region */ 1701: #####: 418: paramp->last_loc = rel_off + size; 1702: #####: 419: paramp->count++; 1703: -: 420: } 1704: #####: 421: return 0; 1727: -: 444: void *v_paramp) 1728: function DLOOP_Segment_vector_count_block called 0 returned 0% blocks executed 0% 1729: #####: 445:{ 1730: -: 446: DLOOP_Count new_blk_count; 1731: -: 447: DLOOP_Offset size, el_size; 1732: #####: 448: struct PREPEND_PREFIX(contig_blocks_params) *paramp = v_paramp; 1733: -: 449: 1734: #####: 450: DLOOP_Assert(count > 0 && blksz > 0 && *blocks_p > 0); 1740: call 5 never executed 1741: -: 451: 1742: #####: 452: DLOOP_Handle_get_size_macro(el_type, el_size); 1746: branch 3 never executed 1747: call 4 never executed 1748: #####: 453: size = el_size * blksz; 1749: #####: 454: new_blk_count = count; 1750: -: 455: 1751: -: 456: /* if size == stride, then blocks are adjacent to one another */ 1752: #####: 457: if (size == stride) new_blk_count = 1; 1754: branch 1 never executed 1755: -: 458: 1756: #####: 459: if (paramp->count > 0 && rel_off == paramp->last_loc) 1761: -: 460: { 1762: -: 461: /* first block sits at end of last block */ 1763: #####: 462: new_blk_count--; 1764: -: 463: } 1765: -: 464: 1766: #####: 465: paramp->last_loc = rel_off + ((DLOOP_Offset)(count-1)) * stride + size; 1767: #####: 466: paramp->count += new_blk_count; 1768: #####: 467: return 0; 1783: -: 482: void *v_paramp) 1784: function DLOOP_Segment_blkidx_count_block called 0 returned 0% blocks executed 0% 1785: #####: 483:{ 1786: -: 484: DLOOP_Count i, new_blk_count; 1787: -: 485: DLOOP_Offset size, el_size, last_loc; 1788: #####: 486: struct PREPEND_PREFIX(contig_blocks_params) *paramp = v_paramp; 1789: -: 487: 1790: #####: 488: DLOOP_Assert(count > 0 && blksz > 0 && *blocks_p > 0); 1796: call 5 never executed 1797: -: 489: 1798: #####: 490: DLOOP_Handle_get_size_macro(el_type, el_size); 1802: branch 3 never executed 1803: call 4 never executed 1804: #####: 491: size = el_size * (DLOOP_Offset) blksz; 1805: #####: 492: new_blk_count = count; 1806: -: 493: 1807: #####: 494: if (paramp->count > 0 && ((rel_off + offsetarray[0]) == paramp->last_loc)) 1812: -: 495: { 1813: -: 496: /* first block sits at end of last block */ 1814: #####: 497: new_blk_count--; 1815: -: 498: } 1816: -: 499: 1817: #####: 500: last_loc = rel_off + offsetarray[0] + size; 1818: #####: 501: for (i=1; i < count; i++) { 1819: branch 0 never executed 1820: branch 1 never executed 1821: #####: 502: if (last_loc == rel_off + offsetarray[i]) new_blk_count--; 1823: branch 1 never executed 1824: -: 503: 1825: #####: 504: last_loc = rel_off + offsetarray[i] + size; 1826: -: 505: } 1827: -: 506: 1828: #####: 507: paramp->last_loc = last_loc; 1829: #####: 508: paramp->count += new_blk_count; 1830: #####: 509: return 0; 1845: -: 524: void *v_paramp) 1846: function DLOOP_Segment_index_count_block called 0 returned 0% blocks executed 0% 1847: #####: 525:{ 1848: -: 526: DLOOP_Count new_blk_count; 1849: -: 527: DLOOP_Offset el_size, last_loc; 1850: #####: 528: struct PREPEND_PREFIX(contig_blocks_params) *paramp = v_paramp; 1851: -: 529: 1852: #####: 530: DLOOP_Assert(count > 0 && *blocks_p > 0); 1858: call 5 never executed 1859: -: 531: 1860: #####: 532: DLOOP_Handle_get_size_macro(el_type, el_size); 1864: branch 3 never executed 1865: call 4 never executed 1866: #####: 533: new_blk_count = count; 1867: -: 534: 1868: #####: 535: if (paramp->count > 0 && ((rel_off + offsetarray[0]) == paramp->last_loc)) 1873: -: 536: { 1874: -: 537: /* first block sits at end of last block */ 1875: #####: 538: new_blk_count--; 1891: -: 554: } 1892: -: 555:#else 1893: #####: 556: last_loc = rel_off + offsetarray[count-1] + ((DLOOP_Offset) blockarray[count-1]) * el_size; 1894: -: 557:#endif 1895: -: 558: 1896: #####: 559: paramp->last_loc = last_loc; 1897: #####: 560: paramp->count += new_blk_count; 1898: #####: 561: return 0; 1908: -: 571: DLOOP_Count *countp) 1909: function MPID_Segment_count_contig_blocks called 0 returned 0% blocks executed 0% 1910: #####: 572:{ 1911: -: 573: struct PREPEND_PREFIX(contig_blocks_params) params; 1912: -: 574: 1913: #####: 575: params.count = 0; 1914: #####: 576: params.last_loc = 0; 1918: -: 580: * functions using the count do not optimize in the same way 1919: -: 581: * (e.g., flatten code) */ 1920: #####: 582: PREPEND_PREFIX(Segment_manipulate)(segp, 1929: -: 590: (void *) ¶ms); 1930: -: 591: 1931: #####: 592: *countp = params.count; 1962: -: 623: void *v_paramp) 1963: function DLOOP_Segment_contig_mpi_flatten called 0 returned 0% blocks executed 0% 1964: #####: 624:{ 1965: -: 625: int last_idx, size; 1966: -: 626: DLOOP_Offset el_size; 1967: #####: 627: char *last_end = NULL; 1968: #####: 628: struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp; 1969: -: 629: 1970: #####: 630: DLOOP_Handle_get_size_macro(el_type, el_size); 1974: branch 3 never executed 1975: call 4 never executed 1976: #####: 631: size = *blocks_p * el_size; 1977: -: 632: 1978: #####: 633: last_idx = paramp->index - 1; 1979: #####: 634: if (last_idx >= 0) { 1985: -: 638: * sizeof a pointer is less than the sizeof an MPI_Aint. 1986: -: 639: */ 1987: #####: 640: last_end = (char*) MPI_AINT_CAST_TO_VOID_PTR 1993: -: 646: * a pointer. Just let it truncate. 1994: -: 647: */ 1995: #####: 648: if ((last_idx == paramp->length-1) && 2004: -: 653: * function that we are done (and that we didn't process any blocks). 2005: -: 654: */ 2006: #####: 655: *blocks_p = 0; 2007: #####: 656: return 1; 2008: -: 657: } 2009: #####: 658: else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off))) 2014: -: 659: { 2015: -: 660: /* add this size to the last vector rather than using up another one */ 2016: #####: 661: paramp->blklens[last_idx] += size; 2021: -: 666: * sign extend. 2022: -: 667: */ 2023: #####: 668: paramp->disps[last_idx+1] = MPI_PTR_DISP_CAST_TO_MPI_AINT bufp + rel_off; 2024: #####: 669: paramp->blklens[last_idx+1] = size; 2025: #####: 670: paramp->index++; 2026: -: 671: } 2027: #####: 672: return 0; 2053: -: 698: void *v_paramp) 2054: function DLOOP_Segment_vector_mpi_flatten called 0 returned 0% blocks executed 0% 2055: #####: 699:{ 2056: -: 700: int i, size, blocks_left; 2057: -: 701: DLOOP_Offset el_size; 2058: #####: 702: struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp; 2059: -: 703: 2060: #####: 704: DLOOP_Handle_get_size_macro(el_type, el_size); 2064: branch 3 never executed 2065: call 4 never executed 2066: #####: 705: blocks_left = (int)*blocks_p; 2067: -: 706: 2068: #####: 707: for (i=0; i < count && blocks_left > 0; i++) { 2070: branch 1 never executed 2071: -: 708: int last_idx; 2072: #####: 709: char *last_end = NULL; 2073: -: 710: 2074: #####: 711: if (blocks_left > blksz) { 2075: branch 0 never executed 2076: branch 1 never executed 2077: #####: 712: size = blksz * (int) el_size; 2078: #####: 713: blocks_left -= blksz; 2080: -: 715: else { 2081: -: 716: /* last pass */ 2082: #####: 717: size = blocks_left * (int) el_size; 2083: #####: 718: blocks_left = 0; 2084: -: 719: } 2085: -: 720: 2086: #####: 721: last_idx = paramp->index - 1; 2087: #####: 722: if (last_idx >= 0) { 2095: -: 728: * than the sizeof an MPI_Aint. 2096: -: 729: */ 2097: #####: 730: last_end = (char *) MPI_AINT_CAST_TO_VOID_PTR 2104: -: 737: * Just let it truncate. 2105: -: 738: */ 2106: #####: 739: if ((last_idx == paramp->length-1) && 2114: -: 743: * the end of the last one. 2115: -: 744: */ 2116: #####: 745: *blocks_p -= (blocks_left + (size / (int) el_size)); 2120: -: 749: *blocks_p); 2121: -: 750:#endif 2122: #####: 751: return 1; 2123: -: 752: } 2124: #####: 753: else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off))) 2129: -: 754: { 2130: -: 755: /* add this size to the last vector rather than using up new one */ 2131: #####: 756: paramp->blklens[last_idx] += size; 2136: -: 761: * sign extend. 2137: -: 762: */ 2138: #####: 763: paramp->disps[last_idx+1] = MPI_PTR_DISP_CAST_TO_MPI_AINT bufp + rel_off; 2139: #####: 764: paramp->blklens[last_idx+1] = size; 2140: #####: 765: paramp->index++; 2141: -: 766: } 2142: -: 767: 2143: #####: 768: rel_off += stride; 2154: -: 779: */ 2155: -: 780: 2156: #####: 781: DLOOP_Assert(blocks_left == 0); 2159: call 2 never executed 2160: call 3 never executed 2161: #####: 782: return 0; 2171: -: 792: void *v_paramp) 2172: function DLOOP_Segment_blkidx_mpi_flatten called 0 returned 0% blocks executed 0% 2173: #####: 793:{ 2174: -: 794: int i, size, blocks_left; 2175: -: 795: DLOOP_Offset el_size; 2176: #####: 796: struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp; 2177: -: 797: 2178: #####: 798: DLOOP_Handle_get_size_macro(el_type, el_size); 2182: branch 3 never executed 2183: call 4 never executed 2184: #####: 799: blocks_left = *blocks_p; 2185: -: 800: 2186: #####: 801: for (i=0; i < count && blocks_left > 0; i++) { 2188: branch 1 never executed 2189: -: 802: int last_idx; 2190: #####: 803: char *last_end = NULL; 2191: -: 804: 2192: #####: 805: if (blocks_left > blksz) { 2193: branch 0 never executed 2194: branch 1 never executed 2195: #####: 806: size = blksz * (int) el_size; 2196: #####: 807: blocks_left -= blksz; 2198: -: 809: else { 2199: -: 810: /* last pass */ 2200: #####: 811: size = blocks_left * (int) el_size; 2201: #####: 812: blocks_left = 0; 2202: -: 813: } 2203: -: 814: 2204: #####: 815: last_idx = paramp->index - 1; 2205: #####: 816: if (last_idx >= 0) { 2213: -: 822: * than the sizeof an MPI_Aint. 2214: -: 823: */ 2215: #####: 824: last_end = (char*) MPI_AINT_CAST_TO_VOID_PTR 2222: -: 831: * sum fits in a pointer. Just let it truncate. 2223: -: 832: */ 2224: #####: 833: if ((last_idx == paramp->length-1) && 2232: -: 837: * the end of the last one. 2233: -: 838: */ 2234: #####: 839: *blocks_p -= ((DLOOP_Offset) blocks_left + 2235: -: 840: (((DLOOP_Offset) size) / el_size)); 2236: #####: 841: return 1; 2237: -: 842: } 2238: #####: 843: else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off))) 2243: -: 844: { 2244: -: 845: /* add this size to the last vector rather than using up new one */ 2245: #####: 846: paramp->blklens[last_idx] += size; 2250: -: 851: * Just let it sign extend. 2251: -: 852: */ 2252: #####: 853: paramp->disps[last_idx+1] = MPI_PTR_DISP_CAST_TO_MPI_AINT bufp + 2253: -: 854: rel_off + offsetarray[i]; 2254: #####: 855: paramp->blklens[last_idx+1] = size; 2255: #####: 856: paramp->index++; 2260: -: 861: * blocks_p 2261: -: 862: */ 2262: #####: 863: DLOOP_Assert(blocks_left == 0); 2265: call 2 never executed 2266: call 3 never executed 2267: #####: 864: return 0; 2277: -: 874: void *v_paramp) 2278: function DLOOP_Segment_index_mpi_flatten called 0 returned 0% blocks executed 0% 2279: #####: 875:{ 2280: -: 876: int i, size, blocks_left; 2281: -: 877: DLOOP_Offset el_size; 2282: #####: 878: struct PREPEND_PREFIX(mpi_flatten_params) *paramp = v_paramp; 2283: -: 879: 2284: #####: 880: DLOOP_Handle_get_size_macro(el_type, el_size); 2288: branch 3 never executed 2289: call 4 never executed 2290: #####: 881: blocks_left = *blocks_p; 2291: -: 882: 2292: #####: 883: for (i=0; i < count && blocks_left > 0; i++) { 2294: branch 1 never executed 2295: -: 884: int last_idx; 2296: #####: 885: char *last_end = NULL; 2297: -: 886: 2298: #####: 887: if (blocks_left > blockarray[i]) { 2299: branch 0 never executed 2300: branch 1 never executed 2301: #####: 888: size = blockarray[i] * (int) el_size; 2302: #####: 889: blocks_left -= blockarray[i]; 2304: -: 891: else { 2305: -: 892: /* last pass */ 2306: #####: 893: size = blocks_left * (int) el_size; 2307: #####: 894: blocks_left = 0; 2308: -: 895: } 2309: -: 896: 2310: #####: 897: last_idx = paramp->index - 1; 2311: #####: 898: if (last_idx >= 0) { 2319: -: 904: * than the sizeof an MPI_Aint. 2320: -: 905: */ 2321: #####: 906: last_end = (char *) MPI_AINT_CAST_TO_VOID_PTR 2328: -: 913: * sum fits in a pointer. Just let it truncate. 2329: -: 914: */ 2330: #####: 915: if ((last_idx == paramp->length-1) && 2338: -: 919: * the end of the last one. 2339: -: 920: */ 2340: #####: 921: *blocks_p -= (blocks_left + (size / (int) el_size)); 2341: #####: 922: return 1; 2342: -: 923: } 2343: #####: 924: else if (last_idx >= 0 && (last_end == ((char *) bufp + rel_off))) 2348: -: 925: { 2349: -: 926: /* add this size to the last vector rather than using up new one */ 2350: #####: 927: paramp->blklens[last_idx] += size; 2355: -: 932: * Just let it sign extend. 2356: -: 933: */ 2357: #####: 934: paramp->disps[last_idx+1] = MPI_PTR_DISP_CAST_TO_MPI_AINT bufp + 2358: -: 935: rel_off + offsetarray[i]; 2359: #####: 936: paramp->blklens[last_idx+1] = size; /* these blocks are in bytes */ 2360: #####: 937: paramp->index++; 2365: -: 942: * blocks_p 2366: -: 943: */ 2367: #####: 944: DLOOP_Assert(blocks_left == 0); 2370: call 2 never executed 2371: call 3 never executed 2372: #####: 945: return 0; 2393: -: 966: int *lengthp) 2394: function MPID_Segment_mpi_flatten called 0 returned 0% blocks executed 0% 2395: #####: 967:{ 2396: -: 968: struct PREPEND_PREFIX(mpi_flatten_params) params; 2397: -: 969: 2398: #####: 970: DLOOP_Assert(*lengthp > 0); 2402: call 3 never executed 2403: -: 971: 2404: #####: 972: params.index = 0; 2405: #####: 973: params.length = *lengthp; 2406: #####: 974: params.blklens = blklens; 2407: #####: 975: params.disps = disps; 2408: -: 976: 2409: #####: 977: PREPEND_PREFIX(Segment_manipulate)(segp, 2419: -: 986: 2420: -: 987: /* last value already handled by MPID_Segment_manipulate */ 2421: #####: 988: *lengthp = params.index; 261 line(s) not covered by tests in src/mpid/common/datatype/dataloop/segment_ops.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create_contig.c.gcov 35: -: 30: int flag) 36: function MPID_Dataloop_create_contiguous called 0 returned 0% blocks executed 0% 37: #####: 31:{ 38: -: 32: DLOOP_Count count; 39: #####: 33: int is_builtin, apply_contig_coalescing = 0; 42: -: 36: DLOOP_Dataloop *new_dlp; 43: -: 37: 44: #####: 38: count = (DLOOP_Count) icount; /* avoid subsequent casting */ 45: -: 39: 46: #####: 40: is_builtin = (DLOOP_Handle_hasloop_macro(oldtype)) ? 0 : 1; 47: -: 41: 48: #####: 42: if (is_builtin) 50: branch 1 never executed 51: -: 43: { 52: #####: 44: new_loop_depth = 1; 54: -: 46: else 55: -: 47: { 56: #####: 48: int old_loop_sz = 0, old_loop_depth = 0; 57: #####: 49: DLOOP_Offset old_size = 0, old_extent = 0; 58: -: 50: DLOOP_Dataloop *old_loop_ptr; 59: -: 51: 60: #####: 52: DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag); 67: branch 6 never executed 68: branch 7 never executed 69: #####: 53: DLOOP_Handle_get_loopdepth_macro(oldtype, old_loop_depth, flag); 76: branch 6 never executed 77: branch 7 never executed 78: #####: 54: DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag); 85: branch 6 never executed 86: branch 7 never executed 87: #####: 55: DLOOP_Handle_get_size_macro(oldtype, old_size); 91: branch 3 never executed 92: call 4 never executed 93: #####: 56: DLOOP_Handle_get_extent_macro(oldtype, old_extent); 98: -: 57: 99: -: 58: /* if we have a simple combination of contigs, coalesce */ 100: #####: 59: if (((old_loop_ptr->kind & DLOOP_KIND_MASK) == DLOOP_KIND_CONTIG) 104: -: 61: { 105: -: 62: /* will just copy contig and multiply count */ 106: #####: 63: apply_contig_coalescing = 1; 107: #####: 64: new_loop_depth = old_loop_depth; 109: -: 66: else 110: -: 67: { 111: #####: 68: new_loop_depth = old_loop_depth + 1; 113: -: 70: } 114: -: 71: 115: #####: 72: if (is_builtin) 117: branch 1 never executed 118: -: 73: { 119: #####: 74: DLOOP_Offset basic_sz = 0; 120: -: 75: 121: #####: 76: PREPEND_PREFIX(Dataloop_alloc)(DLOOP_KIND_CONTIG, 130: -: 79: &new_loop_sz); 131: -: 83: 132: #####: 84: DLOOP_Handle_get_size_macro(oldtype, basic_sz); 136: branch 3 never executed 137: call 4 never executed 138: #####: 85: new_dlp->kind = DLOOP_KIND_CONTIG | DLOOP_FINAL_MASK; 139: -: 86: 140: #####: 87: if (flag == DLOOP_DATALOOP_ALL_BYTES) 142: branch 1 never executed 143: -: 88: { 144: #####: 89: count *= basic_sz; 145: #####: 90: new_dlp->el_size = 1; 146: #####: 91: new_dlp->el_extent = 1; 147: #####: 92: new_dlp->el_type = MPI_BYTE; 149: -: 94: else 150: -: 95: { 151: #####: 96: new_dlp->el_size = basic_sz; 152: #####: 97: new_dlp->el_extent = new_dlp->el_size; 153: #####: 98: new_dlp->el_type = oldtype; 154: -: 99: } 155: -: 100: 156: #####: 101: new_dlp->loop_params.c_t.count = count; 160: -: 105: /* user-defined base type (oldtype) */ 161: -: 106: DLOOP_Dataloop *old_loop_ptr; 162: #####: 107: int old_loop_sz = 0; 163: -: 108: 164: #####: 109: DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag); 171: branch 6 never executed 172: branch 7 never executed 173: #####: 110: DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag); 181: branch 7 never executed 182: -: 111: 183: #####: 112: if (apply_contig_coalescing) 186: -: 113: { 187: -: 114: /* make a copy of the old loop and multiply the count */ 188: #####: 115: PREPEND_PREFIX(Dataloop_dup)(old_loop_ptr, 196: -: 117: &new_dlp); 197: -: 121: 198: #####: 122: new_dlp->loop_params.c_t.count *= count; 199: -: 123: 200: #####: 124: new_loop_sz = old_loop_sz; 201: #####: 125: DLOOP_Handle_get_loopdepth_macro(oldtype, new_loop_depth, flag); 212: -: 128: { 213: -: 129: /* allocate space for new loop including copy of old */ 214: #####: 130: PREPEND_PREFIX(Dataloop_alloc_and_copy)(DLOOP_KIND_CONTIG, 225: -: 135: &new_loop_sz); 226: -: 139: 227: #####: 140: new_dlp->kind = DLOOP_KIND_CONTIG; 228: #####: 141: DLOOP_Handle_get_size_macro(oldtype, new_dlp->el_size); 232: branch 3 never executed 233: call 4 never executed 234: #####: 142: DLOOP_Handle_get_extent_macro(oldtype, new_dlp->el_extent); 237: branch 2 never executed 238: call 3 never executed 239: #####: 143: DLOOP_Handle_get_basic_type_macro(oldtype, new_dlp->el_type); 244: call 4 never executed 245: -: 144: 246: #####: 145: new_dlp->loop_params.c_t.count = count; 248: -: 147: } 249: -: 148: 250: #####: 149: *dlp_p = new_dlp; 251: #####: 150: *dlsz_p = new_loop_sz; 252: #####: 151: *dldepth_p = new_loop_depth; 253: -: 152: 254: #####: 153: return 0; 49 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create_contig.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create_indexed.c.gcov 52: -: 47: int flag) 53: function MPID_Dataloop_create_indexed called 0 returned 0% blocks executed 0% 54: #####: 48:{ 57: -: 51: DLOOP_Count first; 58: -: 52: 59: #####: 53: DLOOP_Count old_type_count = 0, contig_count, count; 61: -: 55: struct DLOOP_Dataloop *new_dlp; 62: -: 56: 63: #####: 57: count = (DLOOP_Count) icount; /* avoid subsequent casting */ 65: -: 59: 66: -: 60: /* if count is zero, handle with contig code, call it an int */ 67: #####: 61: if (count == 0) 69: branch 1 never executed 70: -: 62: { 71: #####: 63: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 76: -: 67: dldepth_p, 77: -: 68: flag); 78: #####: 69: return err; 80: -: 71: 81: -: 72: /* Skip any initial zero-length blocks */ 82: #####: 73: for (first = 0; first < count; first++) 83: branch 0 never executed 84: branch 1 never executed 85: #####: 74: if ((DLOOP_Count) blocklength_array[first]) 86: branch 0 never executed 87: branch 1 never executed 88: #####: 75: break; 89: -: 76: 90: -: 77: 91: #####: 78: is_builtin = (DLOOP_Handle_hasloop_macro(oldtype)) ? 0 : 1; 92: -: 79: 93: #####: 80: if (is_builtin) 95: branch 1 never executed 96: -: 81: { 97: #####: 82: DLOOP_Handle_get_extent_macro(oldtype, old_extent); 100: branch 2 never executed 101: call 3 never executed 102: #####: 83: old_loop_depth = 0; 104: -: 85: else 105: -: 86: { 106: #####: 87: DLOOP_Handle_get_extent_macro(oldtype, old_extent); 109: branch 2 never executed 110: call 3 never executed 111: #####: 88: DLOOP_Handle_get_loopdepth_macro(oldtype, old_loop_depth, flag); 120: -: 89: } 121: -: 90: 122: #####: 91: for (i=first; i < count; i++) 124: branch 1 never executed 125: -: 92: { 126: #####: 93: old_type_count += (DLOOP_Count) blocklength_array[i]; 127: -: 94: } 128: -: 95: 129: #####: 96: contig_count = PREPEND_PREFIX(Type_indexed_count_contig)(count, 135: -: 101: 136: -: 102: /* if contig_count is zero (no data), handle with contig code */ 137: #####: 103: if (contig_count == 0) 139: branch 1 never executed 140: -: 104: { 141: #####: 105: err = PREPEND_PREFIX(Dataloop_create_contiguous)(0, 146: -: 109: dldepth_p, 147: -: 110: flag); 148: #####: 111: return err; 154: -: 117: * store it as a contiguous rather than an indexed dataloop. 155: -: 118: */ 156: #####: 119: if ((contig_count == 1) && 162: -: 121: (dispinbytes && ((MPI_Aint *) displacement_array)[first] == 0))) 163: -: 122: { 164: #####: 123: err = PREPEND_PREFIX(Dataloop_create_contiguous)((int) old_type_count, 169: -: 127: dldepth_p, 170: -: 128: flag); 171: #####: 129: return err; 178: -: 136: * blocks. 179: -: 137: */ 180: #####: 138: if (contig_count == 1) 182: branch 1 never executed 183: -: 139: { 184: #####: 140: err = PREPEND_PREFIX(Dataloop_create_blockindexed)(1, 193: -: 148: flag); 194: -: 149: 195: #####: 150: return err; 201: -: 156: * blockindexed rather than an indexed dataloop. 202: -: 157: */ 203: #####: 158: blksz = blocklength_array[first]; 204: #####: 159: for (i = first+1; i < count; i++) 206: branch 1 never executed 207: -: 160: { 208: #####: 161: if (blocklength_array[i] != blksz) 210: branch 1 never executed 211: -: 162: { 212: #####: 163: blksz--; 213: #####: 164: break; 214: -: 165: } 215: -: 166: } 216: #####: 167: if (blksz == blocklength_array[first]) 218: branch 1 never executed 219: -: 168: { 220: #####: 169: err = PREPEND_PREFIX(Dataloop_create_blockindexed)(icount-first, 229: -: 177: flag); 230: -: 178: 231: #####: 179: return err; 242: -: 190: /* otherwise storing as an indexed dataloop */ 243: -: 191: 244: #####: 192: if (is_builtin) 246: branch 1 never executed 247: -: 193: { 248: #####: 194: PREPEND_PREFIX(Dataloop_alloc)(DLOOP_KIND_INDEXED, 257: -: 197: &new_loop_sz); 258: -: 201: 259: #####: 202: new_dlp->kind = DLOOP_KIND_INDEXED | DLOOP_FINAL_MASK; 260: -: 203: 261: #####: 204: if (flag == DLOOP_DATALOOP_ALL_BYTES) 264: -: 205: { 265: -: 206: /* blocklengths are modified below */ 266: #####: 207: new_dlp->el_size = 1; 267: #####: 208: new_dlp->el_extent = 1; 268: #####: 209: new_dlp->el_type = MPI_BYTE; 270: -: 211: else 271: -: 212: { 272: #####: 213: new_dlp->el_size = old_extent; 273: #####: 214: new_dlp->el_extent = old_extent; 274: #####: 215: new_dlp->el_type = oldtype; 277: -: 218: else 278: -: 219: { 279: #####: 220: DLOOP_Dataloop *old_loop_ptr = NULL; 280: #####: 221: int old_loop_sz = 0; 281: -: 222: 282: #####: 223: DLOOP_Handle_get_loopptr_macro(oldtype, old_loop_ptr, flag); 289: branch 6 never executed 290: branch 7 never executed 291: #####: 224: DLOOP_Handle_get_loopsize_macro(oldtype, old_loop_sz, flag); 299: branch 7 never executed 300: -: 225: 301: #####: 226: PREPEND_PREFIX(Dataloop_alloc_and_copy)(DLOOP_KIND_INDEXED, 312: -: 231: &new_loop_sz); 313: -: 235: 314: #####: 236: new_dlp->kind = DLOOP_KIND_INDEXED; 315: -: 237: 316: #####: 238: DLOOP_Handle_get_size_macro(oldtype, new_dlp->el_size); 320: branch 3 never executed 321: call 4 never executed 322: #####: 239: DLOOP_Handle_get_extent_macro(oldtype, new_dlp->el_extent); 325: branch 2 never executed 326: call 3 never executed 327: #####: 240: DLOOP_Handle_get_basic_type_macro(oldtype, new_dlp->el_type); 333: -: 241: } 334: -: 242: 335: #####: 243: new_dlp->loop_params.i_t.count = contig_count; 336: #####: 244: new_dlp->loop_params.i_t.total_blocks = old_type_count; 340: -: 248: * regardless of dispinbytes, we store displacements in bytes in loop. 341: -: 249: */ 342: #####: 250: DLOOP_Type_indexed_array_copy(count, 350: -: 257: old_extent); 351: -: 258: 352: #####: 259: if (is_builtin && (flag == DLOOP_DATALOOP_ALL_BYTES)) 355: -: 260: { 356: -: 261: DLOOP_Count *tmp_blklen_array = 357: #####: 262: new_dlp->loop_params.i_t.blocksize_array; 358: -: 263: 359: #####: 264: for (i=0; i < contig_count; i++) 362: -: 265: { 363: -: 266: /* increase block lengths so they are in bytes */ 364: #####: 267: tmp_blklen_array[i] *= old_extent; 365: -: 268: } 366: -: 269: 367: #####: 270: new_dlp->loop_params.i_t.total_blocks *= old_extent; 368: -: 271: } 369: -: 272: 370: #####: 273: *dlp_p = new_dlp; 371: #####: 274: *dlsz_p = new_loop_sz; 372: #####: 275: *dldepth_p = old_loop_depth + 1; 373: -: 276: 374: #####: 277: return MPI_SUCCESS; 394: -: 297: DLOOP_Offset old_extent) 395: function DLOOP_Type_indexed_array_copy called 0 returned 0% blocks executed 0% 396: #####: 298:{ 397: #####: 299: DLOOP_Count i, first, cur_idx = 0; 398: -: 300: 399: -: 301: /* Skip any initial zero-length blocks */ 400: #####: 302: for (first = 0; first < count; ++first) 401: branch 0 never executed 402: branch 1 never executed 403: #####: 303: if ((DLOOP_Count) in_blklen_array[first]) 404: branch 0 never executed 405: branch 1 never executed 406: #####: 304: break; 407: -: 305: 408: #####: 306: out_blklen_array[0] = (DLOOP_Count) in_blklen_array[first]; 409: -: 307: 410: #####: 308: if (!dispinbytes) 412: branch 1 never executed 413: -: 309: { 414: #####: 310: out_disp_array[0] = (DLOOP_Offset) 415: -: 311: ((int *) in_disp_array)[first] * old_extent; 416: -: 312: 417: #####: 313: for (i = first+1; i < count; ++i) 419: branch 1 never executed 420: -: 314: { 421: #####: 315: if (in_blklen_array[i] == 0) 423: branch 1 never executed 424: -: 316: { 425: #####: 317: continue; 426: -: 318: } 427: #####: 319: else if (out_disp_array[cur_idx] + 432: -: 322: { 433: -: 323: /* adjacent to current block; add to block */ 434: #####: 324: out_blklen_array[cur_idx] += (DLOOP_Count) in_blklen_array[i]; 436: -: 326: else 437: -: 327: { 438: #####: 328: cur_idx++; 439: #####: 329: DLOOP_Assert(cur_idx < contig_count); 442: call 2 never executed 443: call 3 never executed 444: #####: 330: out_disp_array[cur_idx] = 445: -: 331: ((DLOOP_Offset) ((int *) in_disp_array)[i]) * old_extent; 446: #####: 332: out_blklen_array[cur_idx] = in_blklen_array[i]; 450: -: 336: else /* input displacements already in bytes */ 451: -: 337: { 452: #####: 338: out_disp_array[0] = (DLOOP_Offset) ((MPI_Aint *) in_disp_array)[first]; 453: -: 339: 454: #####: 340: for (i = first+1; i < count; ++i) 456: branch 1 never executed 457: -: 341: { 458: #####: 342: if (in_blklen_array[i] == 0) 460: branch 1 never executed 461: -: 343: { 462: #####: 344: continue; 463: -: 345: } 464: #####: 346: else if (out_disp_array[cur_idx] + 469: -: 349: { 470: -: 350: /* adjacent to current block; add to block */ 471: #####: 351: out_blklen_array[cur_idx] += in_blklen_array[i]; 473: -: 353: else 474: -: 354: { 475: #####: 355: cur_idx++; 476: #####: 356: DLOOP_Assert(cur_idx < contig_count); 479: call 2 never executed 480: call 3 never executed 481: #####: 357: out_disp_array[cur_idx] = 482: -: 358: (DLOOP_Offset) ((MPI_Aint *) in_disp_array)[i]; 483: #####: 359: out_blklen_array[cur_idx] = (DLOOP_Count) in_blklen_array[i]; 486: -: 362: } 487: -: 363: 488: #####: 364: DLOOP_Assert(cur_idx == contig_count - 1); 508: -: 380: DLOOP_Offset old_extent) 509: function MPID_Type_indexed_count_contig called 0 returned 0% blocks executed 0% 510: #####: 381:{ 511: #####: 382: DLOOP_Count i, contig_count = 1; 512: -: 383: DLOOP_Count cur_blklen, first; 513: -: 384: 514: #####: 385: if (count) 517: -: 386: { 518: -: 387: /* Skip any initial zero-length blocks */ 519: #####: 388: for (first = 0; first < count; ++first) 520: branch 0 never executed 521: branch 1 never executed 522: #####: 389: if ((DLOOP_Count) blocklength_array[first]) 523: branch 0 never executed 524: branch 1 never executed 525: #####: 390: break; 526: -: 391: 527: #####: 392: if (first == count) { /* avoid invalid reads later on */ 528: branch 0 never executed 529: branch 1 never executed 530: #####: 393: contig_count = 0; 531: #####: 394: return contig_count; 532: -: 395: } 533: -: 396: 534: #####: 397: cur_blklen = (DLOOP_Count) blocklength_array[first]; 535: #####: 398: if (!dispinbytes) 538: -: 399: { 539: -: 400: DLOOP_Offset cur_tdisp = 540: #####: 401: (DLOOP_Offset) ((int *) displacement_array)[first]; 541: -: 402: 542: #####: 403: for (i = first+1; i < count; ++i) 544: branch 1 never executed 545: -: 404: { 546: #####: 405: if (blocklength_array[i] == 0) 548: branch 1 never executed 549: -: 406: { 550: #####: 407: continue; 551: -: 408: } 552: #####: 409: else if (cur_tdisp + (DLOOP_Offset) cur_blklen == 556: -: 411: { 557: -: 412: /* adjacent to current block; add to block */ 558: #####: 413: cur_blklen += (DLOOP_Count) blocklength_array[i]; 560: -: 415: else 561: -: 416: { 562: #####: 417: cur_tdisp = (DLOOP_Offset) ((int *) displacement_array)[i]; 563: #####: 418: cur_blklen = (DLOOP_Count) blocklength_array[i]; 564: #####: 419: contig_count++; 569: -: 424: { 570: -: 425: DLOOP_Offset cur_bdisp = 571: #####: 426: (DLOOP_Offset) ((MPI_Aint *) displacement_array)[first]; 572: -: 427: 573: #####: 428: for (i = first+1; i < count; ++i) 575: branch 1 never executed 576: -: 429: { 577: #####: 430: if (blocklength_array[i] == 0) 579: branch 1 never executed 580: -: 431: { 581: #####: 432: continue; 582: -: 433: } 583: #####: 434: else if (cur_bdisp + (DLOOP_Offset) cur_blklen * old_extent == 587: -: 436: { 588: -: 437: /* adjacent to current block; add to block */ 589: #####: 438: cur_blklen += (DLOOP_Count) blocklength_array[i]; 591: -: 440: else 592: -: 441: { 593: #####: 442: cur_bdisp = 594: -: 443: (DLOOP_Offset) ((MPI_Aint *) displacement_array)[i]; 595: #####: 444: cur_blklen = (DLOOP_Count) blocklength_array[i]; 596: #####: 445: contig_count++; 599: -: 448: } 600: -: 449: } 601: #####: 450: return contig_count; 124 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create_indexed.c.gcov Uncovered lines in src/mpid/common/datatype/dataloop/dataloop_create_pairtype.c.gcov 48: -: 43: int flag) 49: function MPID_Dataloop_create_pairtype called 0 returned 0% blocks executed 0% 50: #####: 44:{ 51: #####: 45: int blocks[2] = { 1, 1 }; 53: -: 47: MPI_Datatype types[2]; 54: -: 48: 55: #####: 49: DLOOP_Assert(type == MPI_FLOAT_INT || type == MPI_DOUBLE_INT || 65: -: 51: type == MPI_LONG_DOUBLE_INT || type == MPI_2INT); 66: -: 52: 67: #####: 53: switch(type) { 74: branch 6 never executed 75: -: 54: case MPI_FLOAT_INT: 76: #####: 55: PAIRTYPE_CONTENTS(MPI_FLOAT, float, MPI_INT, int); 77: #####: 56: break; 78: -: 57: case MPI_DOUBLE_INT: 79: #####: 58: PAIRTYPE_CONTENTS(MPI_DOUBLE, double, MPI_INT, int); 80: #####: 59: break; 81: -: 60: case MPI_LONG_INT: 82: #####: 61: PAIRTYPE_CONTENTS(MPI_LONG, long, MPI_INT, int); 83: #####: 62: break; 84: -: 63: case MPI_SHORT_INT: 85: #####: 64: PAIRTYPE_CONTENTS(MPI_SHORT, short, MPI_INT, int); 86: #####: 65: break; 87: -: 66: case MPI_LONG_DOUBLE_INT: 88: #####: 67: PAIRTYPE_CONTENTS(MPI_LONG_DOUBLE, long double, MPI_INT, int); 89: #####: 68: break; 90: -: 69: case MPI_2INT: 91: #####: 70: PAIRTYPE_CONTENTS(MPI_INT, int, MPI_INT, int); 93: -: 72: } 94: -: 73: 95: #####: 74: return PREPEND_PREFIX(Dataloop_create_struct)(2, 16 line(s) not covered by tests in src/mpid/common/datatype/dataloop/dataloop_create_pairtype.c.gcov Uncovered lines in src/mpid/ch3/src/mpid_abort.c.gcov 43: -: 38: const char *error_msg) 44: function MPID_Abort called 0 returned 0% blocks executed 0% 45: #####: 39:{ 46: -: 40: int rank; 47: #####: 41: char msg[MPI_MAX_ERROR_STRING] = ""; 51: -: 45: MPIDI_FUNC_ENTER(MPID_STATE_MPID_ABORT); 52: -: 46: 53: #####: 47: if (error_msg == NULL) { 55: branch 1 never executed 56: -: 48: /* Create a default error message */ 57: #####: 49: error_msg = error_str; 60: -: 52: communicator, so using other than the rank in comm world does not 61: -: 53: identify the process, as the message suggests */ 62: #####: 54: if (comm) 64: branch 1 never executed 65: -: 55: { 66: #####: 56: rank = comm->rank; 68: -: 58: else 69: -: 59: { 70: #####: 60: if (MPIR_Process.comm_world != NULL) 72: branch 1 never executed 73: -: 61: { 74: #####: 62: rank = MPIR_Process.comm_world->rank; 76: -: 64: else 77: -: 65: { 78: #####: 66: rank = -1; 80: -: 68: } 81: -: 69: 82: #####: 70: if (mpi_errno != MPI_SUCCESS) 84: branch 1 never executed 85: -: 71: { 86: #####: 72: MPIR_Err_get_string(mpi_errno, msg, MPI_MAX_ERROR_STRING, NULL); 87: call 0 never executed 88: -: 73: /* FIXME: Not internationalized */ 89: #####: 74: MPIU_Snprintf(error_str, sizeof(error_str), "internal ABORT - process %d: %s", rank, msg); 93: -: 77: { 94: -: 78: /* FIXME: Not internationalized */ 95: #####: 79: MPIU_Snprintf(error_str, sizeof(error_str), "internal ABORT - process %d", rank); 110: -: 93: MPIDI_CH3_Abort(exit_code, error_msg); 111: -: 94:#elif defined(MPIDI_DEV_IMPLEMENTS_ABORT) 112: #####: 95: MPIDI_CH3I_PMI_Abort(exit_code, error_msg); 120: -: 101: /* ch3_abort should not return but if it does, exit here. If it does, 121: -: 102: add the function exit code before calling the final exit. */ 122: #####: 104: MPIU_Exit(exit_code); 123: call 0 never executed 124: -: 105: 125: #####: 106: return MPI_ERR_INTERN; 133: -: 114:static int MPIDI_CH3I_PMI_Abort(int exit_code, const char *error_msg) 134: function MPIDI_CH3I_PMI_Abort called 0 returned 0% blocks executed 0% 135: #####: 115:{ 145: -: 125: * broken), but not all PMs might display respect the message 146: -: 126: * (this problem was noticed with SLURM). */ 147: #####: 127: MPIU_Error_printf("%s\n", error_msg); 148: call 0 never executed 149: #####: 128: fflush(stderr); 158: -: 136: PMI2_Abort(TRUE, error_msg); 159: -: 137:#else 160: #####: 138: PMI_Abort(exit_code, error_msg); 163: -: 140: 164: -: 141: /* if abort returns for some reason, exit here */ 165: #####: 142: exit(exit_code); 21 line(s) not covered by tests in src/mpid/ch3/src/mpid_abort.c.gcov Uncovered lines in src/mpid/ch3/src/stdlib.h.gcov 289: -: 284:__NTH (atoi (__const char *__nptr)) 290: function atoi called 0 returned 0% blocks executed 0% 291: #####: 285:{ 292: #####: 286: return (int) strtol (__nptr, (char **) NULL, 10); 2 line(s) not covered by tests in src/mpid/ch3/src/stdlib.h.gcov Uncovered lines in src/mpid/ch3/src/ch3u_buffer.c.gcov 43: -: 38: int * rmpi_errno) 44: function MPIDI_CH3U_Buffer_copy called 0 returned 0% blocks executed 0% 45: #####: 39:{ 55: -: 49: 56: -: 50: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_BUFFER_COPY); 57: #####: 51: *smpi_errno = MPI_SUCCESS; 58: #####: 52: *rmpi_errno = MPI_SUCCESS; 59: -: 53: 60: #####: 54: MPIDI_Datatype_get_info(scount, sdt, sdt_contig, sdata_sz, sdt_ptr, sdt_true_lb); 66: branch 5 never executed 67: call 6 never executed 68: #####: 55: MPIDI_Datatype_get_info(rcount, rdt, rdt_contig, rdata_sz, rdt_ptr, rdt_true_lb); 89: -: 56: 90: -: 67: 91: #####: 68: if (sdata_sz == 0) 93: branch 1 never executed 94: -: 69: { 95: #####: 70: *rsz = 0; 96: #####: 71: goto fn_exit; 97: -: 72: } 98: -: 73: 99: #####: 74: if (sdt_contig && rdt_contig) 102: -: 75: { 103: -: 76: MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY); 104: #####: 77: MPIU_Memcpy((char *)rbuf + rdt_true_lb, (const char *)sbuf + sdt_true_lb, sdata_sz); 129: call 23 never executed 130: call 24 never executed 131: #####: 79: *rsz = sdata_sz; 132: -: 80: } 133: #####: 81: else if (sdt_contig) 138: -: 84: MPI_Aint last; 139: -: 85: 140: #####: 86: MPID_Segment_init(rbuf, rcount, rdt, &seg, 0); 141: call 0 never executed 142: #####: 87: last = sdata_sz; 143: -: 88: MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST, 144: -: 89: "pre-unpack last=" MPIDI_MSG_SZ_FMT, last )); 145: #####: 90: MPID_Segment_unpack(&seg, 0, &last, (char*)sbuf + sdt_true_lb); 157: -: 92: "pre-unpack last=" MPIDI_MSG_SZ_FMT, last )); 158: -: 99: 159: #####: 100: *rsz = last; 160: -: 101: } 161: #####: 102: else if (rdt_contig) 166: -: 105: MPI_Aint last; 167: -: 106: 168: #####: 107: MPID_Segment_init(sbuf, scount, sdt, &seg, 0); 169: call 0 never executed 170: #####: 108: last = sdata_sz; 171: -: 109: MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST, 172: -: 110: "pre-pack last=" MPIDI_MSG_SZ_FMT, last )); 173: #####: 111: MPID_Segment_pack(&seg, 0, &last, (char*)rbuf + rdt_true_lb); 185: -: 113: "post-pack last=" MPIDI_MSG_SZ_FMT, last )); 186: -: 120: 187: #####: 121: *rsz = last; 196: -: 130: MPIDI_msg_sz_t rfirst; 197: -: 131: 198: #####: 132: buf = MPIU_Malloc(MPIDI_COPY_BUFFER_SZ); 212: call 0 never executed 213: -: 143: 214: #####: 144: MPID_Segment_init(sbuf, scount, sdt, &sseg, 0); 215: call 0 never executed 216: #####: 145: MPID_Segment_init(rbuf, rcount, rdt, &rseg, 0); 217: call 0 never executed 218: -: 146: 219: #####: 147: sfirst = 0; 220: #####: 148: rfirst = 0; 221: #####: 149: buf_off = 0; 226: -: 154: char * buf_end; 227: -: 155: 228: #####: 156: if (sdata_sz - sfirst > MPIDI_COPY_BUFFER_SZ - buf_off) 230: branch 1 never executed 231: -: 157: { 232: #####: 158: last = sfirst + (MPIDI_COPY_BUFFER_SZ - buf_off); 234: -: 160: else 235: -: 161: { 236: #####: 162: last = sdata_sz; 240: -: 166: "pre-pack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 241: -: 167: sfirst, last )); 242: #####: 168: MPID_Segment_pack(&sseg, sfirst, &last, buf + buf_off); 253: -: 171: sfirst, last )); 254: -: 175: 255: #####: 176: buf_end = buf + buf_off + (last - sfirst); 256: #####: 177: sfirst = last; 259: -: 180: "pre-unpack first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 260: -: 181: rfirst, last )); 261: #####: 182: MPID_Segment_unpack(&rseg, rfirst, &last, buf); 272: -: 185: rfirst, last )); 273: -: 189: 274: #####: 190: rfirst = last; 275: -: 191: 276: #####: 192: if (rfirst == sdata_sz) 279: -: 193: { 280: -: 194: /* successful completion */ 281: #####: 195: break; 294: -: 197: 295: -: 206: 296: #####: 207: buf_off = sfirst - rfirst; 297: #####: 208: if (buf_off > 0) 301: -: 210: MPIU_DBG_MSG_FMT(CH3_OTHER, VERBOSE, (MPIU_DBG_FDEST, 302: -: 211: "moved " MPIDI_MSG_SZ_FMT " bytes to the beginning of the tmp buffer", buf_off)); 303: #####: 212: memmove(buf, buf_end - buf_off, buf_off); 306: -: 214: } 307: -: 215: 308: #####: 216: *rsz = rfirst; 309: #####: 217: MPIU_Free(buf); 311: -: 218: } 312: -: 219: 313: #####: 220: fn_exit: 323: -: 230: MPI_Datatype datatype ) 324: function MPIDI_CH3_RecvFromSelf called 0 returned 0% blocks executed 0% 325: #####: 231:{ 326: #####: 232: MPID_Request * const sreq = rreq->partner_request; 327: -: 233: 328: #####: 234: if (sreq != NULL) 332: -: 236: MPIDI_msg_sz_t data_sz; 333: -: 237: 334: #####: 238: MPIDI_CH3U_Buffer_copy(sreq->dev.user_buf, sreq->dev.user_count, 337: -: 240: buf, count, datatype, &data_sz, 338: -: 241: &rreq->status.MPI_ERROR); 339: #####: 242: rreq->status.count = (int)data_sz; 340: #####: 243: MPID_REQUEST_SET_COMPLETED(sreq); 341: #####: 244: MPID_Request_release(sreq); 357: -: 253: /* no other thread can possibly be waiting on rreq, so it is safe to 358: -: 254: reset ref_count and cc */ 359: #####: 255: rreq->cc = 0; 360: #####: 256: MPIU_Object_set_ref(rreq, 1); 361: -: 257: 362: #####: 258: return MPI_SUCCESS; 53 line(s) not covered by tests in src/mpid/ch3/src/ch3u_buffer.c.gcov Uncovered lines in src/mpid/ch3/src/mpiimpl.h.gcov 115: -: 110:static MPIU_DBG_INLINE_KEYWORD void MPIUI_Memcpy(void * dst, const void * src, size_t len) 116: function MPIUI_Memcpy called 0 returned 0% blocks executed 0% 117: #####: 111:{ 118: #####: 112: memcpy(dst, src, len); 2 line(s) not covered by tests in src/mpid/ch3/src/mpiimpl.h.gcov Uncovered lines in src/mpid/ch3/src/ch3u_comm_spawn_multiple.c.gcov 43: -: 38: int *nkeys_ptr ) 44: function mpi_to_pmi_keyvals called 0 returned 0% blocks executed 0% 45: #####: 39:{ 46: -: 40: char key[MPI_MAX_INFO_KEY]; 47: #####: 41: PMI_keyval_t *kv = 0; 48: #####: 42: int i, nkeys = 0, vallen, flag, mpi_errno=MPI_SUCCESS; 49: -: 43: 50: #####: 44: if (!info_ptr || info_ptr->handle == MPI_INFO_NULL) { 56: -: 46: } 57: -: 47: 58: #####: 48: mpi_errno = NMPI_Info_get_nkeys( info_ptr->handle, &nkeys ); 62: branch 1 never executed 63: call 2 never executed 64: #####: 50: if (nkeys == 0) { 65: branch 0 never executed 66: branch 1 never executed 67: #####: 51: goto fn_exit; 68: -: 52: } 69: #####: 53: kv = (PMI_keyval_t *)MPIU_Malloc( nkeys * sizeof(PMI_keyval_t) ); 74: call 2 never executed 75: -: 55: 76: #####: 56: for (i=0; ihandle, i, key ); 83: branch 1 never executed 84: call 2 never executed 85: #####: 59: mpi_errno = NMPI_Info_get_valuelen( info_ptr->handle, key, &vallen, 90: branch 1 never executed 91: call 2 never executed 92: #####: 62: kv[i].key = MPIU_Strdup(key); 93: call 0 never executed 94: #####: 63: kv[i].val = MPIU_Malloc( vallen + 1 ); 95: call 0 never executed 96: #####: 64: if (!kv[i].key || !kv[i].val) { 102: call 0 never executed 103: -: 66: } 104: #####: 67: mpi_errno = NMPI_Info_get( info_ptr->handle, key, vallen+1, 113: -: 71: } 114: -: 72: 115: #####: 74: fn_exit: 116: #####: 75: *kv_ptr = kv; 117: #####: 76: *nkeys_ptr = nkeys; 118: #####: 77: return mpi_errno; 121: -: 80:static void free_pmi_keyvals(PMI_keyval_t **kv, int size, int *counts) 122: function free_pmi_keyvals called 0 returned 0% blocks executed 0% 123: #####: 81:{ 124: -: 82: int i,j; 125: -: 83: 126: #####: 84: for (i=0; irank == root) { 190: -: 132: 191: -: 133: /* convert the infos into PMI keyvals */ 192: #####: 134: info_keyval_sizes = (int *) MPIU_Malloc(count * sizeof(int)); 193: call 0 never executed 194: #####: 135: info_keyval_vectors = 195: call 0 never executed 196: -: 136: (PMI_keyval_t**) MPIU_Malloc(count * sizeof(PMI_keyval_t*)); 197: #####: 137: if (!info_keyval_sizes || !info_keyval_vectors) { 202: -: 139: } 203: -: 140: 204: #####: 141: if (!info_ptrs) { 205: branch 0 never executed 206: branch 1 never executed 207: #####: 142: for (i=0; ihandle); 322: call 2 never executed 323: -: 220: 324: #####: 221: mpi_errno = NMPI_Bcast(&total_num_processes, 1, MPI_INT, root, comm_ptr->handle); 329: call 2 never executed 330: -: 223: 331: #####: 224: mpi_errno = NMPI_Bcast(errcodes, total_num_processes, MPI_INT, root, comm_ptr->handle); 337: -: 226: } 338: -: 227: 339: #####: 228: if (should_accept) { 340: branch 0 never executed 341: branch 1 never executed 342: #####: 229: mpi_errno = MPID_Comm_accept(port_name, NULL, root, comm_ptr, intercomm); 352: -: 234: } 353: -: 235: 354: #####: 236: if (comm_ptr->rank == root) { 356: branch 1 never executed 357: -: 237: /* Close the port opened for the spawned processes to connect to */ 358: #####: 238: mpi_errno = MPID_Close_port(port_name); 369: -: 245: } 370: -: 246: 371: #####: 247: fn_exit: 372: #####: 248: if (info_keyval_vectors) { 373: branch 0 never executed 374: branch 1 never executed 375: #####: 249: free_pmi_keyvals(info_keyval_vectors, count, info_keyval_sizes); 376: call 0 never executed 377: #####: 250: MPIU_Free(info_keyval_sizes); 378: call 0 never executed 379: #####: 251: MPIU_Free(info_keyval_vectors); 380: call 0 never executed 381: -: 252: } 382: #####: 253: if (pmi_errcodes) { 383: branch 0 never executed 384: branch 1 never executed 385: #####: 254: MPIU_Free(pmi_errcodes); 386: call 0 never executed 387: -: 255: } 388: #####: 256: MPIR_Nest_decr(); 389: #####: 256: MPIR_Nest_decr(); 390: #####: 258: return mpi_errno; 417: -: 285:int MPIDI_CH3_GetParentPort(char ** parent_port) 418: function MPIDI_CH3_GetParentPort called 0 returned 0% blocks executed 0% 419: #####: 286:{ 420: #####: 287: int mpi_errno = MPI_SUCCESS; 422: -: 289: char val[MPIDI_MAX_KVS_VALUE_LEN]; 423: -: 290: 424: #####: 291: if (parent_port_name == NULL) 426: branch 1 never executed 427: -: 292: { 428: #####: 293: char *kvsname = NULL; 429: -: 294: /* We can always use PMI_KVS_Get on our own process group */ 430: #####: 295: MPIDI_PG_GetConnKVSname( &kvsname ); 440: -: 304:#else 441: -: 305: MPIU_THREAD_CS_ENTER(PMI,); 442: #####: 306: pmi_errno = PMI_KVS_Get( kvsname, PARENT_PORT_KVSKEY, val, sizeof(val)); 443: call 0 never executed 444: -: 307: MPIU_THREAD_CS_EXIT(PMI,); 445: #####: 308: if (pmi_errno) { 448: branch 1 never executed 449: call 0 never executed 450: #####: 310: goto fn_exit; 451: -: 311: } 452: -: 312:#endif 453: #####: 313: parent_port_name = MPIU_Strdup(val); 454: call 0 never executed 455: #####: 314: if (parent_port_name == NULL) { 461: -: 317: } 462: -: 318: 463: #####: 319: *parent_port = parent_port_name; 464: -: 320: 465: #####: 321: fn_exit: 466: #####: 322: return mpi_errno; 470: -: 326:void MPIDI_CH3_FreeParentPort(void) 471: function MPIDI_CH3_FreeParentPort called 0 returned 0% blocks executed 0% 472: #####: 327:{ 473: #####: 328: if (parent_port_name) { 474: branch 0 never executed 475: branch 1 never executed 476: #####: 329: MPIU_Free( parent_port_name ); 477: call 0 never executed 478: #####: 330: parent_port_name = 0; 95 line(s) not covered by tests in src/mpid/ch3/src/ch3u_comm_spawn_multiple.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_handle_connection.c.gcov 41: -: 36:int MPIDI_CH3U_Handle_connection(MPIDI_VC_t * vc, MPIDI_VC_Event_t event) 42: function MPIDI_CH3U_Handle_connection called 0 returned 0% blocks executed 0% 43: #####: 37:{ 44: -: 38: int inuse; 45: #####: 39: int mpi_errno = MPI_SUCCESS; 48: -: 42: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_HANDLE_CONNECTION); 49: -: 43: 50: #####: 44: switch (event) 54: -: 46: case MPIDI_VC_EVENT_TERMINATED: 55: -: 47: { 56: #####: 48: switch (vc->state) 60: -: 50: case MPIDI_VC_STATE_CLOSE_ACKED: 61: -: 51: { 62: #####: 52: MPIDI_CHANGE_VC_STATE(vc, INACTIVE); 71: -: 61: */ 72: -: 62: /* XXX DJG FIXME-MT should we be checking this ref_count? */ 73: #####: 63: if (vc->pg != NULL && (MPIU_Object_get_ref(vc) == 0)) 84: -: 70: /* FIXME: This should be done when the reference 85: -: 71: count of the vc is first decremented */ 86: #####: 72: MPIDI_PG_release_ref(vc->pg, &inuse); 89: call 2 never executed 90: call 3 never executed 91: #####: 73: if (inuse == 0) { 92: branch 0 never executed 93: branch 1 never executed 94: #####: 74: MPIDI_PG_Destroy(vc->pg); 98: -: 77: 99: -: 78: /* MT: this is not thread safe */ 100: #####: 79: MPIDI_Outstanding_close_ops -= 1; 102: -: 81: "outstanding close operations = %d", MPIDI_Outstanding_close_ops); 103: -: 82: 104: #####: 83: if (MPIDI_Outstanding_close_ops == 0) 106: branch 1 never executed 107: -: 84: { 108: #####: 85: MPIDI_CH3_Progress_signal_completion(); 109: #####: 86: mpi_errno = MPIDI_CH3_Channel_close(); 140: -: 113: } 141: -: 114: 142: #####: 115:fn_exit: 143: #####: 115:fn_exit: 144: #####: 117: return mpi_errno; 164: -: 137:int MPIDI_CH3U_VC_SendClose( MPIDI_VC_t *vc, int rank ) 165: function MPIDI_CH3U_VC_SendClose called 0 returned 0% blocks executed 0% 166: #####: 138:{ 167: -: 139: MPIDI_CH3_Pkt_t upkt; 168: #####: 140: MPIDI_CH3_Pkt_close_t * close_pkt = &upkt.close; 169: -: 141: MPID_Request * sreq; 170: #####: 142: int mpi_errno = MPI_SUCCESS; 187: -: 159: ((MPIDI_CH3I_VC *)(vc->channel_private))->shm_read_connected) ); 188: -: 160:#else 189: #####: 161: MPIU_Assert( vc->state == MPIDI_VC_STATE_ACTIVE || 195: -: 163:#endif 196: -: 164: 197: #####: 165: MPIDI_Pkt_init(close_pkt, MPIDI_CH3_PKT_CLOSE); 198: #####: 166: close_pkt->ack = (vc->state == MPIDI_VC_STATE_ACTIVE) ? FALSE : TRUE; 199: -: 167: 200: -: 168: /* MT: this is not thread safe */ 201: #####: 169: MPIDI_Outstanding_close_ops += 1; 211: -: 179: * be changed before the close packet is sent. 212: -: 180: */ 213: #####: 181: if (vc->state == MPIDI_VC_STATE_ACTIVE) { 214: branch 0 never executed 215: branch 1 never executed 216: #####: 182: MPIDI_CHANGE_VC_STATE(vc, LOCAL_CLOSE); 217: -: 183: } 218: -: 184: else { 219: #####: 185: MPIU_Assert( vc->state == MPIDI_VC_STATE_REMOTE_CLOSE ); 222: call 2 never executed 223: call 3 never executed 224: #####: 186: MPIDI_CHANGE_VC_STATE(vc, CLOSE_ACKED); 225: -: 187: } 226: -: 188: 227: #####: 189: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, close_pkt, 228: call 0 never executed 229: -: 190: sizeof(*close_pkt), &sreq)); 230: #####: 191: if (mpi_errno != MPI_SUCCESS) { 236: -: 194: } 237: -: 195: 238: #####: 196: if (sreq != NULL) { 241: -: 197: /* There is still another reference being held by the channel. It 242: -: 198: will not be released until the pkt is actually sent. */ 243: #####: 199: MPID_Request_release(sreq); 252: -: 200: } 253: -: 201: 254: #####: 203: return mpi_errno; 260: -: 209: MPIDI_msg_sz_t *buflen, MPID_Request **rreqp ) 261: function MPIDI_CH3_PktHandler_Close called 0 returned 0% blocks executed 0% 262: #####: 210:{ 263: #####: 211: MPIDI_CH3_Pkt_close_t * close_pkt = &pkt->close; 264: #####: 212: int mpi_errno = MPI_SUCCESS; 265: -: 213: 266: #####: 214: if (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE) 269: -: 215: { 270: -: 216: MPIDI_CH3_Pkt_t upkt; 271: #####: 217: MPIDI_CH3_Pkt_close_t * resp_pkt = &upkt.close; 272: -: 218: MPID_Request * resp_sreq; 273: -: 219: 274: #####: 220: MPIDI_Pkt_init(resp_pkt, MPIDI_CH3_PKT_CLOSE); 275: #####: 221: resp_pkt->ack = TRUE; 277: -: 223: MPIU_DBG_MSG_D(CH3_DISCONNECT,TYPICAL,"sending close(TRUE) to %d", 278: -: 224: vc->pg_rank); 279: #####: 225: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, resp_pkt, 280: call 0 never executed 281: -: 226: sizeof(*resp_pkt), &resp_sreq)); 282: #####: 227: if (mpi_errno != MPI_SUCCESS) { 288: -: 230: } 289: -: 231: 290: #####: 232: if (resp_sreq != NULL) 294: -: 234: /* There is still another reference being held by the channel. It 295: -: 235: will not be released until the pkt is actually sent. */ 296: #####: 236: MPID_Request_release(resp_sreq); 305: -: 238: } 306: -: 239: 307: #####: 240: if (close_pkt->ack == FALSE) 309: branch 1 never executed 310: -: 241: { 311: #####: 242: if (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE) 316: -: 245: "received close(FALSE) from %d, moving to CLOSE_ACKED.", 317: -: 246: vc->pg_rank); 318: #####: 247: MPIDI_CHANGE_VC_STATE(vc, CLOSE_ACKED); 339: -: 268: { 340: -: 269: /* FIXME: Debugging */ 341: #####: 270: if (vc->state != MPIDI_VC_STATE_ACTIVE) { 342: branch 0 never executed 343: branch 1 never executed 344: #####: 271: printf( "Unexpected state %d in vc %p\n", vc->state, vc ); 345: call 0 never executed 346: #####: 272: fflush(stdout); 350: -: 275: "received close(FALSE) from %d, moving to REMOTE_CLOSE.", 351: -: 276: vc->pg_rank); 352: #####: 277: MPIU_Assert(vc->state == MPIDI_VC_STATE_ACTIVE); 355: call 2 never executed 356: call 3 never executed 357: #####: 278: MPIDI_CHANGE_VC_STATE(vc, REMOTE_CLOSE); 363: -: 284: "received close(TRUE) from %d, moving to CLOSE_ACKED.", 364: -: 285: vc->pg_rank); 365: #####: 286: MPIU_Assert (vc->state == MPIDI_VC_STATE_LOCAL_CLOSE || 369: call 3 never executed 370: -: 287: vc->state == MPIDI_VC_STATE_CLOSE_ACKED); 371: #####: 288: MPIDI_CHANGE_VC_STATE(vc, CLOSE_ACKED); 372: -: 289: /* For example, with sockets, Connection_terminate will close 373: -: 290: the socket */ 374: #####: 291: mpi_errno = MPIU_CALL(MPIDI_CH3,Connection_terminate(vc)); 376: -: 292: } 377: -: 293: 378: #####: 294: *buflen = sizeof(MPIDI_CH3_Pkt_t); 379: #####: 295: *rreqp = NULL; 380: #####: 295: *rreqp = NULL; 381: -: 296: 382: #####: 298: return mpi_errno; 406: -: 322:int MPIDI_CH3U_VC_WaitForClose( void ) 407: function MPIDI_CH3U_VC_WaitForClose called 0 returned 0% blocks executed 0% 408: #####: 323:{ 409: -: 324: MPID_Progress_state progress_state; 410: #####: 325: int mpi_errno = MPI_SUCCESS; 413: -: 328: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_VC_WAITFORCLOSE); 414: -: 329: 415: #####: 330: MPID_Progress_start(&progress_state); 416: #####: 331: while(MPIDI_Outstanding_close_ops > 0) { 420: -: 333: "Waiting for %d close operations", 421: -: 334: MPIDI_Outstanding_close_ops); 422: #####: 335: mpi_errno = MPID_Progress_wait(&progress_state); 435: -: 343: MPID_Progress_end(&progress_state); 436: -: 344: 437: #####: 346: return mpi_errno; 62 line(s) not covered by tests in src/mpid/ch3/src/ch3u_handle_connection.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_handle_recv_pkt.c.gcov 59: -: 54: MPIDI_msg_sz_t *buflen, MPID_Request ** rreqp) 60: function MPIDI_CH3U_Handle_recv_pkt called 0 returned 0% blocks executed 0% 61: #####: 55:{ 62: #####: 56: int mpi_errno = MPI_SUCCESS; 77: -: 71: */ 78: -: 72: 79: #####: 73: if (needsInit) { 80: branch 0 never executed 81: branch 1 never executed 82: #####: 74: MPIDI_CH3_PktHandler_Init( pktArray, MPIDI_CH3_PKT_END_CH3 ); 83: call 0 never executed 84: #####: 75: needsInit = 0; 85: -: 76: } 86: -: 77: /* Packet type is an enum and hence >= 0 */ 87: #####: 78: MPIU_Assert(pkt->type <= MPIDI_CH3_PKT_END_CH3); 90: call 2 never executed 91: call 3 never executed 92: #####: 79: mpi_errno = pktArray[pkt->type](vc, pkt, buflen, rreqp); 94: call 0 never executed 95: -: 80: 96: #####: 82: return mpi_errno; 117: -: 103:int MPIDI_CH3U_Receive_data_found(MPID_Request *rreq, char *buf, MPIDI_msg_sz_t *buflen, int *complete) 118: function MPIDI_CH3U_Receive_data_found called 0 returned 0% blocks executed 0% 119: #####: 104:{ 121: -: 106: MPI_Aint dt_true_lb; 122: -: 107: MPIDI_msg_sz_t userbuf_sz; 123: #####: 108: MPID_Datatype * dt_ptr = NULL; 124: -: 109: MPIDI_msg_sz_t data_sz; 125: #####: 110: int mpi_errno = MPI_SUCCESS; 130: -: 115: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found"); 131: -: 116: 132: #####: 117: MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 140: -: 118: dt_contig, userbuf_sz, dt_ptr, dt_true_lb); 141: -: 119: 142: #####: 120: if (rreq->dev.recv_data_sz <= userbuf_sz) { 143: branch 0 never executed 144: branch 1 never executed 145: #####: 121: data_sz = rreq->dev.recv_data_sz; 156: -: 131: rreq->status.MPI_SOURCE, rreq->status.MPI_TAG, 157: -: 132: rreq->dev.recv_data_sz, userbuf_sz ); 158: #####: 133: rreq->status.count = userbuf_sz; 159: #####: 134: data_sz = userbuf_sz; 160: -: 135: } 161: -: 136: 162: #####: 137: if (dt_contig && data_sz == rreq->dev.recv_data_sz) 172: -: 143: /* if all of the data has already been received, unpack it 173: -: 144: now, otherwise build an iov and let the channel unpack */ 174: #####: 145: if (*buflen >= data_sz) 178: -: 147: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Copying contiguous data to user buffer"); 179: -: 148: /* copy data out of the receive buffer */ 180: #####: 149: MPIU_Memcpy((char*)(rreq->dev.user_buf) + dt_true_lb, buf, data_sz); 204: call 23 never executed 205: call 24 never executed 206: #####: 150: *buflen = data_sz; 207: #####: 151: *complete = TRUE; 211: -: 155: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for contiguous read"); 212: -: 156: 213: #####: 157: rreq->dev.iov[0].MPID_IOV_BUF = 214: -: 158: (MPID_IOV_BUF_CAST)((char*)(rreq->dev.user_buf) + dt_true_lb); 215: #####: 159: rreq->dev.iov[0].MPID_IOV_LEN = data_sz; 216: #####: 160: rreq->dev.iov_count = 1; 217: #####: 161: *buflen = 0; 218: #####: 162: *complete = FALSE; 222: -: 166: function, which depends on whether this is an RMA 223: -: 167: request or a pt-to-pt request. */ 224: #####: 168: rreq->dev.OnDataAvail = 0; 228: -: 172: the entire message */ 229: -: 173: 230: #####: 174: rreq->dev.segment_ptr = MPID_Segment_alloc( ); 231: call 0 never executed 232: #####: 175: MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 235: call 2 never executed 236: -: 176: 237: #####: 177: MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, 238: call 0 never executed 239: -: 178: rreq->dev.datatype, rreq->dev.segment_ptr, 0); 240: #####: 179: rreq->dev.segment_first = 0; 241: #####: 180: rreq->dev.segment_size = data_sz; 244: -: 183: message is not truncated, unpack it now, otherwise build an 245: -: 184: iov and let the channel unpack */ 246: #####: 185: if (data_sz == rreq->dev.recv_data_sz && *buflen >= data_sz) 252: -: 187: MPIDI_msg_sz_t last; 253: -: 188: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"Copying noncontiguous data to user buffer"); 254: #####: 189: last = data_sz; 255: #####: 190: MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, 273: call 0 never executed 274: -: 191: &last, buf); 275: #####: 206: *buflen = data_sz; 276: #####: 207: rreq->dev.OnDataAvail = 0; 277: #####: 208: *complete = TRUE; 281: -: 212: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for non-contiguous read"); 282: -: 213: 283: #####: 214: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 284: call 0 never executed 285: #####: 215: if (mpi_errno != MPI_SUCCESS) { 290: -: 217: "**ch3|loadrecviov"); 291: -: 218: } 292: #####: 219: *buflen = 0; 293: #####: 220: *complete = FALSE; 295: -: 222: } 296: -: 223: 297: #####: 224: fn_exit: 298: #####: 224: fn_exit: 299: #####: 226: return mpi_errno; 308: -: 235:int MPIDI_CH3U_Receive_data_unexpected(MPID_Request * rreq, char *buf, MPIDI_msg_sz_t *buflen, int *complete) 309: function MPIDI_CH3U_Receive_data_unexpected called 0 returned 0% blocks executed 0% 310: #####: 236:{ 311: #####: 237: int mpi_errno = MPI_SUCCESS; 320: -: 246: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated"); 321: -: 247: 322: #####: 248: rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz); 323: call 0 never executed 324: #####: 249: if (!rreq->dev.tmpbuf) { 328: call 0 never executed 329: -: 251: } 330: #####: 252: rreq->dev.tmpbuf_sz = rreq->dev.recv_data_sz; 332: -: 254: /* if all of the data has already been received, copy it 333: -: 255: now, otherwise build an iov and let the channel copy it */ 334: #####: 256: if (rreq->dev.recv_data_sz <= *buflen) 336: branch 1 never executed 337: -: 257: { 338: #####: 258: MPIU_Memcpy(rreq->dev.tmpbuf, buf, rreq->dev.recv_data_sz); 362: call 23 never executed 363: call 24 never executed 364: #####: 259: *buflen = rreq->dev.recv_data_sz; 365: #####: 260: rreq->dev.recv_pending_count = 1; 366: #####: 261: *complete = TRUE; 368: -: 263: else 369: -: 264: { 370: #####: 265: rreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)((char *)rreq->dev.tmpbuf); 371: #####: 266: rreq->dev.iov[0].MPID_IOV_LEN = rreq->dev.recv_data_sz; 372: #####: 267: rreq->dev.iov_count = 1; 373: #####: 268: rreq->dev.recv_pending_count = 2; 374: #####: 269: *buflen = 0; 375: #####: 270: *complete = FALSE; 376: -: 271: } 377: -: 272: 378: #####: 273: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackUEBufComplete; 380: #####: 273: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackUEBufComplete; 381: -: 274: 382: #####: 277: return mpi_errno; 394: -: 289:int MPIDI_CH3U_Post_data_receive_found(MPID_Request * rreq) 395: function MPIDI_CH3U_Post_data_receive_found called 0 returned 0% blocks executed 0% 396: #####: 290:{ 397: #####: 291: int mpi_errno = MPI_SUCCESS; 399: -: 293: MPI_Aint dt_true_lb; 400: -: 294: MPIDI_msg_sz_t userbuf_sz; 401: #####: 295: MPID_Datatype * dt_ptr = NULL; 407: -: 301: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"posted request found"); 408: -: 302: 409: #####: 303: MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 417: -: 304: dt_contig, userbuf_sz, dt_ptr, dt_true_lb); 418: -: 305: 419: #####: 306: if (rreq->dev.recv_data_sz <= userbuf_sz) { 420: branch 0 never executed 421: branch 1 never executed 422: #####: 307: data_sz = rreq->dev.recv_data_sz; 433: -: 317: rreq->status.MPI_SOURCE, rreq->status.MPI_TAG, 434: -: 318: rreq->dev.recv_data_sz, userbuf_sz ); 435: #####: 319: rreq->status.count = userbuf_sz; 436: #####: 320: data_sz = userbuf_sz; 437: -: 321: } 438: -: 322: 439: #####: 323: if (dt_contig && data_sz == rreq->dev.recv_data_sz) 447: -: 327: (this code describes how to read the data into the destination) */ 448: -: 328: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for contiguous read"); 449: #####: 329: rreq->dev.iov[0].MPID_IOV_BUF = 450: -: 330: (MPID_IOV_BUF_CAST)((char*)(rreq->dev.user_buf) + dt_true_lb); 451: #####: 331: rreq->dev.iov[0].MPID_IOV_LEN = data_sz; 452: #####: 332: rreq->dev.iov_count = 1; 454: -: 334: function, which depends on whether this is an RMA 455: -: 335: request or a pt-to-pt request. */ 456: #####: 336: rreq->dev.OnDataAvail = 0; 460: -: 340: the entire message */ 461: -: 341: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"IOV loaded for non-contiguous read"); 462: #####: 342: rreq->dev.segment_ptr = MPID_Segment_alloc( ); 463: call 0 never executed 464: #####: 343: MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 466: branch 1 never executed 467: call 2 never executed 468: #####: 344: MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, 469: call 0 never executed 470: -: 345: rreq->dev.datatype, rreq->dev.segment_ptr, 0); 471: #####: 346: rreq->dev.segment_first = 0; 472: #####: 347: rreq->dev.segment_size = data_sz; 473: #####: 348: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 474: call 0 never executed 475: #####: 349: if (mpi_errno != MPI_SUCCESS) { 482: -: 353: } 483: -: 354: 484: #####: 355: fn_exit: 485: #####: 355: fn_exit: 486: #####: 357: return mpi_errno; 495: -: 366:int MPIDI_CH3U_Post_data_receive_unexpected(MPID_Request * rreq) 496: function MPIDI_CH3U_Post_data_receive_unexpected called 0 returned 0% blocks executed 0% 497: #####: 367:{ 498: #####: 368: int mpi_errno = MPI_SUCCESS; 507: -: 377: MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"unexpected request allocated"); 508: -: 378: 509: #####: 379: rreq->dev.tmpbuf = MPIU_Malloc(rreq->dev.recv_data_sz); 510: call 0 never executed 511: #####: 380: if (!rreq->dev.tmpbuf) { 515: call 0 never executed 516: -: 382: } 517: #####: 383: rreq->dev.tmpbuf_sz = rreq->dev.recv_data_sz; 518: -: 384: 519: #####: 385: rreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rreq->dev.tmpbuf; 520: #####: 386: rreq->dev.iov[0].MPID_IOV_LEN = rreq->dev.recv_data_sz; 521: #####: 387: rreq->dev.iov_count = 1; 522: #####: 388: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackUEBufComplete; 523: #####: 389: rreq->dev.recv_pending_count = 2; 525: #####: 389: rreq->dev.recv_pending_count = 2; 526: -: 390: 527: #####: 393: return mpi_errno; 542: -: 408:int MPIDI_CH3I_Try_acquire_win_lock(MPID_Win *win_ptr, int requested_lock) 543: function MPIDI_CH3I_Try_acquire_win_lock called 0 returned 0% blocks executed 0% 544: #####: 409:{ 548: -: 413: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_TRY_ACQUIRE_WIN_LOCK); 549: -: 414: 550: #####: 415: existing_lock = win_ptr->current_lock_type; 560: -: 425: */ 561: -: 426: 562: #####: 427: if ( ( (requested_lock == MPI_LOCK_SHARED) && 574: -: 433: 575: -: 434: /* grant lock. set new lock type on window */ 576: #####: 435: win_ptr->current_lock_type = requested_lock; 577: -: 436: 578: -: 437: /* if shared lock, incr. ref. count */ 579: #####: 438: if (requested_lock == MPI_LOCK_SHARED) 580: branch 0 never executed 581: branch 1 never executed 582: #####: 439: win_ptr->shared_lock_ref_cnt++; 583: #####: 439: win_ptr->shared_lock_ref_cnt++; 584: -: 440: 585: #####: 442: return 1; 588: -: 444: else { 589: -: 445: /* do not grant lock */ 590: #####: 447: return 0; 622: -: 479: MPIDI_msg_sz_t *buflen, MPID_Request **rreqp) 623: function MPIDI_CH3_PktHandler_FlowCntlUpdate called 0 returned 0% blocks executed 0% 624: #####: 480:{ 625: #####: 481: *buflen = sizeof(MPIDI_CH3_Pkt_t); 626: #####: 482: return MPI_SUCCESS; 637: -: 493: MPID_Request **rreqp ATTRIBUTE((unused)) ) 638: function MPIDI_CH3_PktHandler_EndCH3 called 0 returned 0% blocks executed 0% 639: #####: 494:{ 644: -: 498: 645: -: 500: 646: #####: 501: return MPI_SUCCESS; 664: -: 519: int arraySize ) 665: function MPIDI_CH3_PktHandler_Init called 0 returned 0% blocks executed 0% 666: #####: 520:{ 667: #####: 521: int mpi_errno = MPI_SUCCESS; 671: -: 525: 672: -: 526: /* Check that the array is large enough */ 673: #####: 527: if (arraySize < MPIDI_CH3_PKT_END_CH3) { 678: -: 529: "**ch3|pktarraytoosmall"); 679: -: 530: } 680: #####: 531: pktArray[MPIDI_CH3_PKT_EAGER_SEND] = 681: -: 532: MPIDI_CH3_PktHandler_EagerSend; 682: -: 533:#ifdef USE_EAGER_SHORT 683: #####: 534: pktArray[MPIDI_CH3_PKT_EAGERSHORT_SEND] = 684: -: 535: MPIDI_CH3_PktHandler_EagerShortSend; 685: -: 536:#endif 686: #####: 537: pktArray[MPIDI_CH3_PKT_READY_SEND] = 687: -: 538: MPIDI_CH3_PktHandler_ReadySend; 688: #####: 539: pktArray[MPIDI_CH3_PKT_EAGER_SYNC_SEND] = 689: -: 540: MPIDI_CH3_PktHandler_EagerSyncSend; 690: #####: 541: pktArray[MPIDI_CH3_PKT_EAGER_SYNC_ACK] = 691: -: 542: MPIDI_CH3_PktHandler_EagerSyncAck; 692: #####: 543: pktArray[MPIDI_CH3_PKT_RNDV_REQ_TO_SEND] = 693: -: 544: MPIDI_CH3_PktHandler_RndvReqToSend; 694: #####: 545: pktArray[MPIDI_CH3_PKT_RNDV_CLR_TO_SEND] = 695: -: 546: MPIDI_CH3_PktHandler_RndvClrToSend; 696: #####: 547: pktArray[MPIDI_CH3_PKT_RNDV_SEND] = 697: -: 548: MPIDI_CH3_PktHandler_RndvSend; 698: #####: 549: pktArray[MPIDI_CH3_PKT_CANCEL_SEND_REQ] = 699: -: 550: MPIDI_CH3_PktHandler_CancelSendReq; 700: #####: 551: pktArray[MPIDI_CH3_PKT_CANCEL_SEND_RESP] = 702: -: 553: 703: -: 554: /* Connection Management */ 704: #####: 555: pktArray[MPIDI_CH3_PKT_CLOSE] = 706: -: 557: 707: -: 558: /* Provision for flow control */ 708: #####: 559: pktArray[MPIDI_CH3_PKT_FLOW_CNTL_UPDATE] = 0; 713: -: 564: That would allow different RMA implementations. 714: -: 565: We could even do lazy initialization (make this part of win_create) */ 715: #####: 566: pktArray[MPIDI_CH3_PKT_PUT] = 716: -: 567: MPIDI_CH3_PktHandler_Put; 717: #####: 568: pktArray[MPIDI_CH3_PKT_ACCUMULATE] = 718: -: 569: MPIDI_CH3_PktHandler_Accumulate; 719: #####: 570: pktArray[MPIDI_CH3_PKT_GET] = 720: -: 571: MPIDI_CH3_PktHandler_Get; 721: #####: 572: pktArray[MPIDI_CH3_PKT_GET_RESP] = 722: -: 573: MPIDI_CH3_PktHandler_GetResp; 723: #####: 574: pktArray[MPIDI_CH3_PKT_LOCK] = 724: -: 575: MPIDI_CH3_PktHandler_Lock; 725: #####: 576: pktArray[MPIDI_CH3_PKT_LOCK_GRANTED] = 726: -: 577: MPIDI_CH3_PktHandler_LockGranted; 727: #####: 578: pktArray[MPIDI_CH3_PKT_PT_RMA_DONE] = 728: -: 579: MPIDI_CH3_PktHandler_PtRMADone; 729: #####: 580: pktArray[MPIDI_CH3_PKT_LOCK_PUT_UNLOCK] = 730: -: 581: MPIDI_CH3_PktHandler_LockPutUnlock; 731: #####: 582: pktArray[MPIDI_CH3_PKT_LOCK_ACCUM_UNLOCK] = 732: -: 583: MPIDI_CH3_PktHandler_LockAccumUnlock; 733: #####: 584: pktArray[MPIDI_CH3_PKT_LOCK_GET_UNLOCK] = 737: -: 586: /* End of default RMA operations */ 738: -: 587: 739: #####: 590: return mpi_errno; 134 line(s) not covered by tests in src/mpid/ch3/src/ch3u_handle_recv_pkt.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_handle_recv_req.c.gcov 25: -: 20: int * complete) 26: function MPIDI_CH3U_Handle_recv_req called 0 returned 0% blocks executed 0% 27: #####: 21:{ 28: -: 22: static int in_routine = FALSE; 29: #####: 23: int mpi_errno = MPI_SUCCESS; 33: -: 27: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_HANDLE_RECV_REQ); 34: -: 28: 35: #####: 29: MPIU_Assert(in_routine == FALSE); 38: call 2 never executed 39: call 3 never executed 40: #####: 30: in_routine = TRUE; 41: -: 31: 42: #####: 32: reqFn = rreq->dev.OnDataAvail; 43: #####: 33: if (!reqFn) { 44: branch 0 never executed 45: branch 1 never executed 46: #####: 34: MPIU_Assert(MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_RECV); 49: call 2 never executed 50: call 3 never executed 51: #####: 35: MPIDI_CH3U_Request_complete(rreq); 59: branch 7 never executed 60: call 8 never executed 61: #####: 36: *complete = TRUE; 62: -: 37: } 63: -: 38: else { 64: #####: 39: mpi_errno = reqFn( vc, rreq, complete ); 66: -: 40: } 67: -: 41: 68: #####: 42: in_routine = FALSE; 69: #####: 42: in_routine = FALSE; 70: #####: 44: return mpi_errno; 94: -: 68: int *complete ) 95: function MPIDI_CH3_ReqHandler_RecvComplete called 0 returned 0% blocks executed 0% 96: #####: 69:{ 97: -: 70: /* mark data transfer as complete and decrement CC */ 98: #####: 71: MPIDI_CH3U_Request_complete(rreq); 106: branch 7 never executed 107: call 8 never executed 108: #####: 72: *complete = TRUE; 109: #####: 73: return MPI_SUCCESS; 118: -: 82: int *complete ) 119: function MPIDI_CH3_ReqHandler_PutAccumRespComplete called 0 returned 0% blocks executed 0% 120: #####: 83:{ 121: #####: 84: int mpi_errno = MPI_SUCCESS; 125: -: 88: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_PUTACCUMRESPCOMPLETE); 126: -: 89: 127: #####: 90: if (MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_ACCUM_RESP) { 129: branch 1 never executed 130: -: 91: /* accumulate data from tmp_buf into user_buf */ 131: #####: 92: mpi_errno = do_accumulate_op(rreq); 132: call 0 never executed 133: #####: 93: if (mpi_errno) { 139: -: 96: } 140: -: 97: 141: #####: 98: MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr); 146: -: 99: 147: -: 100: /* if passive target RMA, increment counter */ 148: #####: 101: if (win_ptr->current_lock_type != MPID_LOCK_NONE) 149: branch 0 never executed 150: branch 1 never executed 151: #####: 102: win_ptr->my_pt_rma_puts_accs++; 152: -: 103: 153: #####: 104: if (rreq->dev.source_win_handle != MPI_WIN_NULL) { 162: -: 111: ack to the source. */ 163: -: 112: 164: #####: 113: if (win_ptr->current_lock_type == MPID_LOCK_NONE) { 166: branch 1 never executed 167: -: 114: /* FIXME: MT: this has to be done atomically */ 168: #####: 115: win_ptr->my_counter -= 1; 169: -: 116: } 170: -: 117: else { 171: #####: 118: if ((win_ptr->current_lock_type == MPI_LOCK_SHARED) || 175: branch 3 never executed 176: -: 119: (rreq->dev.single_op_opt == 1)) { 177: #####: 120: mpi_errno = MPIDI_CH3I_Send_pt_rma_done_pkt(vc, 178: call 0 never executed 179: -: 121: rreq->dev.source_win_handle); 180: #####: 122: if (mpi_errno) { 185: -: 124: } 186: -: 125: } 187: #####: 126: mpi_errno = MPIDI_CH3I_Release_lock(win_ptr); 191: -: 129: 192: -: 130: /* mark data transfer as complete and decrement CC */ 193: #####: 131: MPIDI_CH3U_Request_complete(rreq); 201: branch 7 never executed 202: call 8 never executed 203: #####: 132: *complete = TRUE; 204: call 8 never executed 205: #####: 132: *complete = TRUE; 206: #####: 135: return MPI_SUCCESS; 215: -: 144: int *complete ) 216: function MPIDI_CH3_ReqHandler_PutRespDerivedDTComplete called 0 returned 0% blocks executed 0% 217: #####: 145:{ 218: #####: 146: int mpi_errno = MPI_SUCCESS; 219: #####: 147: MPID_Datatype *new_dtp = NULL; 223: -: 151: 224: -: 152: /* create derived datatype */ 225: #####: 153: create_derived_datatype(rreq, &new_dtp); 227: -: 154: 228: -: 155: /* update request to get the data */ 229: #####: 156: MPIDI_Request_set_type(rreq, MPIDI_REQUEST_TYPE_PUT_RESP); 230: #####: 157: rreq->dev.datatype = new_dtp->handle; 231: #####: 158: rreq->dev.recv_data_sz = new_dtp->size * rreq->dev.user_count; 232: -: 159: 233: #####: 160: rreq->dev.datatype_ptr = new_dtp; 234: -: 161: /* this will cause the datatype to be freed when the 235: -: 162: request is freed. free dtype_info here. */ 236: #####: 163: MPIU_Free(rreq->dev.dtype_info); 237: call 0 never executed 238: -: 164: 239: #####: 165: rreq->dev.segment_ptr = MPID_Segment_alloc( ); 240: call 0 never executed 241: #####: 166: MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 244: call 2 never executed 245: -: 167: 246: #####: 168: MPID_Segment_init(rreq->dev.user_buf, 249: -: 170: rreq->dev.datatype, 250: -: 171: rreq->dev.segment_ptr, 0); 251: #####: 172: rreq->dev.segment_first = 0; 252: #####: 173: rreq->dev.segment_size = rreq->dev.recv_data_sz; 253: -: 174: 254: #####: 175: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 255: call 0 never executed 256: #####: 176: if (mpi_errno != MPI_SUCCESS) { 261: -: 178: "**ch3|loadrecviov"); 262: -: 179: } 263: #####: 180: if (!rreq->dev.OnDataAvail) 264: branch 0 never executed 265: branch 1 never executed 266: #####: 181: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutAccumRespComplete; 267: -: 182: 268: #####: 183: *complete = FALSE; 269: -: 182: 270: #####: 183: *complete = FALSE; 271: #####: 186: return mpi_errno; 280: -: 195: int *complete ) 281: function MPIDI_CH3_ReqHandler_AccumRespDerivedDTComplete called 0 returned 0% blocks executed 0% 282: #####: 196:{ 283: #####: 197: int mpi_errno = MPI_SUCCESS; 284: #####: 198: MPID_Datatype *new_dtp = NULL; 293: -: 207: 294: -: 208: /* create derived datatype */ 295: #####: 209: create_derived_datatype(rreq, &new_dtp); 297: -: 210: 298: -: 211: /* update new request to get the data */ 299: #####: 212: MPIDI_Request_set_type(rreq, MPIDI_REQUEST_TYPE_ACCUM_RESP); 301: -: 214: /* first need to allocate tmp_buf to recv the data into */ 302: -: 215: 303: #####: 216: MPIR_Nest_incr(); 304: #####: 217: mpi_errno = NMPI_Type_get_true_extent(new_dtp->handle, 305: call 0 never executed 306: -: 218: &true_lb, &true_extent); 307: #####: 219: MPIR_Nest_decr(); 308: #####: 220: if (mpi_errno) { 313: -: 222: } 314: -: 223: 315: #####: 224: MPID_Datatype_get_extent_macro(new_dtp->handle, extent); 319: call 3 never executed 320: -: 225: 321: #####: 226: tmp_buf = MPIU_Malloc(rreq->dev.user_count * 322: call 0 never executed 323: -: 227: (MPIR_MAX(extent,true_extent))); 324: #####: 228: if (!tmp_buf) { 330: -: 231: 331: -: 232: /* adjust for potential negative lower bound in datatype */ 332: #####: 233: tmp_buf = (void *)((char*)tmp_buf - true_lb); 333: -: 234: 334: #####: 235: rreq->dev.user_buf = tmp_buf; 335: #####: 236: rreq->dev.datatype = new_dtp->handle; 336: #####: 237: rreq->dev.recv_data_sz = new_dtp->size * 337: -: 238: rreq->dev.user_count; 338: #####: 239: rreq->dev.datatype_ptr = new_dtp; 339: -: 240: /* this will cause the datatype to be freed when the 340: -: 241: request is freed. free dtype_info here. */ 341: #####: 242: MPIU_Free(rreq->dev.dtype_info); 342: call 0 never executed 343: -: 243: 344: #####: 244: rreq->dev.segment_ptr = MPID_Segment_alloc( ); 345: call 0 never executed 346: #####: 245: MPIU_ERR_CHKANDJUMP1((rreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 349: call 2 never executed 350: -: 246: 351: #####: 247: MPID_Segment_init(rreq->dev.user_buf, 354: -: 249: rreq->dev.datatype, 355: -: 250: rreq->dev.segment_ptr, 0); 356: #####: 251: rreq->dev.segment_first = 0; 357: #####: 252: rreq->dev.segment_size = rreq->dev.recv_data_sz; 358: -: 253: 359: #####: 254: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 360: call 0 never executed 361: #####: 255: if (mpi_errno != MPI_SUCCESS) { 366: -: 257: "**ch3|loadrecviov"); 367: -: 258: } 368: #####: 259: if (!rreq->dev.OnDataAvail) 369: branch 0 never executed 370: branch 1 never executed 371: #####: 260: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_PutAccumRespComplete; 372: -: 261: 373: #####: 262: *complete = FALSE; 374: -: 261: 375: #####: 262: *complete = FALSE; 376: #####: 265: return mpi_errno; 385: -: 274: int *complete ) 386: function MPIDI_CH3_ReqHandler_GetRespDerivedDTComplete called 0 returned 0% blocks executed 0% 387: #####: 275:{ 388: #####: 276: int mpi_errno = MPI_SUCCESS; 389: #####: 277: MPID_Datatype *new_dtp = NULL; 390: -: 278: MPIDI_CH3_Pkt_t upkt; 391: #####: 279: MPIDI_CH3_Pkt_get_resp_t * get_resp_pkt = &upkt.get_resp; 396: -: 284: 397: -: 285: /* create derived datatype */ 398: #####: 286: create_derived_datatype(rreq, &new_dtp); 399: call 0 never executed 400: #####: 287: MPIU_Free(rreq->dev.dtype_info); 402: -: 288: 403: -: 289: /* create request for sending data */ 404: #####: 290: sreq = MPID_Request_create(); 405: call 0 never executed 406: #####: 291: MPIU_ERR_CHKANDJUMP(sreq == NULL, mpi_errno,MPI_ERR_OTHER,"**nomem"); 409: call 2 never executed 410: -: 292: 411: #####: 293: sreq->kind = MPID_REQUEST_SEND; 412: #####: 294: MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_GET_RESP); 413: #####: 295: sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetSendRespComplete; 414: #####: 296: sreq->dev.OnFinal = MPIDI_CH3_ReqHandler_GetSendRespComplete; 415: #####: 297: sreq->dev.user_buf = rreq->dev.user_buf; 416: #####: 298: sreq->dev.user_count = rreq->dev.user_count; 417: #####: 299: sreq->dev.datatype = new_dtp->handle; 418: #####: 300: sreq->dev.datatype_ptr = new_dtp; 419: #####: 301: sreq->dev.target_win_handle = rreq->dev.target_win_handle; 420: #####: 302: sreq->dev.source_win_handle = rreq->dev.source_win_handle; 421: -: 303: 422: #####: 304: MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP); 423: #####: 305: get_resp_pkt->request_handle = rreq->dev.request_handle; 424: -: 306: 425: #####: 307: sreq->dev.segment_ptr = MPID_Segment_alloc( ); 426: call 0 never executed 427: #####: 308: MPIU_ERR_CHKANDJUMP1((sreq->dev.segment_ptr == NULL), mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 430: call 2 never executed 431: -: 309: 432: #####: 310: MPID_Segment_init(sreq->dev.user_buf, 435: -: 312: sreq->dev.datatype, 436: -: 313: sreq->dev.segment_ptr, 0); 437: #####: 314: sreq->dev.segment_first = 0; 438: #####: 315: sreq->dev.segment_size = new_dtp->size * sreq->dev.user_count; 440: -: 317: /* Because this is in a packet handler, it is already within a critical section */ 441: -: 318: /* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */ 442: #####: 319: mpi_errno = vc->sendNoncontig_fn(vc, sreq, get_resp_pkt, sizeof(*get_resp_pkt)); 459: -: 331: /* mark receive data transfer as complete and decrement CC in receive 460: -: 332: request */ 461: #####: 333: MPIDI_CH3U_Request_complete(rreq); 469: branch 7 never executed 470: call 8 never executed 471: #####: 334: *complete = TRUE; 473: #####: 334: *complete = TRUE; 474: -: 335: 475: #####: 338: return mpi_errno; 484: -: 347: int *complete ) 485: function MPIDI_CH3_ReqHandler_SinglePutAccumComplete called 0 returned 0% blocks executed 0% 486: #####: 348:{ 487: #####: 349: int mpi_errno = MPI_SUCCESS; 497: -: 359: operation. */ 498: -: 360: 499: #####: 361: MPID_Win_get_ptr(rreq->dev.target_win_handle, win_ptr); 503: call 3 never executed 504: -: 362: 505: #####: 363: lock_queue_entry = rreq->dev.lock_queue_entry; 506: -: 364: 507: #####: 365: if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, 512: -: 367: { 513: -: 368: 514: #####: 369: if (MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_PT_SINGLE_PUT) { 516: branch 1 never executed 517: -: 370: /* copy the data over */ 518: #####: 371: mpi_errno = MPIR_Localcopy(rreq->dev.user_buf, 525: -: 377: } 526: -: 378: else { 527: #####: 379: mpi_errno = do_simple_accumulate(lock_queue_entry->pt_single_op); 529: -: 380: } 530: -: 381: 531: #####: 382: if (mpi_errno) { 537: -: 385: 538: -: 386: /* increment counter */ 539: #####: 387: win_ptr->my_pt_rma_puts_accs++; 540: -: 388: 541: -: 389: /* send done packet */ 542: #####: 390: mpi_errno = MPIDI_CH3I_Send_pt_rma_done_pkt(vc, 543: call 0 never executed 544: -: 391: lock_queue_entry->source_win_handle); 545: #####: 392: if (mpi_errno) { 552: -: 396: /* free lock_queue_entry including data buffer and remove 553: -: 397: it from the queue. */ 554: #####: 398: curr_ptr = (MPIDI_Win_lock_queue *) win_ptr->lock_queue; 555: #####: 399: curr_ptr_ptr = (MPIDI_Win_lock_queue **) &(win_ptr->lock_queue); 556: #####: 400: while (curr_ptr != lock_queue_entry) { 557: branch 0 never executed 558: branch 1 never executed 559: #####: 401: curr_ptr_ptr = &(curr_ptr->next); 560: #####: 402: curr_ptr = curr_ptr->next; 561: -: 403: } 562: #####: 404: *curr_ptr_ptr = curr_ptr->next; 563: -: 405: 564: #####: 406: MPIU_Free(lock_queue_entry->pt_single_op->data); 565: call 0 never executed 566: #####: 407: MPIU_Free(lock_queue_entry->pt_single_op); 567: call 0 never executed 568: #####: 408: MPIU_Free(lock_queue_entry); 570: -: 409: 571: -: 410: /* Release lock and grant next lock if there is one. */ 572: #####: 411: mpi_errno = MPIDI_CH3I_Release_lock(win_ptr); 575: -: 413: else { 576: -: 414: /* could not acquire lock. mark data recd as 1 */ 577: #####: 415: lock_queue_entry->pt_single_op->data_recd = 1; 579: -: 417: 580: -: 418: /* mark data transfer as complete and decrement CC */ 581: #####: 419: MPIDI_CH3U_Request_complete(rreq); 589: branch 7 never executed 590: call 8 never executed 591: #####: 420: *complete = TRUE; 592: call 8 never executed 593: #####: 420: *complete = TRUE; 594: #####: 423: return mpi_errno; 603: -: 432: int *complete ) 604: function MPIDI_CH3_ReqHandler_UnpackUEBufComplete called 0 returned 0% blocks executed 0% 605: #####: 433:{ 609: -: 437: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_UNPACKUEBUFCOMPLETE); 610: -: 438: 611: #####: 439: MPIDI_Request_decr_pending(rreq); 612: #####: 440: MPIDI_Request_check_pending(rreq, &recv_pending); 613: #####: 441: if (!recv_pending) 615: branch 1 never executed 616: -: 442: { 617: #####: 443: if (rreq->dev.recv_data_sz > 0) 619: branch 1 never executed 620: -: 444: { 621: #####: 445: MPIDI_CH3U_Request_unpack_uebuf(rreq); 622: call 0 never executed 623: #####: 446: MPIU_Free(rreq->dev.tmpbuf); 632: -: 454: 633: -: 455: /* mark data transfer as complete and decrement CC */ 634: #####: 456: MPIDI_CH3U_Request_complete(rreq); 642: branch 7 never executed 643: call 8 never executed 644: #####: 457: *complete = TRUE; 645: #####: 457: *complete = TRUE; 646: -: 458: 647: #####: 460: return MPI_SUCCESS; 656: -: 469: int *complete ) 657: function MPIDI_CH3_ReqHandler_UnpackSRBufComplete called 0 returned 0% blocks executed 0% 658: #####: 470:{ 659: #####: 471: int mpi_errno = MPI_SUCCESS; 662: -: 474: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_UNPACKSRBUFCOMPLETE); 663: -: 475: 664: #####: 476: MPIDI_CH3U_Request_unpack_srbuf(rreq); 665: call 0 never executed 666: -: 477: 667: #####: 478: if ((MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_PUT_RESP) || 670: -: 479: (MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_ACCUM_RESP)) 671: -: 480: { 672: #####: 481: mpi_errno = MPIDI_CH3_ReqHandler_PutAccumRespComplete( 676: -: 484: else { 677: -: 485: /* mark data transfer as complete and decrement CC */ 678: #####: 486: MPIDI_CH3U_Request_complete(rreq); 686: branch 7 never executed 687: call 8 never executed 688: #####: 487: *complete = TRUE; 690: -: 488: } 691: -: 489: 692: #####: 491: return mpi_errno; 701: -: 500: int *complete ) 702: function MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV called 0 returned 0% blocks executed 0% 703: #####: 501:{ 704: #####: 502: int mpi_errno = MPI_SUCCESS; 707: -: 505: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_UNPACKSRBUFRELOADIOV); 708: -: 506: 709: #####: 507: MPIDI_CH3U_Request_unpack_srbuf(rreq); 710: call 0 never executed 711: #####: 508: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 712: call 0 never executed 713: #####: 509: if (mpi_errno != MPI_SUCCESS) { 717: call 0 never executed 718: -: 511: } 719: #####: 512: *complete = FALSE; 720: -: 511: } 721: #####: 512: *complete = FALSE; 722: #####: 515: return mpi_errno; 730: -: 523: MPID_Request *rreq, int *complete ) 731: function MPIDI_CH3_ReqHandler_ReloadIOV called 0 returned 0% blocks executed 0% 732: #####: 524:{ 733: #####: 525: int mpi_errno = MPI_SUCCESS; 736: -: 528: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3_REQHANDLER_RELOADIOV); 737: -: 529: 738: #####: 530: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 739: call 0 never executed 740: #####: 531: if (mpi_errno != MPI_SUCCESS) { 744: call 0 never executed 745: -: 533: } 746: #####: 534: *complete = FALSE; 747: -: 533: } 748: #####: 534: *complete = FALSE; 749: #####: 537: return mpi_errno; 759: -: 547:static int create_derived_datatype(MPID_Request *req, MPID_Datatype **dtp) 760: function create_derived_datatype called 0 returned 0% blocks executed 0% 761: #####: 548:{ 763: -: 550: void *dataloop; 764: -: 551: MPID_Datatype *new_dtp; 765: #####: 552: int mpi_errno=MPI_SUCCESS; 769: -: 556: MPIDI_FUNC_ENTER(MPID_STATE_CREATE_DERIVED_DATATYPE); 770: -: 557: 771: #####: 558: dtype_info = req->dev.dtype_info; 772: -: 559: /* FIXME: What is this variable for (it is never referenced)? */ 773: #####: 560: dataloop = req->dev.dataloop; 774: -: 561: 775: -: 562: /* allocate new datatype object and handle */ 776: #####: 563: new_dtp = (MPID_Datatype *) MPIU_Handle_obj_alloc(&MPID_Datatype_mem); 777: call 0 never executed 778: #####: 564: if (!new_dtp) { 783: -: 566: } 784: -: 567: 785: #####: 568: *dtp = new_dtp; 786: -: 569: 787: -: 570: /* Note: handle is filled in by MPIU_Handle_obj_alloc() */ 788: #####: 571: MPIU_Object_set_ref(new_dtp, 1); 789: #####: 572: new_dtp->is_permanent = 0; 790: #####: 573: new_dtp->is_committed = 1; 791: #####: 574: new_dtp->attributes = 0; 792: #####: 575: new_dtp->cache_id = 0; 793: #####: 576: new_dtp->name[0] = 0; 794: #####: 577: new_dtp->is_contig = dtype_info->is_contig; 795: #####: 578: new_dtp->max_contig_blocks = dtype_info->max_contig_blocks; 796: #####: 579: new_dtp->size = dtype_info->size; 797: #####: 580: new_dtp->extent = dtype_info->extent; 798: #####: 581: new_dtp->dataloop_size = dtype_info->dataloop_size; 799: #####: 582: new_dtp->dataloop_depth = dtype_info->dataloop_depth; 800: #####: 583: new_dtp->eltype = dtype_info->eltype; 801: -: 584: /* set dataloop pointer */ 802: #####: 585: new_dtp->dataloop = req->dev.dataloop; 803: -: 586: 804: #####: 587: new_dtp->ub = dtype_info->ub; 805: #####: 588: new_dtp->lb = dtype_info->lb; 806: #####: 589: new_dtp->true_ub = dtype_info->true_ub; 807: #####: 590: new_dtp->true_lb = dtype_info->true_lb; 808: #####: 591: new_dtp->has_sticky_ub = dtype_info->has_sticky_ub; 809: #####: 592: new_dtp->has_sticky_lb = dtype_info->has_sticky_lb; 810: -: 593: /* update pointers in dataloop */ 811: #####: 594: ptrdiff = (MPI_Aint)((char *) (new_dtp->dataloop) - (char *) 813: -: 596: 814: -: 597: /* FIXME: Temp to avoid SEGV when memory tracing */ 815: #####: 598: new_dtp->hetero_dloop = 0; 816: -: 599: 817: #####: 600: MPID_Dataloop_update(new_dtp->dataloop, ptrdiff); 818: call 0 never executed 819: -: 601: 820: #####: 602: new_dtp->contents = NULL; 823: -: 603: 824: -: 606: 825: #####: 607: return mpi_errno; 833: -: 615:static int do_accumulate_op(MPID_Request *rreq) 834: function do_accumulate_op called 0 returned 0% blocks executed 0% 835: #####: 616:{ 836: #####: 617: int mpi_errno = MPI_SUCCESS, predefined; 844: -: 625: MPIU_THREADPRIV_GET; 845: -: 626: 846: #####: 627: if (rreq->dev.op == MPI_REPLACE) 849: -: 628: { 850: -: 629: /* simply copy the data */ 851: #####: 630: mpi_errno = MPIR_Localcopy(rreq->dev.user_buf, rreq->dev.user_count, 855: -: 633: rreq->dev.user_count, 856: -: 634: rreq->dev.datatype); 857: #####: 635: if (mpi_errno) { 864: -: 639: } 865: -: 640: 866: #####: 641: if (HANDLE_GET_KIND(rreq->dev.op) == HANDLE_KIND_BUILTIN) 869: -: 642: { 870: -: 643: /* get the function by indexing into the op table */ 871: #####: 644: uop = MPIR_Op_table[(rreq->dev.op)%16 - 1]; 880: -: 652: } 881: -: 653: 882: #####: 654: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(rreq->dev.datatype, predefined); 893: branch 10 never executed 894: branch 11 never executed 895: #####: 655: if (predefined) 897: branch 1 never executed 898: -: 656: { 899: #####: 657: (*uop)(rreq->dev.user_buf, rreq->dev.real_user_buf, 911: -: 668: MPID_Datatype *dtp; 912: -: 669: 913: #####: 670: segp = MPID_Segment_alloc(); 924: #####: 670: segp = MPID_Segment_alloc(); 925: call 0 never executed 926: #####: 679: MPID_Segment_init(NULL, rreq->dev.user_count, 927: call 0 never executed 928: -: 680: rreq->dev.datatype, segp, 0); 929: #####: 681: first = 0; 930: #####: 682: last = SEGMENT_IGNORE_LAST; 931: -: 683: 932: #####: 684: MPID_Datatype_get_ptr(rreq->dev.datatype, dtp); 936: branch 3 never executed 937: call 4 never executed 938: #####: 685: vec_len = dtp->max_contig_blocks * rreq->dev.user_count + 1; 939: -: 686: /* +1 needed because Rob says so */ 940: #####: 687: dloop_vec = (DLOOP_VECTOR *) 953: -: 688: MPIU_Malloc(vec_len * sizeof(DLOOP_VECTOR)); 954: -: 697: 955: #####: 698: MPID_Segment_pack_vector(segp, first, &last, dloop_vec, &vec_len); 956: call 0 never executed 957: -: 699: 958: #####: 700: type = dtp->eltype; 959: #####: 701: MPID_Datatype_get_size_macro(type, type_size); 963: branch 3 never executed 964: call 4 never executed 965: #####: 702: for (i=0; idev.user_buf + MPIU_PtrToAint(dloop_vec[i].DLOOP_VECTOR_BUF), 974: -: 708: } 975: -: 709: 976: #####: 710: MPID_Segment_free(segp); 977: call 0 never executed 978: #####: 711: MPIU_Free(dloop_vec); 980: -: 712: } 981: -: 713: 982: #####: 714: fn_exit: 983: -: 715: /* free the temporary buffer */ 984: #####: 716: MPIR_Nest_incr(); 985: #####: 717: mpi_errno = NMPI_Type_get_true_extent(rreq->dev.datatype, &true_lb, &true_extent); 986: call 0 never executed 987: #####: 718: MPIR_Nest_decr(); 988: #####: 719: if (mpi_errno) { 993: -: 721: } 994: -: 722: 995: #####: 723: MPIU_Free((char *) rreq->dev.user_buf + true_lb); 998: -: 724: 999: -: 726: 1000: #####: 727: return mpi_errno; 1014: -: 741:int MPIDI_CH3I_Release_lock(MPID_Win *win_ptr) 1015: function MPIDI_CH3I_Release_lock called 0 returned 0% blocks executed 0% 1016: #####: 742:{ 1017: -: 743: MPIDI_Win_lock_queue *lock_queue, **lock_queue_ptr; 1018: #####: 744: int requested_lock, mpi_errno = MPI_SUCCESS, temp_entered_count; 1021: -: 747: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_RELEASE_LOCK); 1022: -: 748: 1023: #####: 749: if (win_ptr->current_lock_type == MPI_LOCK_SHARED) { 1026: -: 750: /* decr ref cnt */ 1027: -: 751: /* FIXME: MT: Must be done atomically */ 1028: #####: 752: win_ptr->shared_lock_ref_cnt--; 1031: -: 755: /* If shared lock ref count is 0 (which is also true if the lock is an 1032: -: 756: exclusive lock), release the lock. */ 1033: #####: 757: if (win_ptr->shared_lock_ref_cnt == 0) { 1048: -: 770: if the entered_count has changed while we are in the loop. 1049: -: 771: */ 1050: #####: 772: if (entered_flag != 0) { 1051: branch 0 never executed 1052: branch 1 never executed 1053: #####: 773: entered_count++; 1054: #####: 774: goto fn_exit; 1055: -: 775: } 1056: -: 776: else { 1057: #####: 777: entered_flag = 1; 1058: #####: 778: temp_entered_count = entered_count; 1060: -: 780: 1061: -: 781: do { 1062: #####: 782: if (temp_entered_count != entered_count) temp_entered_count++; 1065: -: 783: 1066: -: 784: /* FIXME: MT: The setting of the lock type must be done atomically */ 1067: #####: 785: win_ptr->current_lock_type = MPID_LOCK_NONE; 1073: -: 791: 1074: -: 792: /* FIXME: MT: All queue accesses need to be made atomic */ 1075: #####: 793: lock_queue = (MPIDI_Win_lock_queue *) win_ptr->lock_queue; 1076: #####: 794: lock_queue_ptr = (MPIDI_Win_lock_queue **) &(win_ptr->lock_queue); 1077: #####: 795: while (lock_queue) { 1081: -: 797: lock-op-unlock type case but all the data has been received, 1082: -: 798: try to acquire the lock */ 1083: #####: 799: if ((lock_queue->pt_single_op == NULL) || 1088: -: 800: (lock_queue->pt_single_op->data_recd == 1)) { 1089: -: 801: 1090: #####: 802: requested_lock = lock_queue->lock_type; 1091: #####: 803: if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, requested_lock) 1095: -: 804: == 1) { 1096: -: 805: 1097: #####: 806: if (lock_queue->pt_single_op != NULL) { 1101: -: 808: MPIDI_PT_single_op * single_op; 1102: -: 809: 1103: #####: 810: single_op = lock_queue->pt_single_op; 1104: #####: 811: if (single_op->type == MPIDI_RMA_PUT) { 1105: branch 0 never executed 1106: branch 1 never executed 1107: #####: 812: mpi_errno = MPIR_Localcopy(single_op->data, 1113: -: 817: single_op->datatype); 1114: -: 818: } 1115: #####: 819: else if (single_op->type == MPIDI_RMA_ACCUMULATE) { 1116: branch 0 never executed 1117: branch 1 never executed 1118: #####: 820: mpi_errno = do_simple_accumulate(single_op); 1119: call 0 never executed 1120: -: 821: } 1121: #####: 822: else if (single_op->type == MPIDI_RMA_GET) { 1122: branch 0 never executed 1123: branch 1 never executed 1124: #####: 823: mpi_errno = do_simple_get(win_ptr, lock_queue); 1126: -: 824: } 1127: -: 825: 1128: #####: 826: if (mpi_errno != MPI_SUCCESS) goto fn_exit; 1131: -: 827: 1132: -: 828: /* if put or accumulate, send rma done packet and release lock. */ 1133: #####: 829: if (single_op->type != MPIDI_RMA_GET) { 1135: branch 1 never executed 1136: -: 830: /* increment counter */ 1137: #####: 831: win_ptr->my_pt_rma_puts_accs++; 1138: -: 832: 1139: #####: 833: mpi_errno = 1141: -: 834: MPIDI_CH3I_Send_pt_rma_done_pkt(lock_queue->vc, 1142: -: 835: lock_queue->source_win_handle); 1143: #####: 836: if (mpi_errno != MPI_SUCCESS) goto fn_exit; 1146: -: 837: 1147: -: 838: /* release the lock */ 1148: #####: 839: if (win_ptr->current_lock_type == MPI_LOCK_SHARED) { 1151: -: 840: /* decr ref cnt */ 1152: -: 841: /* FIXME: MT: Must be done atomically */ 1153: #####: 842: win_ptr->shared_lock_ref_cnt--; 1157: -: 846: (which is also true if the lock is an 1158: -: 847: exclusive lock), release the lock. */ 1159: #####: 848: if (win_ptr->shared_lock_ref_cnt == 0) { 1162: -: 849: /* FIXME: MT: The setting of the lock type 1163: -: 850: must be done atomically */ 1164: #####: 851: win_ptr->current_lock_type = MPID_LOCK_NONE; 1166: -: 853: 1167: -: 854: /* dequeue entry from lock queue */ 1168: #####: 855: MPIU_Free(single_op->data); 1169: call 0 never executed 1170: #####: 856: MPIU_Free(single_op); 1171: call 0 never executed 1172: #####: 857: *lock_queue_ptr = lock_queue->next; 1173: #####: 858: MPIU_Free(lock_queue); 1174: call 0 never executed 1175: #####: 859: lock_queue = *lock_queue_ptr; 1183: -: 867: next operation. */ 1184: -: 868: 1185: #####: 869: MPIU_Free(single_op); 1186: call 0 never executed 1187: #####: 870: *lock_queue_ptr = lock_queue->next; 1188: #####: 871: MPIU_Free(lock_queue); 1189: call 0 never executed 1190: #####: 872: lock_queue = *lock_queue_ptr; 1191: -: 873: 1192: #####: 874: if (requested_lock == MPI_LOCK_EXCLUSIVE) 1193: branch 0 never executed 1194: branch 1 never executed 1195: #####: 875: break; 1199: -: 879: else { 1200: -: 880: /* send lock granted packet. */ 1201: #####: 881: mpi_errno = 1205: -: 884: 1206: -: 885: /* dequeue entry from lock queue */ 1207: #####: 886: *lock_queue_ptr = lock_queue->next; 1208: #####: 887: MPIU_Free(lock_queue); 1209: call 0 never executed 1210: #####: 888: lock_queue = *lock_queue_ptr; 1212: -: 890: /* if the granted lock is exclusive, 1213: -: 891: no need to continue */ 1214: #####: 892: if (requested_lock == MPI_LOCK_EXCLUSIVE) 1215: branch 0 never executed 1216: branch 1 never executed 1217: #####: 893: break; 1220: -: 896: } 1221: -: 897: else { 1222: #####: 898: lock_queue_ptr = &(lock_queue->next); 1223: #####: 899: lock_queue = lock_queue->next; 1224: -: 900: } 1225: -: 901: } 1226: #####: 902: } while (temp_entered_count != entered_count); 1227: branch 0 never executed 1228: branch 1 never executed 1229: #####: 903: entered_count = entered_flag = 0; 1230: -: 904: } 1231: -: 905: 1232: #####: 906: fn_exit: 1233: #####: 906: fn_exit: 1234: #####: 908: return mpi_errno; 1242: -: 916:int MPIDI_CH3I_Send_pt_rma_done_pkt(MPIDI_VC_t *vc, MPI_Win source_win_handle) 1243: function MPIDI_CH3I_Send_pt_rma_done_pkt called 0 returned 0% blocks executed 0% 1244: #####: 917:{ 1245: -: 918: MPIDI_CH3_Pkt_t upkt; 1246: #####: 919: MPIDI_CH3_Pkt_pt_rma_done_t *pt_rma_done_pkt = &upkt.pt_rma_done; 1247: -: 920: MPID_Request *req; 1248: #####: 921: int mpi_errno=MPI_SUCCESS; 1251: -: 924: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_PT_RMA_DONE_PKT); 1252: -: 925: 1253: #####: 926: MPIDI_Pkt_init(pt_rma_done_pkt, MPIDI_CH3_PKT_PT_RMA_DONE); 1254: #####: 927: pt_rma_done_pkt->source_win_handle = source_win_handle; 1256: -: 929: /* Because this is in a packet handler, it is already within a critical section */ 1257: -: 930: /* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */ 1258: #####: 931: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, pt_rma_done_pkt, 1260: -: 932: sizeof(*pt_rma_done_pkt), &req)); 1261: -: 933: /* MPIU_THREAD_CS_EXIT(CH3COMM,vc); */ 1262: #####: 934: if (mpi_errno != MPI_SUCCESS) { 1267: -: 936: } 1268: -: 937: 1269: #####: 938: if (req != NULL) 1271: branch 1 never executed 1272: -: 939: { 1273: #####: 940: MPID_Request_release(req); 1283: -: 941: } 1284: -: 942: 1285: #####: 945: return mpi_errno; 1293: -: 953:static int do_simple_accumulate(MPIDI_PT_single_op *single_op) 1294: function do_simple_accumulate called 0 returned 0% blocks executed 0% 1295: #####: 954:{ 1296: #####: 955: int mpi_errno = MPI_SUCCESS; 1300: -: 959: MPIDI_FUNC_ENTER(MPID_STATE_DO_SIMPLE_ACCUMULATE); 1301: -: 960: 1302: #####: 961: if (single_op->op == MPI_REPLACE) 1305: -: 962: { 1306: -: 963: /* simply copy the data */ 1307: #####: 964: mpi_errno = MPIR_Localcopy(single_op->data, single_op->count, 1309: -: 965: single_op->datatype, single_op->addr, 1310: -: 966: single_op->count, single_op->datatype); 1311: #####: 967: if (mpi_errno) { 1318: -: 971: } 1319: -: 972: 1320: #####: 973: if (HANDLE_GET_KIND(single_op->op) == HANDLE_KIND_BUILTIN) 1323: -: 974: { 1324: -: 975: /* get the function by indexing into the op table */ 1325: #####: 976: uop = MPIR_Op_table[(single_op->op)%16 - 1]; 1335: -: 985: 1336: -: 986: /* only basic datatypes supported for this optimization. */ 1337: #####: 987: (*uop)(single_op->data, single_op->addr, 1340: -: 988: &(single_op->count), &(single_op->datatype)); 1341: -: 989: 1342: #####: 991: fn_exit: 1343: #####: 991: fn_exit: 1344: #####: 993: return mpi_errno; 1353: -: 1002:static int do_simple_get(MPID_Win *win_ptr, MPIDI_Win_lock_queue *lock_queue) 1354: function do_simple_get called 0 returned 0% blocks executed 0% 1355: #####: 1003:{ 1356: -: 1004: MPIDI_CH3_Pkt_t upkt; 1357: #####: 1005: MPIDI_CH3_Pkt_get_resp_t * get_resp_pkt = &upkt.get_resp; 1358: -: 1006: MPID_Request *req; 1359: -: 1007: MPID_IOV iov[MPID_IOV_LIMIT]; 1360: #####: 1008: int type_size, mpi_errno=MPI_SUCCESS; 1363: -: 1011: MPIDI_FUNC_ENTER(MPID_STATE_DO_SIMPLE_GET); 1364: -: 1012: 1365: #####: 1013: req = MPID_Request_create(); 1366: call 0 never executed 1367: #####: 1014: if (req == NULL) { 1371: call 0 never executed 1372: -: 1016: } 1373: #####: 1017: req->dev.target_win_handle = win_ptr->handle; 1374: #####: 1018: req->dev.source_win_handle = lock_queue->source_win_handle; 1375: #####: 1019: req->dev.single_op_opt = 1; 1376: -: 1020: 1377: #####: 1021: MPIDI_Request_set_type(req, MPIDI_REQUEST_TYPE_GET_RESP); 1378: #####: 1022: req->kind = MPID_REQUEST_SEND; 1379: #####: 1023: req->dev.OnDataAvail = MPIDI_CH3_ReqHandler_GetSendRespComplete; 1380: #####: 1024: req->dev.OnFinal = MPIDI_CH3_ReqHandler_GetSendRespComplete; 1381: -: 1025: 1382: #####: 1026: MPIDI_Pkt_init(get_resp_pkt, MPIDI_CH3_PKT_GET_RESP); 1383: #####: 1027: get_resp_pkt->request_handle = lock_queue->pt_single_op->request_handle; 1384: -: 1028: 1385: #####: 1029: iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) get_resp_pkt; 1386: #####: 1030: iov[0].MPID_IOV_LEN = sizeof(*get_resp_pkt); 1387: -: 1031: 1388: #####: 1032: iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)lock_queue->pt_single_op->addr; 1389: #####: 1033: MPID_Datatype_get_size_macro(lock_queue->pt_single_op->datatype, type_size); 1393: branch 3 never executed 1394: call 4 never executed 1395: #####: 1034: iov[1].MPID_IOV_LEN = lock_queue->pt_single_op->count * type_size; 1397: -: 1036: /* Because this is in a packet handler, it is already within a critical section */ 1398: -: 1037: /* MPIU_THREAD_CS_ENTER(CH3COMM,vc); */ 1399: #####: 1038: mpi_errno = MPIU_CALL(MPIDI_CH3,iSendv(lock_queue->vc, req, iov, 2)); 1416: -: 1048: 1417: -: 1051: 1418: #####: 1052: return mpi_errno; 332 line(s) not covered by tests in src/mpid/ch3/src/ch3u_handle_recv_req.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_handle_send_req.c.gcov 19: -: 14: int *complete) 20: function MPIDI_CH3U_Handle_send_req called 0 returned 0% blocks executed 0% 21: #####: 15:{ 22: #####: 16: int mpi_errno = MPI_SUCCESS; 28: -: 22: /* Use the associated function rather than switching on the old ca field */ 29: -: 23: /* Routines can call the attached function directly */ 30: #####: 24: reqFn = sreq->dev.OnDataAvail; 31: #####: 25: if (!reqFn) { 32: branch 0 never executed 33: branch 1 never executed 34: #####: 26: MPIU_Assert(MPIDI_Request_get_type(sreq) != MPIDI_REQUEST_TYPE_GET_RESP); 37: call 2 never executed 38: call 3 never executed 39: #####: 27: MPIDI_CH3U_Request_complete(sreq); 47: branch 7 never executed 48: call 8 never executed 49: #####: 28: *complete = 1; 50: -: 29: } 51: -: 30: else { 52: #####: 31: mpi_errno = reqFn( vc, sreq, complete ); 55: -: 32: } 56: -: 33: 57: #####: 35: return mpi_errno; 69: -: 47: int *complete ) 70: function MPIDI_CH3_ReqHandler_GetSendRespComplete called 0 returned 0% blocks executed 0% 71: #####: 48:{ 72: #####: 49: int mpi_errno = MPI_SUCCESS; 73: -: 50: 74: -: 51: /* FIXME: Should this test be an MPIU_Assert? */ 75: #####: 52: if (sreq->dev.source_win_handle != MPI_WIN_NULL) { 83: -: 58: packet since the last operation is a get. */ 84: -: 59: 85: #####: 60: MPID_Win_get_ptr(sreq->dev.target_win_handle, win_ptr); 88: branch 2 never executed 89: call 3 never executed 90: #####: 61: if (win_ptr->current_lock_type == MPID_LOCK_NONE) { 92: branch 1 never executed 93: -: 62: /* FIXME: MT: this has to be done atomically */ 94: #####: 63: win_ptr->my_counter -= 1; 95: -: 64: } 96: -: 65: else { 97: #####: 66: mpi_errno = MPIDI_CH3I_Release_lock(win_ptr); 101: -: 69: 102: -: 70: /* mark data transfer as complete and decrement CC */ 103: #####: 71: MPIDI_CH3U_Request_complete(sreq); 111: branch 7 never executed 112: call 8 never executed 113: #####: 72: *complete = TRUE; 114: -: 73: 115: #####: 74: return mpi_errno; 119: -: 78: int *complete ) 120: function MPIDI_CH3_ReqHandler_SendReloadIOV called 0 returned 0% blocks executed 0% 121: #####: 79:{ 124: -: 82: /* setting the iov_offset to 0 here is critical, since it is intentionally 125: -: 83: * not set in the _load_send_iov function */ 126: #####: 84: sreq->dev.iov_offset = 0; 127: #####: 85: sreq->dev.iov_count = MPID_IOV_LIMIT; 128: #####: 86: mpi_errno = MPIDI_CH3U_Request_load_send_iov(sreq, sreq->dev.iov, 129: call 0 never executed 130: -: 87: &sreq->dev.iov_count); 131: #####: 88: if (mpi_errno != MPI_SUCCESS) { 136: -: 90: } 137: -: 91: 138: #####: 92: *complete = FALSE; 139: #####: 92: *complete = FALSE; 140: -: 93: 141: #####: 95: return mpi_errno; 26 line(s) not covered by tests in src/mpid/ch3/src/ch3u_handle_send_req.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_port.c.gcov 123: -: 118: MPIDI_VC_t **vc_pptr) 124: function MPIDI_Create_inter_root_communicator_connect called 0 returned 0% blocks executed 0% 125: #####: 119:{ 126: #####: 120: int mpi_errno = MPI_SUCCESS; 127: -: 121: MPID_Comm *tmp_comm; 128: #####: 122: MPIDI_VC_t *connect_vc = NULL; 136: -: 130: we can use MPI functions to communicate data between them. */ 137: -: 131: 138: #####: 132: mpi_errno = MPIU_CALL(MPIDI_CH3,Connect_to_root(port_name, &connect_vc)); 139: call 0 never executed 140: #####: 133: if (mpi_errno != MPI_SUCCESS) { 146: -: 136: 147: -: 137: /* extract the tag from the port_name */ 148: #####: 138: mpi_errno = MPIDI_GetTagFromPort( port_name, &port_name_tag); 149: call 0 never executed 150: #####: 139: if (mpi_errno != MPIU_STR_SUCCESS) { 155: -: 141: } 156: -: 142: 157: #####: 143: mpi_errno = MPIDI_CH3I_Initialize_tmp_comm(&tmp_comm, connect_vc, 1, port_name_tag); 158: call 0 never executed 159: #####: 144: if (mpi_errno != MPI_SUCCESS) { 164: -: 146: } 165: -: 147: 166: #####: 148: *comm_pptr = tmp_comm; 167: #####: 149: *vc_pptr = connect_vc; 168: -: 150: 169: #####: 151: fn_exit: 170: #####: 151: fn_exit: 171: #####: 153: return mpi_errno; 185: -: 167: MPIDI_VC_t **vc_pptr) 186: function MPIDI_Create_inter_root_communicator_accept called 0 returned 0% blocks executed 0% 187: #####: 168:{ 188: #####: 169: int mpi_errno = MPI_SUCCESS; 189: -: 170: MPID_Comm *tmp_comm; 190: #####: 171: MPIDI_VC_t *new_vc = NULL; 196: -: 177: 197: -: 178: /* extract the tag from the port_name */ 198: #####: 179: mpi_errno = MPIDI_GetTagFromPort( port_name, &port_name_tag); 199: call 0 never executed 200: #####: 180: if (mpi_errno != MPIU_STR_SUCCESS) { 212: -: 189: not, poke the progress engine. */ 213: -: 190: 214: #####: 191: MPID_Progress_start(&progress_state); 215: -: 192: for(;;) 216: -: 193: { 217: #####: 194: MPIDI_CH3I_Acceptq_dequeue(&new_vc, port_name_tag); 218: call 0 never executed 219: #####: 195: if (new_vc != NULL) 221: branch 1 never executed 222: -: 196: { 223: #####: 197: break; 224: -: 198: } 225: -: 199: 226: #####: 200: mpi_errno = MPID_Progress_wait(&progress_state); 239: -: 209: MPID_Progress_end(&progress_state); 240: -: 210: 241: #####: 211: mpi_errno = MPIDI_CH3I_Initialize_tmp_comm(&tmp_comm, new_vc, 0, port_name_tag); 242: call 0 never executed 243: #####: 212: if (mpi_errno != MPI_SUCCESS) { 248: -: 214: } 249: -: 215: 250: #####: 216: *comm_pptr = tmp_comm; 251: #####: 217: *vc_pptr = new_vc; 254: -: 220: "new_vc=%p", new_vc)); 255: -: 221: 256: #####: 222:fn_exit: 257: #####: 222:fn_exit: 258: #####: 224: return mpi_errno; 272: -: 238: MPIDI_VC_t *vc_ptr, int is_low_group, int context_id_offset) 273: function MPIDI_CH3I_Initialize_tmp_comm called 0 returned 0% blocks executed 0% 274: #####: 239:{ 275: #####: 240: int mpi_errno = MPI_SUCCESS; 279: -: 244: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_INITIALIZE_TMP_COMM); 280: -: 245: 281: #####: 246: MPID_Comm_get_ptr( MPI_COMM_SELF, commself_ptr ); 282: -: 247: 283: -: 248: /* WDG-old code allocated a context id that was then discarded */ 284: #####: 249: mpi_errno = MPIR_Comm_create(&tmp_comm); 285: call 0 never executed 286: #####: 250: if (mpi_errno != MPI_SUCCESS) { 299: -: 260: * processes, this context ID might get out of sync. 300: -: 261: */ 301: #####: 262: tmp_comm->context_id = MPID_CONTEXT_SET_FIELD(DYNAMIC_PROC, context_id_offset, 1); 302: #####: 263: tmp_comm->recvcontext_id = tmp_comm->context_id; 303: -: 264: 304: -: 265: /* FIXME - we probably need a unique context_id. */ 305: #####: 266: tmp_comm->remote_size = 1; 306: -: 267: 307: -: 268: /* Fill in new intercomm */ 308: #####: 269: tmp_comm->local_size = 1; 309: #####: 270: tmp_comm->rank = 0; 310: #####: 271: tmp_comm->comm_kind = MPID_INTERCOMM; 311: #####: 272: tmp_comm->local_comm = NULL; 312: #####: 273: tmp_comm->is_low_group = is_low_group; 317: -: 278: /* Point local vcr, vcrt at those of commself_ptr */ 318: -: 279: /* FIXME: Explain why */ 319: #####: 280: tmp_comm->local_vcrt = commself_ptr->vcrt; 320: #####: 281: MPID_VCRT_Add_ref(commself_ptr->vcrt); 321: call 0 never executed 322: #####: 282: tmp_comm->local_vcr = commself_ptr->vcr; 327: -: 287: 328: -: 288: /* Set up VC reference table */ 329: #####: 289: mpi_errno = MPID_VCRT_Create(tmp_comm->remote_size, &tmp_comm->vcrt); 330: call 0 never executed 331: #####: 290: if (mpi_errno != MPI_SUCCESS) { 335: call 0 never executed 336: -: 292: } 337: #####: 293: mpi_errno = MPID_VCRT_Get_ptr(tmp_comm->vcrt, &tmp_comm->vcr); 338: call 0 never executed 339: #####: 294: if (mpi_errno != MPI_SUCCESS) { 345: -: 297: 346: -: 298: /* FIXME: Why do we do a dup here? */ 347: #####: 299: MPID_VCR_Dup(vc_ptr, tmp_comm->vcr); 348: call 0 never executed 349: -: 300: 350: #####: 301: *comm_pptr = tmp_comm; 362: -: 313:#endif 363: -: 314: 364: #####: 315:fn_exit: 365: #####: 315:fn_exit: 366: #####: 317: return mpi_errno; 389: -: 340: MPID_Comm *comm_ptr, MPID_Comm **newcomm) 390: function MPIDI_Comm_connect called 0 returned 0% blocks executed 0% 391: #####: 341:{ 392: #####: 342: int mpi_errno=MPI_SUCCESS; 393: -: 343: int j, i, rank, recv_ints[3], send_ints[3], context_id; 394: #####: 344: int remote_comm_size=0; 395: #####: 345: MPID_Comm *tmp_comm = NULL, *intercomm; 396: #####: 346: MPIDI_VC_t *new_vc = NULL; 397: #####: 347: int sendtag=100, recvtag=100, n_remote_pgs; 398: #####: 348: int n_local_pgs=1, local_comm_size; 399: #####: 349: pg_translation *local_translation = NULL, *remote_translation = NULL; 400: #####: 350: pg_node *pg_list = NULL; 401: #####: 351: MPIDI_PG_t **remote_pg = NULL; 402: #####: 352: MPIU_CHKLMEM_DECL(3); 408: -: 358: context id to the other side. */ 409: -: 359: /* FIXME: If we fail to connect, someone needs to free this newcomm */ 410: #####: 360: mpi_errno = MPIR_Comm_create(newcomm); 411: call 0 never executed 412: #####: 361: if (mpi_errno) { 416: call 0 never executed 417: -: 363: } 418: #####: 364: mpi_errno = MPIR_Get_contextid( comm_ptr, &(*newcomm)->recvcontext_id ); 425: -: 367: /* (*newcomm)->context_id = (*newcomm)->recvcontext_id; */ 426: -: 368: 427: #####: 369: rank = comm_ptr->rank; 428: #####: 370: local_comm_size = comm_ptr->local_size; 429: -: 371: 430: #####: 372: if (rank == root) 434: -: 374: /* Establish a communicator to communicate with the root on the 435: -: 375: other side. */ 436: #####: 376: mpi_errno = MPIDI_Create_inter_root_communicator_connect( 437: call 0 never executed 438: -: 377: port_name, &tmp_comm, &new_vc); 439: #####: 378: if (mpi_errno != MPI_SUCCESS) { 446: -: 382: /* Make an array to translate local ranks to process group index 447: -: 383: and rank */ 448: #####: 384: MPIU_CHKLMEM_MALLOC(local_translation,pg_translation*, 464: -: 390: The encoded string for each process group contains the process 465: -: 391: group id, size and all its KVS values */ 466: #####: 392: mpi_errno = ExtractLocalPGInfo( comm_ptr, local_translation, 473: -: 398: context_id for newcomm */ 474: -: 399: 475: #####: 400: send_ints[0] = n_local_pgs; 476: #####: 401: send_ints[1] = local_comm_size; 477: #####: 402: send_ints[2] = (*newcomm)->recvcontext_id; 480: -: 405: "sending two ints, %d and %d, and receiving 3 ints", 481: -: 406: send_ints[0], send_ints[1])); 482: #####: 407: mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0, 485: -: 409: 0, recvtag++, tmp_comm->handle, 486: -: 410: MPI_STATUS_IGNORE); 487: #####: 411: if (mpi_errno != MPI_SUCCESS) { 495: -: 416: /* broadcast the received info to local processes */ 496: -: 417: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"broadcasting the received 3 ints"); 497: #####: 418: mpi_errno = MPIR_Bcast(recv_ints, 3, MPI_INT, root, comm_ptr); 498: call 0 never executed 499: #####: 419: if (mpi_errno) { 504: -: 421: } 505: -: 422: 506: #####: 423: n_remote_pgs = recv_ints[0]; 507: #####: 424: remote_comm_size = recv_ints[1]; 508: #####: 425: context_id = recv_ints[2]; 509: -: 426: 510: #####: 427: MPIU_CHKLMEM_MALLOC(remote_pg,MPIDI_PG_t**, 521: -: 428: n_remote_pgs * sizeof(MPIDI_PG_t*), 522: -: 429: mpi_errno,"remote_pg"); 523: #####: 430: MPIU_CHKLMEM_MALLOC(remote_translation,pg_translation*, 537: -: 434: 538: -: 435: /* Exchange the process groups and their corresponding KVSes */ 539: #####: 436: if (rank == root) 541: branch 1 never executed 542: -: 437: { 543: #####: 438: mpi_errno = SendPGtoPeerAndFree( tmp_comm, &sendtag, pg_list ); 544: call 0 never executed 545: #####: 439: mpi_errno = ReceivePGAndDistribute( tmp_comm, comm_ptr, root, &recvtag, 551: -: 444: "sending %d ints, receiving %d ints", 552: -: 445: local_comm_size * 2, remote_comm_size * 2)); 553: #####: 446: mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2, 557: -: 449: MPI_INT, 0, recvtag++, tmp_comm->handle, 558: -: 450: MPI_STATUS_IGNORE); 559: #####: 451: if (mpi_errno) { 575: -: 464: else 576: -: 465: { 577: #####: 466: mpi_errno = ReceivePGAndDistribute( tmp_comm, comm_ptr, root, &recvtag, 582: -: 470: /* Broadcast out the remote rank translation array */ 583: -: 471: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Broadcasting remote translation"); 584: #####: 472: mpi_errno = MPIR_Bcast(remote_translation, remote_comm_size * 2, MPI_INT, 585: call 0 never executed 586: -: 473: root, comm_ptr); 587: #####: 474: if (mpi_errno) { 600: -: 484:#endif 601: -: 485: 602: #####: 486: intercomm = *newcomm; 603: #####: 487: intercomm->context_id = context_id; 604: #####: 488: intercomm->is_low_group = 1; 605: -: 489: 606: #####: 490: mpi_errno = SetupNewIntercomm( comm_ptr, remote_comm_size, 607: call 0 never executed 608: -: 491: remote_translation, remote_pg, intercomm ); 609: #####: 492: if (mpi_errno != MPI_SUCCESS) { 615: -: 495: 616: -: 496: /* synchronize with remote root */ 617: #####: 497: if (rank == root) 620: -: 498: { 621: -: 499: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer"); 622: #####: 500: mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0, 625: -: 502: 0, recvtag++, tmp_comm->handle, 626: -: 503: MPI_STATUS_IGNORE); 627: #####: 504: if (mpi_errno != MPI_SUCCESS) { 633: -: 507: 634: -: 508: /* All communication with remote root done. Release the communicator. */ 635: #####: 509: MPIR_Comm_release(tmp_comm,0); 638: -: 511: 639: -: 512: /*printf("connect:barrier\n");fflush(stdout);*/ 640: #####: 513: mpi_errno = MPIR_Barrier(comm_ptr); 641: call 0 never executed 642: #####: 514: if (mpi_errno != MPI_SUCCESS) { 648: -: 517: 649: -: 518: /* Free new_vc. It was explicitly allocated in MPIDI_CH3_Connect_to_root.*/ 650: #####: 519: if (rank == root) { 651: branch 0 never executed 652: branch 1 never executed 653: #####: 520: FreeNewVC( new_vc ); 657: -: 523: fn_exit: 658: -: 524: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Exiting ch3u_comm_connect"); 659: #####: 525: MPIU_CHKLMEM_FREEALL(); 662: branch 1 never executed 663: branch 2 never executed 664: #####: 527: return mpi_errno; 688: -: 551: int *n_local_pgs_p ) 689: function ExtractLocalPGInfo called 0 returned 0% blocks executed 0% 690: #####: 552:{ 691: #####: 553: pg_node *pg_list = 0, *pg_iter, *pg_trailer; 692: #####: 554: int i, cur_index = 0, local_comm_size, mpi_errno = 0; 693: #####: 555: MPIU_CHKPMEM_DECL(1); 698: -: 560: /* If we are in the case of singleton-init, we may need to reset the 699: -: 561: id string for comm world. We do this before doing anything else */ 700: #####: 562: MPIDI_PG_CheckForSingleton(); 701: call 0 never executed 702: -: 563: 703: #####: 564: local_comm_size = comm_p->local_size; 708: -: 569: group id, size and all its KVS values */ 709: -: 570: 710: #####: 571: cur_index = 0; 711: #####: 572: MPIU_CHKPMEM_MALLOC(pg_list,pg_node*,sizeof(pg_node),mpi_errno, 720: -: 573: "pg_list"); 721: -: 574: 722: #####: 575: pg_list->pg_id = MPIU_Strdup(comm_p->vcr[0]->pg->id); 723: call 0 never executed 724: #####: 576: pg_list->index = cur_index++; 725: #####: 577: pg_list->next = NULL; 726: -: 578: /* XXX DJG FIXME-MT should we be checking this? the add/release macros already check this */ 727: #####: 579: MPIU_Assert( MPIU_Object_get_ref(comm_p->vcr[0]->pg)); 730: call 2 never executed 731: call 3 never executed 732: #####: 580: mpi_errno = MPIDI_PG_To_string(comm_p->vcr[0]->pg, &pg_list->str, 733: call 0 never executed 734: -: 581: &pg_list->lenStr ); 735: #####: 582: if (mpi_errno != MPI_SUCCESS) { 740: -: 584: } 741: -: 585: MPIU_DBG_STMT(CH3_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"PG as string is", pg_list->str )); 742: #####: 586: local_translation[0].pg_index = 0; 743: #####: 587: local_translation[0].pg_rank = comm_p->vcr[0]->pg_rank; 744: #####: 588: pg_iter = pg_list; 745: #####: 589: for (i=1; ivcr[i]->pg) != 0); 758: call 2 never executed 759: call 3 never executed 760: #####: 596: if (MPIDI_PG_Id_compare(comm_p->vcr[i]->pg->id, pg_iter->pg_id)) { 762: branch 1 never executed 763: branch 2 never executed 764: #####: 597: local_translation[i].pg_index = pg_iter->index; 765: #####: 598: local_translation[i].pg_rank = comm_p->vcr[i]->pg_rank; 766: #####: 599: break; 767: -: 600: } 768: #####: 601: if (pg_trailer != pg_iter) 769: branch 0 never executed 770: branch 1 never executed 771: #####: 602: pg_trailer = pg_trailer->next; 772: #####: 603: pg_iter = pg_iter->next; 773: -: 604: } 774: #####: 605: if (pg_iter == NULL) { 777: -: 606: /* We use MPIU_Malloc directly because we do not know in 778: -: 607: advance how many nodes we may allocate */ 779: #####: 608: pg_iter = (pg_node*)MPIU_Malloc(sizeof(pg_node)); 780: call 0 never executed 781: #####: 609: if (!pg_iter) { 785: call 0 never executed 786: -: 611: } 787: #####: 612: pg_iter->pg_id = MPIU_Strdup(comm_p->vcr[i]->pg->id); 788: call 0 never executed 789: #####: 613: pg_iter->index = cur_index++; 790: #####: 614: pg_iter->next = NULL; 791: #####: 615: mpi_errno = MPIDI_PG_To_string(comm_p->vcr[i]->pg, &pg_iter->str, 792: call 0 never executed 793: -: 616: &pg_iter->lenStr ); 794: #####: 617: if (mpi_errno != MPI_SUCCESS) { 798: call 0 never executed 799: -: 619: } 800: #####: 620: local_translation[i].pg_index = pg_iter->index; 801: #####: 621: local_translation[i].pg_rank = comm_p->vcr[i]->pg_rank; 802: #####: 622: pg_trailer->next = pg_iter; 804: -: 624: } 805: -: 625: 806: #####: 626: *n_local_pgs_p = cur_index; 807: #####: 627: *pg_list_p = pg_list; 816: -: 636: 817: -: 637: 818: #####: 638: fn_exit: 819: #####: 638: fn_exit: 820: #####: 640: return mpi_errno; 821: #####: 640: return mpi_errno; 822: #####: 642: MPIU_CHKPMEM_REAP(); 840: -: 657: int n_remote_pgs, MPIDI_PG_t *remote_pg[] ) 841: function ReceivePGAndDistribute called 0 returned 0% blocks executed 0% 842: #####: 658:{ 843: #####: 659: char *pg_str = 0; 844: -: 660: int i, j, flag; 845: #####: 661: int rank = comm_ptr->rank; 846: #####: 662: int mpi_errno = 0; 847: #####: 663: int recvtag = *recvtag_p; 850: -: 666: MPIDI_FUNC_ENTER(MPID_STATE_RECEIVEPGANDDISTRIBUTE); 851: -: 667: 852: #####: 668: for (i=0; ihandle, MPI_STATUS_IGNORE); 863: #####: 674: *recvtag_p = recvtag; 864: #####: 675: if (mpi_errno != MPI_SUCCESS) { 868: call 0 never executed 869: -: 677: } 870: #####: 678: pg_str = (char*)MPIU_Malloc(j); 871: call 0 never executed 872: #####: 679: if (pg_str == NULL) { 876: call 0 never executed 877: -: 681: } 878: #####: 682: mpi_errno = MPIC_Recv(pg_str, j, MPI_CHAR, 0, recvtag++, 879: call 0 never executed 880: -: 683: tmp_comm->handle, MPI_STATUS_IGNORE); 881: #####: 684: *recvtag_p = recvtag; 882: #####: 685: if (mpi_errno != MPI_SUCCESS) { 890: -: 690: /* Broadcast the size and data to the local communicator */ 891: -: 691: /*printf("accept:broadcasting 1 int\n");fflush(stdout);*/ 892: #####: 692: mpi_errno = MPIR_Bcast(&j, 1, MPI_INT, root, comm_ptr); 893: call 0 never executed 894: #####: 693: if (mpi_errno != MPI_SUCCESS) { 899: -: 695: } 900: -: 696: 901: #####: 697: if (rank != root) { 903: branch 1 never executed 904: -: 698: /* The root has already allocated this string */ 905: #####: 699: pg_str = (char*)MPIU_Malloc(j); 906: call 0 never executed 907: #####: 700: if (pg_str == NULL) { 913: -: 703: } 914: -: 704: /*printf("accept:broadcasting string of length %d\n", j);fflush(stdout);*/ 915: #####: 705: mpi_errno = MPIR_Bcast(pg_str, j, MPI_CHAR, root, comm_ptr); 916: call 0 never executed 917: #####: 706: if (mpi_errno != MPI_SUCCESS) { 925: -: 711: 926: -: 712: MPIU_DBG_STMT(CH3_CONNECT,VERBOSE,MPIDI_PrintConnStr(__FILE__,__LINE__,"Creating pg from string", pg_str )); 927: #####: 713: mpi_errno = MPIDI_PG_Create_from_string(pg_str, &remote_pg[i], &flag); 928: call 0 never executed 929: #####: 714: if (mpi_errno != MPI_SUCCESS) { 934: -: 716: } 935: -: 717: 936: #####: 718: MPIU_Free(pg_str); 937: call 0 never executed 938: #####: 719: if (flag) { 949: -: 728: /* FIXME: Need to understand this and either remove or make 950: -: 729: common to all channels */ 951: #####: 730: MPIDI_PG_add_ref(remote_pg[i]); 957: -: 732: } 958: -: 733: } 959: #####: 734: fn_exit: 960: #####: 734: fn_exit: 961: #####: 736: return mpi_errno; 974: -: 749:int MPID_PG_BCast( MPID_Comm *peercomm_p, MPID_Comm *comm_p, int root ) 975: function MPID_PG_BCast called 0 returned 0% blocks executed 0% 976: #####: 750:{ 977: #####: 751: int n_local_pgs=0, mpi_errno = 0; 978: #####: 752: pg_translation *local_translation = 0; 979: #####: 753: pg_node *pg_list, *pg_next, *pg_head = 0; 980: -: 754: int rank, i, peer_comm_size; 981: #####: 755: MPIU_CHKLMEM_DECL(1); 982: -: 756: 983: #####: 757: peer_comm_size = comm_p->local_size; 984: #####: 758: rank = comm_p->rank; 985: -: 759: 986: #####: 760: MPIU_CHKLMEM_MALLOC(local_translation,pg_translation*, 998: -: 762: mpi_errno,"local_translation"); 999: -: 763: 1000: #####: 764: if (rank == root) { 1002: branch 1 never executed 1003: -: 765: /* Get the process groups known to the *peercomm* */ 1004: #####: 766: ExtractLocalPGInfo( peercomm_p, local_translation, &pg_head, 1008: -: 769: 1009: -: 770: /* Now, broadcast the number of local pgs */ 1010: #####: 771: NMPI_Bcast( &n_local_pgs, 1, MPI_INT, root, comm_p->handle ); 1011: call 0 never executed 1012: -: 772: 1013: #####: 773: pg_list = pg_head; 1014: #####: 774: for (i=0; istr; 1035: #####: 787: len = pg_list->lenStr; 1036: #####: 788: pg_list = pg_list->next; 1037: -: 789: } 1038: #####: 790: NMPI_Bcast( &len, 1, MPI_INT, root, comm_p->handle ); 1039: call 0 never executed 1040: #####: 791: if (rank != root) { 1041: branch 0 never executed 1042: branch 1 never executed 1043: #####: 792: pg_str = (char *)MPIU_Malloc(len); 1044: call 0 never executed 1045: -: 793: } 1046: #####: 794: NMPI_Bcast( pg_str, len, MPI_CHAR, root, comm_p->handle ); 1047: call 0 never executed 1048: #####: 795: if (rank != root) { 1052: -: 797: already existed. This step 1053: -: 798: also initializes the created process group */ 1054: #####: 799: MPIDI_PG_Create_from_string( pg_str, &pgptr, &flag ); 1055: call 0 never executed 1056: #####: 800: if (flag) { 1059: -: 803: fflush(stdout); */ 1060: -: 804: } 1061: #####: 805: MPIU_Free( pg_str ); 1065: -: 808: 1066: -: 809: /* Free pg_list */ 1067: #####: 810: pg_list = pg_head; 1069: -: 812: /* FIXME: We should use the PG destroy function for this, and ensure that 1070: -: 813: the PG fields are valid for that function */ 1071: #####: 814: while (pg_list) { 1072: branch 0 never executed 1073: branch 1 never executed 1074: #####: 815: pg_next = pg_list->next; 1075: #####: 816: MPIU_Free( pg_list->str ); 1076: call 0 never executed 1077: #####: 817: if (pg_list->pg_id ) { 1078: branch 0 never executed 1079: branch 1 never executed 1080: #####: 818: MPIU_Free( pg_list->pg_id ); 1081: call 0 never executed 1082: -: 819: } 1083: #####: 820: MPIU_Free( pg_list ); 1084: call 0 never executed 1085: #####: 821: pg_list = pg_next; 1087: -: 823: 1088: -: 824: fn_exit: 1089: #####: 825: MPIU_CHKLMEM_FREEALL(); 1091: branch 1 never executed 1092: branch 2 never executed 1093: #####: 826: return mpi_errno; 1105: -: 838: pg_node *pg_list ) 1106: function SendPGtoPeerAndFree called 0 returned 0% blocks executed 0% 1107: #####: 839:{ 1108: #####: 840: int mpi_errno = 0; 1109: #####: 841: int sendtag = *sendtag_p, i; 1113: -: 845: MPIDI_FUNC_ENTER(MPID_STATE_SENDPGTOPEERANDFREE); 1114: -: 846: 1115: #####: 847: while (pg_list != NULL) { 1116: branch 0 never executed 1117: branch 1 never executed 1118: #####: 848: pg_iter = pg_list; 1119: #####: 849: i = pg_iter->lenStr; 1120: -: 850: /*printf("connect:sending 1 int: %d\n", i);fflush(stdout);*/ 1121: #####: 851: mpi_errno = MPIC_Send(&i, 1, MPI_INT, 0, sendtag++, tmp_comm->handle); 1122: call 0 never executed 1123: #####: 852: *sendtag_p = sendtag; 1124: #####: 853: if (mpi_errno != MPI_SUCCESS) { 1130: -: 856: 1131: -: 857: /* printf("connect:sending string length %d\n", i);fflush(stdout); */ 1132: #####: 858: mpi_errno = MPIC_Send(pg_iter->str, i, MPI_CHAR, 0, sendtag++, 1133: call 0 never executed 1134: -: 859: tmp_comm->handle); 1135: #####: 860: *sendtag_p = sendtag; 1136: #####: 861: if (mpi_errno != MPI_SUCCESS) { 1141: -: 863: } 1142: -: 864: 1143: #####: 865: pg_list = pg_list->next; 1144: #####: 866: MPIU_Free(pg_iter->str); 1145: call 0 never executed 1146: #####: 867: MPIU_Free(pg_iter->pg_id); 1147: call 0 never executed 1148: #####: 868: MPIU_Free(pg_iter); 1150: -: 869: } 1151: -: 870: 1152: #####: 871: fn_exit: 1153: #####: 871: fn_exit: 1154: #####: 873: return mpi_errno; 1180: -: 899: MPID_Comm *comm_ptr, MPID_Comm **newcomm) 1181: function MPIDI_Comm_accept called 0 returned 0% blocks executed 0% 1182: #####: 900:{ 1183: #####: 901: int mpi_errno=MPI_SUCCESS; 1184: -: 902: int i, j, rank, recv_ints[3], send_ints[3], context_id; 1185: #####: 903: int remote_comm_size=0; 1186: #####: 904: MPID_Comm *tmp_comm = NULL, *intercomm; 1187: #####: 905: MPIDI_VC_t *new_vc = NULL; 1188: #####: 906: int sendtag=100, recvtag=100, local_comm_size; 1189: #####: 907: int n_local_pgs=1, n_remote_pgs; 1190: #####: 908: pg_translation *local_translation = NULL, *remote_translation = NULL; 1191: #####: 909: pg_node *pg_list = NULL; 1192: #####: 910: MPIDI_PG_t **remote_pg = NULL; 1193: #####: 911: MPIU_CHKLMEM_DECL(3); 1198: -: 916: /* Create the new intercommunicator here. We need to send the 1199: -: 917: context id to the other side. */ 1200: #####: 918: mpi_errno = MPIR_Comm_create(newcomm); 1201: call 0 never executed 1202: #####: 919: if (mpi_errno != MPI_SUCCESS) { 1206: call 0 never executed 1207: -: 921: } 1208: #####: 922: mpi_errno = MPIR_Get_contextid( comm_ptr, &(*newcomm)->recvcontext_id ); 1215: -: 925: /* (*newcomm)->context_id = (*newcomm)->recvcontext_id; */ 1216: -: 926: 1217: #####: 927: rank = comm_ptr->rank; 1218: #####: 928: local_comm_size = comm_ptr->local_size; 1219: -: 929: 1220: #####: 930: if (rank == root) 1224: -: 932: /* Establish a communicator to communicate with the root on the 1225: -: 933: other side. */ 1226: #####: 934: mpi_errno = MPIDI_Create_inter_root_communicator_accept(port_name, 1227: call 0 never executed 1228: -: 935: &tmp_comm, &new_vc); 1229: #####: 936: if (mpi_errno != MPI_SUCCESS) { 1236: -: 940: /* Make an array to translate local ranks to process group index and 1237: -: 941: rank */ 1238: #####: 942: MPIU_CHKLMEM_MALLOC(local_translation,pg_translation*, 1254: -: 948: The encoded string for each process group contains the process 1255: -: 949: group id, size and all its KVS values */ 1256: #####: 950: mpi_errno = ExtractLocalPGInfo( comm_ptr, local_translation, 1261: -: 954: Recv from the remote root: n_remote_pgs, remote_comm_size */ 1262: -: 955: 1263: #####: 956: send_ints[0] = n_local_pgs; 1264: #####: 957: send_ints[1] = local_comm_size; 1265: #####: 958: send_ints[2] = (*newcomm)->recvcontext_id; 1266: -: 959: 1267: -: 960: /*printf("accept:sending 3 ints, %d, %d, %d, and receiving 2 ints\n", send_ints[0], send_ints[1], send_ints[2]);fflush(stdout);*/ 1268: #####: 961: mpi_errno = MPIC_Sendrecv(send_ints, 3, MPI_INT, 0, 1271: -: 963: 0, recvtag++, tmp_comm->handle, 1272: -: 964: MPI_STATUS_IGNORE); 1273: #####: 965: if (mpi_errno != MPI_SUCCESS) { 1281: -: 970: /* broadcast the received info to local processes */ 1282: -: 971: /*printf("accept:broadcasting 2 ints - %d and %d\n", recv_ints[0], recv_ints[1]);fflush(stdout);*/ 1283: #####: 972: mpi_errno = MPIR_Bcast(recv_ints, 3, MPI_INT, root, comm_ptr); 1284: call 0 never executed 1285: #####: 973: if (mpi_errno) { 1290: -: 975: } 1291: -: 976: 1292: #####: 977: n_remote_pgs = recv_ints[0]; 1293: #####: 978: remote_comm_size = recv_ints[1]; 1294: #####: 979: context_id = recv_ints[2]; 1295: #####: 980: MPIU_CHKLMEM_MALLOC(remote_pg,MPIDI_PG_t**, 1306: -: 981: n_remote_pgs * sizeof(MPIDI_PG_t*), 1307: -: 982: mpi_errno,"remote_pg"); 1308: #####: 983: MPIU_CHKLMEM_MALLOC(remote_translation,pg_translation*, 1322: -: 987: 1323: -: 988: /* Exchange the process groups and their corresponding KVSes */ 1324: #####: 989: if (rank == root) 1328: -: 991: /* The root receives the PG from the peer (in tmp_comm) and 1329: -: 992: distributes them to the processes in comm_ptr */ 1330: #####: 993: mpi_errno = ReceivePGAndDistribute( tmp_comm, comm_ptr, root, &recvtag, 1332: -: 994: n_remote_pgs, remote_pg ); 1333: -: 995: 1334: #####: 996: mpi_errno = SendPGtoPeerAndFree( tmp_comm, &sendtag, pg_list ); 1337: -: 998: /* Receive the translations from remote process rank to process group index */ 1338: -: 999: /*printf("accept:sending %d ints and receiving %d ints\n", local_comm_size * 2, remote_comm_size * 2);fflush(stdout);*/ 1339: #####: 1000: mpi_errno = MPIC_Sendrecv(local_translation, local_comm_size * 2, 1354: -: 1014: else 1355: -: 1015: { 1356: #####: 1016: mpi_errno = ReceivePGAndDistribute( tmp_comm, comm_ptr, root, &recvtag, 1361: -: 1020: /* Broadcast out the remote rank translation array */ 1362: -: 1021: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Broadcast remote_translation"); 1363: #####: 1022: mpi_errno = MPIR_Bcast(remote_translation, remote_comm_size * 2, MPI_INT, 1375: -: 1033: 1376: -: 1034: /* Now fill in newcomm */ 1377: #####: 1035: intercomm = *newcomm; 1378: #####: 1036: intercomm->context_id = context_id; 1379: #####: 1037: intercomm->is_low_group = 0; 1380: -: 1038: 1381: #####: 1039: mpi_errno = SetupNewIntercomm( comm_ptr, remote_comm_size, 1382: call 0 never executed 1383: -: 1040: remote_translation, remote_pg, intercomm ); 1384: #####: 1041: if (mpi_errno != MPI_SUCCESS) { 1390: -: 1044: 1391: -: 1045: /* synchronize with remote root */ 1392: #####: 1046: if (rank == root) 1395: -: 1047: { 1396: -: 1048: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"sync with peer"); 1397: #####: 1049: mpi_errno = MPIC_Sendrecv(&i, 0, MPI_INT, 0, 1400: -: 1051: 0, recvtag++, tmp_comm->handle, 1401: -: 1052: MPI_STATUS_IGNORE); 1402: #####: 1053: if (mpi_errno != MPI_SUCCESS) { 1408: -: 1056: 1409: -: 1057: /* All communication with remote root done. Release the communicator. */ 1410: #####: 1058: MPIR_Comm_release(tmp_comm,0); 1413: -: 1060: 1414: -: 1061: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Barrier"); 1415: #####: 1062: mpi_errno = MPIR_Barrier(comm_ptr); 1416: call 0 never executed 1417: #####: 1063: if (mpi_errno != MPI_SUCCESS) { 1425: -: 1068: allocated in ch3_progress.c and returned by 1426: -: 1069: MPIDI_CH3I_Acceptq_dequeue. */ 1427: #####: 1070: if (rank == root) { 1428: branch 0 never executed 1429: branch 1 never executed 1430: #####: 1071: FreeNewVC( new_vc ); 1433: -: 1073: 1434: -: 1074:fn_exit: 1435: #####: 1075: MPIU_CHKLMEM_FREEALL(); 1438: branch 1 never executed 1439: branch 2 never executed 1440: #####: 1077: return mpi_errno; 1477: -: 1114: MPID_Comm *intercomm ) 1478: function SetupNewIntercomm called 0 returned 0% blocks executed 0% 1479: #####: 1115:{ 1480: #####: 1116: int mpi_errno = MPI_SUCCESS, i; 1484: -: 1120: this should use the same routine (not copy/paste code) as 1485: -: 1121: in the upper level code. */ 1486: #####: 1122: intercomm->attributes = NULL; 1487: #####: 1123: intercomm->remote_size = remote_comm_size; 1488: #####: 1124: intercomm->local_size = comm_ptr->local_size; 1489: #####: 1125: intercomm->rank = comm_ptr->rank; 1490: #####: 1126: intercomm->local_group = NULL; 1491: #####: 1127: intercomm->remote_group = NULL; 1492: #####: 1128: intercomm->comm_kind = MPID_INTERCOMM; 1493: #####: 1129: intercomm->local_comm = NULL; 1494: #####: 1130: intercomm->coll_fns = NULL; 1495: -: 1131: 1496: -: 1132: /* Point local vcr, vcrt at those of incoming intracommunicator */ 1497: #####: 1133: intercomm->local_vcrt = comm_ptr->vcrt; 1498: #####: 1134: MPID_VCRT_Add_ref(comm_ptr->vcrt); 1499: call 0 never executed 1500: #####: 1135: intercomm->local_vcr = comm_ptr->vcr; 1501: -: 1136: 1502: -: 1137: /* Set up VC reference table */ 1503: #####: 1138: mpi_errno = MPID_VCRT_Create(intercomm->remote_size, &intercomm->vcrt); 1504: call 0 never executed 1505: #####: 1139: if (mpi_errno != MPI_SUCCESS) { 1509: call 0 never executed 1510: -: 1141: } 1511: #####: 1142: mpi_errno = MPID_VCRT_Get_ptr(intercomm->vcrt, &intercomm->vcr); 1512: call 0 never executed 1513: #####: 1143: if (mpi_errno != MPI_SUCCESS) { 1517: call 0 never executed 1518: -: 1145: } 1519: #####: 1146: for (i=0; i < intercomm->remote_size; i++) { 1520: branch 0 never executed 1521: branch 1 never executed 1522: #####: 1147: MPIDI_PG_Dup_vcr(remote_pg[remote_translation[i].pg_index], 1526: -: 1150: 1527: -: 1151: MPIU_DBG_MSG(CH3_CONNECT,VERBOSE,"Barrier"); 1528: #####: 1152: mpi_errno = MPIR_Barrier(comm_ptr); 1529: call 0 never executed 1530: #####: 1153: if (mpi_errno != MPI_SUCCESS) { 1535: -: 1155: } 1536: -: 1156: 1537: #####: 1157: fn_exit: 1538: #####: 1158: return mpi_errno; 1550: -: 1170:static int FreeNewVC( MPIDI_VC_t *new_vc ) 1551: function FreeNewVC called 0 returned 0% blocks executed 0% 1552: #####: 1171:{ 1553: -: 1172: MPID_Progress_state progress_state; 1554: #####: 1173: int mpi_errno = MPI_SUCCESS; 1555: -: 1174: 1556: #####: 1175: if (new_vc->state != MPIDI_VC_STATE_INACTIVE) { 1559: -: 1176: /* If the new_vc isn't done, run the progress engine until 1560: -: 1177: the state of the new vc is complete */ 1561: #####: 1178: MPID_Progress_start(&progress_state); 1562: #####: 1179: while (new_vc->state != MPIDI_VC_STATE_INACTIVE) { 1563: branch 0 never executed 1564: branch 1 never executed 1565: #####: 1180: mpi_errno = MPID_Progress_wait(&progress_state); 1585: -: 1196:#endif 1586: -: 1197: 1587: #####: 1198: MPIU_CALL(MPIDI_CH3,VC_Destroy(new_vc)); 1588: call 0 never executed 1589: #####: 1199: MPIU_Free(new_vc); 1591: call 0 never executed 1592: -: 1200: 1593: #####: 1202: return mpi_errno; 1629: -: 1238:int MPIDI_CH3I_Acceptq_enqueue(MPIDI_VC_t * vc, int port_name_tag ) 1630: function MPIDI_CH3I_Acceptq_enqueue called 0 returned 0% blocks executed 0% 1631: #####: 1239:{ 1632: #####: 1240: int mpi_errno=MPI_SUCCESS; 1637: -: 1245: 1638: -: 1246: /* FIXME: Use CHKPMEM */ 1639: #####: 1247: q_item = (MPIDI_CH3I_Acceptq_t *) 1651: -: 1248: MPIU_Malloc(sizeof(MPIDI_CH3I_Acceptq_t)); 1652: -: 1256: 1653: #####: 1257: q_item->vc = vc; 1654: #####: 1258: q_item->port_name_tag = port_name_tag; 1655: -: 1259: 1656: -: 1260: /* Keep some statistics on the accept queue */ 1657: #####: 1261: AcceptQueueSize++; 1658: #####: 1262: if (AcceptQueueSize > maxAcceptQueueSize) 1659: branch 0 never executed 1660: branch 1 never executed 1661: #####: 1263: maxAcceptQueueSize = AcceptQueueSize; 1663: -: 1265: /* FIXME: Stack or queue? */ 1664: -: 1266: MPIU_DBG_MSG_P(CH3_CONNECT,TYPICAL,"vc=%p:Enqueuing accept connection",vc); 1665: #####: 1267: q_item->next = acceptq_head; 1666: #####: 1268: acceptq_head = q_item; 1667: -: 1269: 1668: #####: 1270: fn_exit: 1669: #####: 1270: fn_exit: 1670: #####: 1272: return mpi_errno; 1680: -: 1282:int MPIDI_CH3I_Acceptq_dequeue(MPIDI_VC_t ** vc, int port_name_tag) 1681: function MPIDI_CH3I_Acceptq_dequeue called 0 returned 0% blocks executed 0% 1682: #####: 1283:{ 1683: #####: 1284: int mpi_errno=MPI_SUCCESS; 1687: -: 1288: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_ACCEPTQ_DEQUEUE); 1688: -: 1289: 1689: #####: 1290: *vc = NULL; 1690: #####: 1291: q_item = acceptq_head; 1691: #####: 1292: prev = q_item; 1692: -: 1293: 1693: #####: 1294: while (q_item != NULL) 1695: branch 1 never executed 1696: -: 1295: { 1697: #####: 1296: if (q_item->port_name_tag == port_name_tag) 1699: branch 1 never executed 1700: -: 1297: { 1701: #####: 1298: *vc = q_item->vc; 1702: -: 1299: 1703: #####: 1300: if ( q_item == acceptq_head ) 1704: branch 0 never executed 1705: branch 1 never executed 1706: #####: 1301: acceptq_head = q_item->next; 1707: -: 1302: else 1708: #####: 1303: prev->next = q_item->next; 1709: -: 1304: 1710: #####: 1305: MPIU_Free(q_item); 1711: call 0 never executed 1712: #####: 1306: AcceptQueueSize--; 1713: #####: 1307: break;; 1715: -: 1309: else 1716: -: 1310: { 1717: #####: 1311: prev = q_item; 1718: #####: 1312: q_item = q_item->next; 1720: -: 1314: } 1721: -: 1315: 1722: #####: 1316: mpi_errno = MPIDI_CH3_Complete_Acceptq_dequeue(*vc); 1727: -: 1320: *vc,port_name_tag)); 1728: -: 1321: 1729: #####: 1323: return mpi_errno; 357 line(s) not covered by tests in src/mpid/ch3/src/ch3u_port.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_recvq.c.gcov 124: -: 119:int MPIDI_CH3U_Recvq_FU(int source, int tag, int context_id, MPI_Status *s) 125: function MPIDI_CH3U_Recvq_FU called 0 returned 0% blocks executed 0% 126: #####: 120:{ 127: -: 121: MPID_Request * rreq; 128: #####: 122: int found = 0; 132: -: 126: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FU); 133: -: 127: 134: #####: 128: rreq = recvq_unexpected_head; 135: -: 129: 136: #####: 130: match.parts.context_id = context_id; 137: #####: 131: match.parts.tag = tag; 138: #####: 132: match.parts.rank = source; 139: -: 133: 140: #####: 134: if (tag != MPI_ANY_TAG && source != MPI_ANY_SOURCE) { 141: branch 0 never executed 142: branch 1 never executed 143: #####: 135: while (rreq != NULL) { 144: branch 0 never executed 145: branch 1 never executed 146: #####: 136: if (MATCH_WITH_NO_MASK(rreq->dev.match, match)) 151: branch 4 never executed 152: branch 5 never executed 153: #####: 137: break; 154: #####: 138: rreq = rreq->dev.next; 156: -: 140: } 157: -: 141: else { 158: #####: 142: mask.parts.context_id = mask.parts.rank = mask.parts.tag = ~0; 159: #####: 143: if (tag == MPI_ANY_TAG) 160: branch 0 never executed 161: branch 1 never executed 162: #####: 144: match.parts.tag = mask.parts.tag = 0; 163: #####: 145: if (source == MPI_ANY_SOURCE) 164: branch 0 never executed 165: branch 1 never executed 166: #####: 146: match.parts.rank = mask.parts.rank = 0; 167: -: 147: 168: #####: 148: while (rreq != NULL) { 169: branch 0 never executed 170: branch 1 never executed 171: #####: 149: if (MATCH_WITH_LEFT_MASK(rreq->dev.match, match, mask)) 176: branch 4 never executed 177: branch 5 never executed 178: #####: 150: break; 179: #####: 151: rreq = rreq->dev.next; 183: -: 155: /* Save the information about the request before releasing the 184: -: 156: queue */ 185: #####: 157: if (rreq) { 186: branch 0 never executed 187: branch 1 never executed 188: #####: 158: if (s != MPI_STATUS_IGNORE) { 190: branch 1 never executed 191: -: 159: /* Avoid setting "extra" fields like MPI_ERROR */ 192: #####: 160: s->MPI_SOURCE = rreq->status.MPI_SOURCE; 193: #####: 161: s->MPI_TAG = rreq->status.MPI_TAG; 194: #####: 162: s->count = rreq->status.count; 195: #####: 163: s->cancelled = rreq->status.cancelled; 196: -: 164: } 197: #####: 165: found = 1; 199: -: 166: } 200: -: 167: 201: #####: 169: return found; 221: -: 189: MPIDI_Message_match * match) 222: function MPIDI_CH3U_Recvq_FDU called 0 returned 0% blocks executed 0% 223: #####: 190:{ 231: -: 198: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FDU); 232: -: 199: 233: #####: 200: matching_prev_rreq = NULL; 234: #####: 201: matching_cur_rreq = NULL; 235: #####: 202: prev_rreq = NULL; 238: -: 205: there can be only one match if at all. */ 239: -: 206: /* FIXME: Why doesn't this exit after it finds the first match? */ 240: #####: 207: cur_rreq = recvq_unexpected_head; 241: #####: 208: while (cur_rreq != NULL) { 242: branch 0 never executed 243: branch 1 never executed 244: #####: 209: if (cur_rreq->dev.sender_req_id == sreq_id && 252: branch 7 never executed 253: -: 210: (MATCH_WITH_NO_MASK(cur_rreq->dev.match, *match))) { 254: #####: 211: matching_prev_rreq = prev_rreq; 255: #####: 212: matching_cur_rreq = cur_rreq; 256: -: 213: } 257: #####: 214: prev_rreq = cur_rreq; 258: #####: 215: cur_rreq = cur_rreq->dev.next; 259: -: 216: } 260: -: 217: 261: #####: 218: if (matching_cur_rreq != NULL) { 262: branch 0 never executed 263: branch 1 never executed 264: #####: 219: if (matching_prev_rreq != NULL) { 265: branch 0 never executed 266: branch 1 never executed 267: #####: 220: matching_prev_rreq->dev.next = matching_cur_rreq->dev.next; 268: -: 221: } 269: -: 222: else { 270: #####: 223: recvq_unexpected_head = matching_cur_rreq->dev.next; 271: -: 224: } 272: -: 225: 273: #####: 226: if (matching_cur_rreq->dev.next == NULL) { 274: branch 0 never executed 275: branch 1 never executed 276: #####: 227: recvq_unexpected_tail = matching_prev_rreq; 277: -: 228: } 278: -: 229: 279: #####: 230: rreq = matching_cur_rreq; 280: -: 231: } 281: -: 232: else { 282: #####: 233: rreq = NULL; 284: -: 234: } 285: -: 235: 286: #####: 237: return rreq; 310: -: 261: int user_count, MPI_Datatype datatype, int * foundp) 311: function MPIDI_CH3U_Recvq_FDU_or_AEP called 0 returned 0% blocks executed 0% 312: #####: 262:{ 320: -: 270: 321: -: 271: /* Optimize this loop for an empty unexpected receive queue */ 322: #####: 272: rreq = recvq_unexpected_head; 323: #####: 273: if (rreq) { 324: branch 0 never executed 325: branch 1 never executed 326: #####: 274: prev_rreq = NULL; 327: -: 275: 328: #####: 276: match.parts.context_id = context_id; 329: #####: 277: match.parts.tag = tag; 330: #####: 278: match.parts.rank = source; 331: -: 279: 332: #####: 280: if (tag != MPI_ANY_TAG && source != MPI_ANY_SOURCE) { 334: branch 1 never executed 335: -: 281: do { 336: #####: 282: if (MATCH_WITH_NO_MASK(rreq->dev.match, match)) { 341: branch 4 never executed 342: branch 5 never executed 343: #####: 283: if (prev_rreq != NULL) { 344: branch 0 never executed 345: branch 1 never executed 346: #####: 284: prev_rreq->dev.next = rreq->dev.next; 347: -: 285: } 348: -: 286: else { 349: #####: 287: recvq_unexpected_head = rreq->dev.next; 350: -: 288: } 351: -: 289: 352: #####: 290: if (rreq->dev.next == NULL) { 353: branch 0 never executed 354: branch 1 never executed 355: #####: 291: recvq_unexpected_tail = prev_rreq; 356: -: 292: } 357: -: 293: 358: #####: 294: rreq->comm = comm; 359: #####: 295: MPIR_Comm_add_ref(comm); 362: call 2 never executed 363: call 3 never executed 364: #####: 296: rreq->dev.user_buf = user_buf; 365: #####: 297: rreq->dev.user_count = user_count; 366: #####: 298: rreq->dev.datatype = datatype; 367: #####: 299: found = TRUE; 368: #####: 300: goto lock_exit; 369: -: 301: } 370: #####: 302: prev_rreq = rreq; 371: #####: 303: rreq = rreq->dev.next; 372: #####: 304: } while (rreq); 375: -: 305: } 376: -: 306: else { 377: #####: 307: mask.parts.context_id = mask.parts.rank = mask.parts.tag = ~0; 378: #####: 308: if (tag == MPI_ANY_TAG) 379: branch 0 never executed 380: branch 1 never executed 381: #####: 309: match.parts.tag = mask.parts.tag = 0; 382: #####: 310: if (source == MPI_ANY_SOURCE) 383: branch 0 never executed 384: branch 1 never executed 385: #####: 311: match.parts.rank = mask.parts.rank = 0; 386: -: 312: 387: -: 313: do { 388: #####: 314: if (MATCH_WITH_LEFT_MASK(rreq->dev.match, match, mask)) { 393: branch 4 never executed 394: branch 5 never executed 395: #####: 315: if (prev_rreq != NULL) { 396: branch 0 never executed 397: branch 1 never executed 398: #####: 316: prev_rreq->dev.next = rreq->dev.next; 399: -: 317: } 400: -: 318: else { 401: #####: 319: recvq_unexpected_head = rreq->dev.next; 402: -: 320: } 403: #####: 321: if (rreq->dev.next == NULL) { 404: branch 0 never executed 405: branch 1 never executed 406: #####: 322: recvq_unexpected_tail = prev_rreq; 407: -: 323: } 408: #####: 324: rreq->comm = comm; 409: #####: 325: MPIR_Comm_add_ref(comm); 412: call 2 never executed 413: call 3 never executed 414: #####: 326: rreq->dev.user_buf = user_buf; 415: #####: 327: rreq->dev.user_count = user_count; 416: #####: 328: rreq->dev.datatype = datatype; 417: #####: 329: found = TRUE; 418: #####: 330: goto lock_exit; 419: -: 331: } 420: #####: 332: prev_rreq = rreq; 421: #####: 333: rreq = rreq->dev.next; 422: #####: 334: } while (rreq); 429: -: 339: need to allocate a new request and add it to the posted queue */ 430: -: 340: { 431: #####: 341: int mpi_errno=0; 432: #####: 342: MPIDI_Request_create_rreq( rreq, mpi_errno, 435: branch 2 never executed 436: -: 343: found = FALSE;goto lock_exit ); 437: #####: 344: rreq->dev.match.parts.tag = tag; 438: #####: 345: rreq->dev.match.parts.rank = source; 439: #####: 346: rreq->dev.match.parts.context_id = context_id; 441: -: 348: /* Added a mask for faster search on 64-bit capable 442: -: 349: * platforms */ 443: #####: 350: rreq->dev.mask.parts.context_id = ~0; 444: #####: 351: if (rreq->dev.match.parts.rank == MPI_ANY_SOURCE) 445: branch 0 never executed 446: branch 1 never executed 447: #####: 352: rreq->dev.mask.parts.rank = 0; 448: -: 353: else 449: #####: 354: rreq->dev.mask.parts.rank = ~0; 450: #####: 355: if (rreq->dev.match.parts.tag == MPI_ANY_TAG) 451: branch 0 never executed 452: branch 1 never executed 453: #####: 356: rreq->dev.mask.parts.tag = 0; 454: -: 357: else 455: #####: 358: rreq->dev.mask.parts.tag = ~0; 456: -: 359: 457: #####: 360: rreq->comm = comm; 458: #####: 361: MPIR_Comm_add_ref(comm); 461: call 2 never executed 462: call 3 never executed 463: #####: 362: rreq->dev.user_buf = user_buf; 464: #####: 363: rreq->dev.user_count = user_count; 465: #####: 364: rreq->dev.datatype = datatype; 466: #####: 365: rreq->dev.next = NULL; 467: #####: 366: if (recvq_posted_tail != NULL) { 468: branch 0 never executed 469: branch 1 never executed 470: #####: 367: recvq_posted_tail->dev.next = rreq; 471: -: 368: } 472: -: 369: else { 473: #####: 370: recvq_posted_head = rreq; 474: -: 371: } 475: #####: 372: recvq_posted_tail = rreq; 477: -: 374: } 478: -: 375: 479: #####: 376: found = FALSE; 480: -: 377: 481: #####: 378: lock_exit: 482: -: 379: 483: #####: 380: *foundp = found; 484: #####: 380: *foundp = found; 485: -: 381: 486: #####: 383: return rreq; 502: -: 399:int MPIDI_CH3U_Recvq_DP(MPID_Request * rreq) 503: function MPIDI_CH3U_Recvq_DP called 0 returned 0% blocks executed 0% 504: #####: 400:{ 511: -: 407: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_DP); 512: -: 408: 513: #####: 409: found = FALSE; 514: #####: 410: prev_rreq = NULL; 515: -: 411: 516: -: 412: MPIU_THREAD_CS_ENTER(MSGQUEUE,); 517: #####: 413: cur_rreq = recvq_posted_head; 518: #####: 414: while (cur_rreq != NULL) { 519: branch 0 never executed 520: branch 1 never executed 521: #####: 415: if (cur_rreq == rreq) { 522: branch 0 never executed 523: branch 1 never executed 524: #####: 416: if (prev_rreq != NULL) { 525: branch 0 never executed 526: branch 1 never executed 527: #####: 417: prev_rreq->dev.next = cur_rreq->dev.next; 528: -: 418: } 529: -: 419: else { 530: #####: 420: recvq_posted_head = cur_rreq->dev.next; 531: -: 421: } 532: #####: 422: if (cur_rreq->dev.next == NULL) { 533: branch 0 never executed 534: branch 1 never executed 535: #####: 423: recvq_posted_tail = prev_rreq; 537: -: 425: /* Notify channel that rreq has been dequeued and check if 538: -: 426: it has already matched rreq, fail if so */ 539: #####: 427: dequeue_failed = MPIDI_POSTED_RECV_DEQUEUE_HOOK(rreq); 540: #####: 428: if (!dequeue_failed) 541: branch 0 never executed 542: branch 1 never executed 543: #####: 429: found = TRUE; 545: -: 431: } 546: -: 432: 547: #####: 433: prev_rreq = cur_rreq; 548: #####: 434: cur_rreq = cur_rreq->dev.next; 552: -: 437: MPIU_THREAD_CS_EXIT(MSGQUEUE,); 553: -: 438: 554: #####: 440: return found; 581: -: 467: int * foundp) 582: function MPIDI_CH3U_Recvq_FDP_or_AEU called 0 returned 0% blocks executed 0% 583: #####: 468:{ 590: -: 475: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_RECVQ_FDP_OR_AEU); 591: -: 476: 592: #####: 477: top_loop: 593: #####: 478: prev_rreq = NULL; 594: -: 479: 595: #####: 480: rreq = recvq_posted_head; 596: -: 481: 597: #####: 482: while (rreq != NULL) { 598: branch 0 never executed 599: branch 1 never executed 600: #####: 483: if (MATCH_WITH_LEFT_RIGHT_MASK(rreq->dev.match, *match, rreq->dev.mask)) { 605: branch 4 never executed 606: branch 5 never executed 607: #####: 484: if (prev_rreq != NULL) { 608: branch 0 never executed 609: branch 1 never executed 610: #####: 485: prev_rreq->dev.next = rreq->dev.next; 611: -: 486: } 612: -: 487: else { 613: #####: 488: recvq_posted_head = rreq->dev.next; 614: -: 489: } 615: #####: 490: if (rreq->dev.next == NULL) { 616: branch 0 never executed 617: branch 1 never executed 618: #####: 491: recvq_posted_tail = prev_rreq; 620: -: 493: 621: -: 494: /* give channel a chance to match the request, try again if so */ 622: #####: 495: channel_matched = MPIDI_POSTED_RECV_DEQUEUE_HOOK(rreq); 623: #####: 496: if (channel_matched) 624: branch 0 never executed 625: branch 1 never executed 626: #####: 497: goto top_loop; 627: -: 498: 628: #####: 499: found = TRUE; 629: #####: 500: goto lock_exit; 630: -: 501: } 631: #####: 502: prev_rreq = rreq; 632: #####: 503: rreq = rreq->dev.next; 636: -: 507: need to allocate a new request and add it to the unexpected queue */ 637: -: 508: { 638: #####: 509: int mpi_errno=0; 639: #####: 510: MPIDI_Request_create_rreq( rreq, mpi_errno, 642: branch 2 never executed 643: -: 511: found=FALSE;goto lock_exit ); 644: #####: 512: rreq->dev.recv_pending_count = 1; 645: #####: 513: rreq->dev.match = *match; 646: #####: 514: rreq->dev.next = NULL; 647: #####: 515: if (recvq_unexpected_tail != NULL) { 648: branch 0 never executed 649: branch 1 never executed 650: #####: 516: recvq_unexpected_tail->dev.next = rreq; 651: -: 517: } 652: -: 518: else { 653: #####: 519: recvq_unexpected_head = rreq; 654: -: 520: } 655: #####: 521: recvq_unexpected_tail = rreq; 656: -: 522: } 657: -: 523: 658: #####: 524: found = FALSE; 659: -: 525: 660: #####: 526: lock_exit: 661: -: 527: 662: #####: 528: *foundp = found; 663: #####: 528: *foundp = found; 664: -: 529: 665: #####: 531: return rreq; 790: -: 622:int MPIDI_CH3U_Recvq_count_unexp(void) 791: function MPIDI_CH3U_Recvq_count_unexp called 0 returned 0% blocks executed 0% 792: #####: 623:{ 793: #####: 624: int count = 0; 794: #####: 625: MPID_Request *req = recvq_unexpected_head; 795: -: 626: 796: #####: 627: while (req) 798: branch 1 never executed 799: -: 628: { 800: #####: 629: ++count; 801: #####: 630: req = req->dev.next; 802: -: 631: } 803: -: 632: 804: #####: 633: return count; 174 line(s) not covered by tests in src/mpid/ch3/src/ch3u_recvq.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_request.c.gcov 40: -: 35:MPID_Request * MPID_Request_create(void) 41: function MPID_Request_create called 0 returned 0% blocks executed 0% 42: #####: 36:{ 46: -: 40: MPIDI_FUNC_ENTER(MPID_STATE_MPID_REQUEST_CREATE); 47: -: 41: 48: #####: 42: req = MPIU_Handle_obj_alloc(&MPID_Request_mem); 49: call 0 never executed 50: #####: 43: if (req != NULL) 70: -: 61: *really* want to set the kind to UNDEFINED? And should the RMA 71: -: 62: values be set only for RMA requests? */ 72: #####: 63: MPIU_Object_set_ref(req, 1); 73: #####: 64: req->kind = MPID_REQUEST_UNDEFINED; 74: #####: 65: req->cc = 1; 75: #####: 66: req->cc_ptr = &req->cc; 76: -: 67: /* FIXME: status fields meaningful only for receive, and even then 77: -: 68: should not need to be set. */ 78: #####: 69: req->status.MPI_SOURCE = MPI_UNDEFINED; 79: #####: 70: req->status.MPI_TAG = MPI_UNDEFINED; 80: #####: 71: req->status.MPI_ERROR = MPI_SUCCESS; 81: #####: 72: req->status.count = 0; 82: #####: 73: req->status.cancelled = FALSE; 83: #####: 74: req->comm = NULL; 84: #####: 75: req->dev.datatype_ptr = NULL; 85: #####: 76: req->dev.segment_ptr = NULL; 86: -: 77: /* Masks and flags for channel device state in an MPID_Request */ 87: #####: 78: req->dev.state = 0; 88: #####: 79: req->dev.cancel_pending = FALSE; 89: -: 80: /* FIXME: RMA ops shouldn't need to be set except when creating a 90: -: 81: request for RMA operations */ 91: #####: 82: req->dev.target_win_handle = MPI_WIN_NULL; 92: #####: 83: req->dev.source_win_handle = MPI_WIN_NULL; 93: #####: 84: req->dev.single_op_opt = 0; 94: #####: 85: req->dev.lock_queue_entry = NULL; 95: #####: 86: req->dev.dtype_info = NULL; 96: #####: 87: req->dev.dataloop = NULL; 97: #####: 88: req->dev.iov_offset = 0; 111: -: 101: } 112: -: 102: 113: #####: 104: return req; 124: -: 115:void MPIDI_CH3_Request_destroy(MPID_Request * req) 125: function MPIDI_CH3_Request_destroy called 0 returned 0% blocks executed 0% 126: #####: 116:{ 156: -: 146: /* FIXME: We need a way to call these routines ONLY when the 157: -: 147: related ref count has become zero. */ 158: #####: 148: if (req->comm != NULL) { 159: branch 0 never executed 160: branch 1 never executed 161: #####: 149: MPIR_Comm_release(req->comm, 0); 163: -: 150: } 164: -: 151: 165: #####: 152: if (req->dev.datatype_ptr != NULL) { 166: branch 0 never executed 167: branch 1 never executed 168: #####: 153: MPID_Datatype_release(req->dev.datatype_ptr); 183: -: 154: } 184: -: 155: 185: #####: 156: if (req->dev.segment_ptr != NULL) { 186: branch 0 never executed 187: branch 1 never executed 188: #####: 157: MPID_Segment_free(req->dev.segment_ptr); 190: -: 158: } 191: -: 159: 192: #####: 160: if (MPIDI_Request_get_srbuf_flag(req)) { 193: branch 0 never executed 194: branch 1 never executed 195: #####: 161: MPIDI_CH3U_SRBuf_free(req); 200: -: 162: } 201: -: 163: 202: #####: 164: MPIU_Handle_obj_free(&MPID_Request_mem, req); 230: -: 191: MPID_IOV * const iov, int * const iov_n) 231: function MPIDI_CH3U_Request_load_send_iov called 0 returned 0% blocks executed 0% 232: #####: 192:{ 233: -: 193: MPI_Aint last; 234: #####: 194: int mpi_errno = MPI_SUCCESS; 236: -: 196: 237: -: 197: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_REQUEST_LOAD_SEND_IOV); 238: #####: 198: MPIU_Assert(sreq->dev.segment_ptr != NULL); 241: call 2 never executed 242: call 3 never executed 243: #####: 199: last = sreq->dev.segment_size; 245: -: 201: "pre-pv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d", 246: -: 202: sreq->dev.segment_first, last, *iov_n)); 247: #####: 203: MPIU_Assert(sreq->dev.segment_first < last); 250: call 2 never executed 251: call 3 never executed 252: #####: 204: MPIU_Assert(last > 0); 255: call 2 never executed 256: call 3 never executed 257: #####: 205: MPIU_Assert(*iov_n > 0 && *iov_n <= MPID_IOV_LIMIT); 260: call 2 never executed 261: call 3 never executed 262: #####: 206: MPID_Segment_pack_vector(sreq->dev.segment_ptr, sreq->dev.segment_first, 266: -: 209: "post-pv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d", 267: -: 210: sreq->dev.segment_first, last, *iov_n)); 268: #####: 211: MPIU_Assert(*iov_n > 0 && *iov_n <= MPID_IOV_LIMIT); 272: call 3 never executed 273: -: 212: 274: #####: 213: if (last == sreq->dev.segment_size) 277: -: 214: { 278: -: 215: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"remaining data loaded into IOV"); 279: #####: 216: sreq->dev.OnDataAvail = sreq->dev.OnFinal; 280: -: 217: } 281: #####: 218: else if ((last - sreq->dev.segment_first) / *iov_n >= MPIDI_IOV_DENSITY_MIN) 284: -: 219: { 285: -: 220: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"more data loaded into IOV"); 286: #####: 221: sreq->dev.segment_first = last; 287: #####: 222: sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SendReloadIOV; 294: -: 229: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"low density. using SRBuf."); 295: -: 230: 296: #####: 231: data_sz = sreq->dev.segment_size - sreq->dev.segment_first; 297: #####: 232: if (!MPIDI_Request_get_srbuf_flag(sreq)) 299: branch 1 never executed 300: -: 233: { 301: #####: 234: MPIDI_CH3U_SRBuf_alloc(sreq, data_sz); 320: -: 245: } 321: -: 246: 322: #####: 247: iov_data_copied = 0; 323: #####: 248: for (i = 0; i < *iov_n; i++) { 324: branch 0 never executed 325: branch 1 never executed 326: #####: 249: MPIU_Memcpy((char*) sreq->dev.tmpbuf + iov_data_copied, 351: call 24 never executed 352: -: 250: iov[i].MPID_IOV_BUF, iov[i].MPID_IOV_LEN); 353: #####: 251: iov_data_copied += iov[i].MPID_IOV_LEN; 354: -: 252: } 355: #####: 253: sreq->dev.segment_first = last; 356: -: 254: 357: #####: 255: last = (data_sz <= sreq->dev.tmpbuf_sz - iov_data_copied) ? 363: -: 259: "pre-pack: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 364: -: 260: sreq->dev.segment_first, last)); 365: #####: 261: MPID_Segment_pack(sreq->dev.segment_ptr, sreq->dev.segment_first, 369: -: 264: "post-pack: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT, 370: -: 265: sreq->dev.segment_first, last)); 371: #####: 266: iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)sreq->dev.tmpbuf; 372: #####: 267: iov[0].MPID_IOV_LEN = last - sreq->dev.segment_first + iov_data_copied; 373: #####: 268: *iov_n = 1; 374: #####: 269: if (last == sreq->dev.segment_size) 377: -: 270: { 378: -: 271: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"remaining data packed into SRBuf"); 379: #####: 272: sreq->dev.OnDataAvail = sreq->dev.OnFinal; 382: -: 275: { 383: -: 276: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE,"more data packed into SRBuf"); 384: #####: 277: sreq->dev.segment_first = last; 385: #####: 278: sreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_SendReloadIOV; 387: -: 280: } 388: -: 281: 389: #####: 282: fn_exit: 390: #####: 282: fn_exit: 391: #####: 284: return mpi_errno; 406: -: 299:int MPIDI_CH3U_Request_load_recv_iov(MPID_Request * const rreq) 407: function MPIDI_CH3U_Request_load_recv_iov called 0 returned 0% blocks executed 0% 408: #####: 300:{ 409: -: 301: MPI_Aint last; 410: #####: 302: int mpi_errno = MPI_SUCCESS; 412: -: 304: 413: -: 305: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_REQUEST_LOAD_RECV_IOV); 414: #####: 306: if (rreq->dev.segment_first < rreq->dev.segment_size) 418: -: 308: /* still reading data that needs to go into the user buffer */ 419: -: 309: 420: #####: 310: if (MPIDI_Request_get_srbuf_flag(rreq)) 432: -: 320: when (rreq->dev.tmpbuf_off > 0)... */ 433: -: 321: 434: #####: 322: data_sz = rreq->dev.segment_size - rreq->dev.segment_first - 435: -: 323: rreq->dev.tmpbuf_off; 436: #####: 324: MPIU_Assert(data_sz > 0); 439: call 2 never executed 440: call 3 never executed 441: #####: 325: tmpbuf_sz = rreq->dev.tmpbuf_sz - rreq->dev.tmpbuf_off; 442: #####: 326: if (data_sz > tmpbuf_sz) 444: branch 1 never executed 445: -: 327: { 446: #####: 328: data_sz = tmpbuf_sz; 447: -: 329: } 448: #####: 330: rreq->dev.iov[0].MPID_IOV_BUF = 449: -: 331: (MPID_IOV_BUF_CAST)((char *) rreq->dev.tmpbuf + 450: -: 332: rreq->dev.tmpbuf_off); 451: #####: 333: rreq->dev.iov[0].MPID_IOV_LEN = data_sz; 452: #####: 334: rreq->dev.iov_offset = 0; 453: #####: 335: rreq->dev.iov_count = 1; 454: #####: 336: MPIU_Assert(rreq->dev.segment_first + data_sz + 458: call 3 never executed 459: -: 337: rreq->dev.tmpbuf_off <= rreq->dev.recv_data_sz); 460: #####: 338: if (rreq->dev.segment_first + data_sz + rreq->dev.tmpbuf_off == 465: -: 341: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE, 466: -: 342: "updating rreq to read the remaining data into the SRBuf"); 467: #####: 343: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackSRBufComplete; 471: -: 347: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE, 472: -: 348: "updating rreq to read more data into the SRBuf"); 473: #####: 349: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_UnpackSRBufReloadIOV; 476: -: 352: } 477: -: 353: 478: #####: 354: last = rreq->dev.segment_size; 479: #####: 355: rreq->dev.iov_count = MPID_IOV_LIMIT; 480: #####: 356: rreq->dev.iov_offset = 0; 482: -: 358: "pre-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d", 483: -: 359: rreq->dev.segment_first, last, rreq->dev.iov_count)); 484: #####: 360: MPIU_Assert(rreq->dev.segment_first < last); 487: call 2 never executed 488: call 3 never executed 489: #####: 361: MPIU_Assert(last > 0); 492: call 2 never executed 493: call 3 never executed 494: #####: 362: MPID_Segment_unpack_vector(rreq->dev.segment_ptr, 499: -: 366: "post-upv: first=" MPIDI_MSG_SZ_FMT ", last=" MPIDI_MSG_SZ_FMT ", iov_n=%d, iov_offset=%d", 500: -: 367: rreq->dev.segment_first, last, rreq->dev.iov_count, rreq->dev.iov_offset)); 501: #####: 368: MPIU_Assert(rreq->dev.iov_count >= 0 && rreq->dev.iov_count <= 535: -: 370: 536: -: 391: 537: #####: 392: if (last == rreq->dev.recv_data_sz) 542: -: 395: "updating rreq to read the remaining data directly into the user buffer"); 543: -: 396: /* Eventually, use OnFinal for this instead */ 544: #####: 397: rreq->dev.OnDataAvail = 0; 545: -: 398: } 546: #####: 399: else if (last == rreq->dev.segment_size || 553: -: 402: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE, 554: -: 403: "updating rreq to read more data directly into the user buffer"); 555: #####: 404: rreq->dev.segment_first = last; 556: #####: 405: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_ReloadIOV; 561: -: 410: We will start receiving data into a SRBuf and unpacking it 562: -: 411: later. */ 563: #####: 412: MPIU_Assert(MPIDI_Request_get_srbuf_flag(rreq) == FALSE); 567: call 3 never executed 568: -: 413: 569: #####: 414: MPIDI_CH3U_SRBuf_alloc(rreq, 574: branch 4 never executed 575: -: 415: rreq->dev.segment_size - rreq->dev.segment_first); 576: #####: 416: rreq->dev.tmpbuf_off = 0; 593: -: 430: 594: -: 431: /* fill in the IOV using a recursive call */ 595: #####: 432: mpi_errno = MPIDI_CH3U_Request_load_recv_iov(rreq); 603: -: 439: MPIDI_msg_sz_t data_sz; 604: -: 440: 605: #####: 441: data_sz = rreq->dev.recv_data_sz - rreq->dev.segment_first; 606: #####: 442: if (!MPIDI_Request_get_srbuf_flag(rreq)) 608: branch 1 never executed 609: -: 443: { 610: #####: 444: MPIDI_CH3U_SRBuf_alloc(rreq, data_sz); 629: -: 455: } 630: -: 456: 631: #####: 457: if (data_sz <= rreq->dev.tmpbuf_sz) 635: -: 459: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE, 636: -: 460: "updating rreq to read overflow data into the SRBuf and complete"); 637: #####: 461: rreq->dev.iov[0].MPID_IOV_LEN = data_sz; 638: #####: 462: MPIU_Assert(MPIDI_Request_get_type(rreq) == MPIDI_REQUEST_TYPE_RECV); 642: call 3 never executed 643: -: 463: /* Eventually, use OnFinal for this instead */ 644: #####: 464: rreq->dev.OnDataAvail = 0; 648: -: 468: MPIU_DBG_MSG(CH3_CHANNEL,VERBOSE, 649: -: 469: "updating rreq to read overflow data into the SRBuf and reload IOV"); 650: #####: 470: rreq->dev.iov[0].MPID_IOV_LEN = rreq->dev.tmpbuf_sz; 651: #####: 471: rreq->dev.segment_first += rreq->dev.tmpbuf_sz; 652: #####: 472: rreq->dev.OnDataAvail = MPIDI_CH3_ReqHandler_ReloadIOV; 653: -: 473: } 654: -: 474: 655: #####: 475: rreq->dev.iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rreq->dev.tmpbuf; 656: #####: 476: rreq->dev.iov_count = 1; 657: -: 477: } 658: -: 478: 659: #####: 479: fn_exit: 660: #####: 479: fn_exit: 661: #####: 481: return mpi_errno; 673: -: 493:int MPIDI_CH3U_Request_unpack_srbuf(MPID_Request * rreq) 674: function MPIDI_CH3U_Request_unpack_srbuf called 0 returned 0% blocks executed 0% 675: #####: 494:{ 676: -: 495: MPI_Aint last; 677: -: 496: int tmpbuf_last; 678: #####: 497: int mpi_errno = MPI_SUCCESS; 681: -: 500: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_REQUEST_UNPACK_SRBUF); 682: -: 501: 683: #####: 502: tmpbuf_last = (int)(rreq->dev.segment_first + rreq->dev.tmpbuf_sz); 684: #####: 503: if (rreq->dev.segment_size < tmpbuf_last) 686: branch 1 never executed 687: -: 504: { 688: #####: 505: tmpbuf_last = (int)rreq->dev.segment_size; 689: -: 506: } 690: #####: 507: last = tmpbuf_last; 691: #####: 508: MPID_Segment_unpack(rreq->dev.segment_ptr, rreq->dev.segment_first, 692: call 0 never executed 693: -: 509: &last, rreq->dev.tmpbuf); 694: #####: 510: if (last == 0 || last == rreq->dev.segment_first) 711: -: 511: { 712: -: 523: } 713: #####: 524: else if (tmpbuf_last == rreq->dev.segment_size) 737: -: 543: else 738: -: 544: { 739: #####: 545: rreq->dev.tmpbuf_off = (int)(tmpbuf_last - last); 740: #####: 546: if (rreq->dev.tmpbuf_off > 0) 745: -: 549: Note: memmove() is used since the data regions could 746: -: 550: overlap. */ 747: #####: 551: memmove(rreq->dev.tmpbuf, (char *) rreq->dev.tmpbuf + 749: -: 552: (last - rreq->dev.segment_first), rreq->dev.tmpbuf_off); 750: -: 553: } 751: #####: 554: rreq->dev.segment_first = last; 753: -: 555: } 754: -: 556: 755: #####: 558: return mpi_errno; 767: -: 570:int MPIDI_CH3U_Request_unpack_uebuf(MPID_Request * rreq) 768: function MPIDI_CH3U_Request_unpack_uebuf called 0 returned 0% blocks executed 0% 769: #####: 571:{ 773: -: 575: MPID_Datatype * dt_ptr; 774: -: 576: MPIDI_msg_sz_t unpack_sz; 775: #####: 577: int mpi_errno = MPI_SUCCESS; 779: -: 581: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_CH3U_REQUEST_UNPACK_UEBUF); 780: -: 582: 781: #####: 583: MPIDI_Datatype_get_info(rreq->dev.user_count, rreq->dev.datatype, 789: -: 584: dt_contig, userbuf_sz, dt_ptr, dt_true_lb); 790: -: 585: 791: #####: 586: if (rreq->dev.recv_data_sz <= userbuf_sz) 793: branch 1 never executed 794: -: 587: { 795: #####: 588: unpack_sz = rreq->dev.recv_data_sz; 812: -: 604: } 813: -: 605: 814: #####: 606: if (unpack_sz > 0) 816: branch 1 never executed 817: -: 607: { 818: #####: 608: if (dt_contig) 825: -: 613: (unless configured with --enable-fast) */ 826: -: 614: MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY); 827: #####: 615: MPIU_Memcpy((char *)rreq->dev.user_buf + dt_true_lb, rreq->dev.tmpbuf, 859: -: 622: MPI_Aint last; 860: -: 623: 861: #####: 624: MPID_Segment_init(rreq->dev.user_buf, rreq->dev.user_count, 862: call 0 never executed 863: -: 625: rreq->dev.datatype, &seg, 0); 864: #####: 626: last = unpack_sz; 865: #####: 627: MPID_Segment_unpack(&seg, 0, &last, rreq->dev.tmpbuf); 866: call 0 never executed 867: #####: 628: if (last != unpack_sz) 884: -: 641: } 885: -: 642: 886: #####: 644: return mpi_errno; 893: -: 651:void MPID_Request_set_completed( MPID_Request *req ) 894: function MPID_Request_set_completed called 0 returned 0% blocks executed 0% 895: #####: 652:{ 896: #####: 653: MPID_REQUEST_SET_COMPLETED(req); 144 line(s) not covered by tests in src/mpid/ch3/src/ch3u_request.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_rma_ops.c.gcov 24: -: 19: MPID_Comm *comm_ptr, MPID_Win **win_ptr ) 25: function MPIDI_Win_create called 0 returned 0% blocks executed 0% 26: #####: 20:{ 27: #####: 21: int mpi_errno=MPI_SUCCESS, i, comm_size, rank; 28: -: 22: MPI_Aint *tmp_buf; 29: #####: 23: MPIU_CHKPMEM_DECL(4); 30: #####: 24: MPIU_CHKLMEM_DECL(1); 39: -: 33: MPIU_THREADPRIV_GET; 40: -: 34: 41: #####: 35: MPIR_Nest_incr(); 42: -: 36: 43: #####: 37: comm_size = comm_ptr->local_size; 44: #####: 38: rank = comm_ptr->rank; 45: -: 39: 46: #####: 40: *win_ptr = (MPID_Win *)MPIU_Handle_obj_alloc( &MPID_Win_mem ); 47: call 0 never executed 48: #####: 41: MPIU_ERR_CHKANDJUMP(!(*win_ptr),mpi_errno,MPI_ERR_OTHER,"**nomem"); 51: call 2 never executed 52: -: 42: 53: #####: 43: MPIU_Object_set_ref(*win_ptr, 1); 54: -: 44: 55: #####: 45: (*win_ptr)->fence_cnt = 0; 56: #####: 46: (*win_ptr)->base = base; 57: #####: 47: (*win_ptr)->size = size; 58: #####: 48: (*win_ptr)->disp_unit = disp_unit; 59: #####: 49: (*win_ptr)->start_group_ptr = NULL; 60: #####: 50: (*win_ptr)->start_assert = 0; 61: #####: 51: (*win_ptr)->attributes = NULL; 62: #####: 52: (*win_ptr)->rma_ops_list = NULL; 63: #####: 53: (*win_ptr)->lock_granted = 0; 64: #####: 54: (*win_ptr)->current_lock_type = MPID_LOCK_NONE; 65: #####: 55: (*win_ptr)->shared_lock_ref_cnt = 0; 66: #####: 56: (*win_ptr)->lock_queue = NULL; 67: #####: 57: (*win_ptr)->my_counter = 0; 68: #####: 58: (*win_ptr)->my_pt_rma_puts_accs = 0; 69: -: 59: 70: #####: 60: mpi_errno = NMPI_Comm_dup(comm_ptr->handle, &((*win_ptr)->comm)); 77: -: 63: /* allocate memory for the base addresses, disp_units, and 78: -: 64: completion counters of all processes */ 79: #####: 65: MPIU_CHKPMEM_MALLOC((*win_ptr)->base_addrs, void **, 91: -: 67: mpi_errno, "(*win_ptr)->base_addrs"); 92: -: 68: 93: #####: 69: MPIU_CHKPMEM_MALLOC((*win_ptr)->disp_units, int *, comm_size*sizeof(int), 104: -: 70: mpi_errno, "(*win_ptr)->disp_units"); 105: -: 71: 106: #####: 72: MPIU_CHKPMEM_MALLOC((*win_ptr)->all_win_handles, MPI_Win *, 118: -: 74: mpi_errno, "(*win_ptr)->all_win_handles"); 119: -: 75: 120: #####: 76: MPIU_CHKPMEM_MALLOC((*win_ptr)->pt_rma_puts_accs, int *, 131: -: 77: comm_size*sizeof(int), 132: -: 78: mpi_errno, "(*win_ptr)->pt_rma_puts_accs"); 133: #####: 79: for (i=0; ipt_rma_puts_accs[i] = 0; 137: -: 81: /* get the addresses of the windows, window objects, and completion 138: -: 82: counters of all processes. allocate temp. buffer for communication */ 139: #####: 83: MPIU_CHKLMEM_MALLOC(tmp_buf, MPI_Aint *, 3*comm_size*sizeof(MPI_Aint), 151: -: 85: 152: -: 86: /* FIXME: This needs to be fixed for heterogeneous systems */ 153: #####: 87: tmp_buf[3*rank] = MPIU_PtrToAint(base); 154: #####: 88: tmp_buf[3*rank+1] = (MPI_Aint) disp_unit; 155: #####: 89: tmp_buf[3*rank+2] = (MPI_Aint) (*win_ptr)->handle; 156: -: 90: 157: #####: 91: mpi_errno = NMPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, 164: call 2 never executed 165: -: 95: 166: #####: 96: for (i=0; ibase_addrs[i] = MPIU_AintToPtr(tmp_buf[3*i]); 171: #####: 99: (*win_ptr)->disp_units[i] = (int) tmp_buf[3*i+1]; 172: #####: 100: (*win_ptr)->all_win_handles[i] = (MPI_Win) tmp_buf[3*i+2]; 173: -: 101: } 174: -: 102: 175: #####: 103: fn_exit: 176: #####: 104: MPIR_Nest_decr(); 177: #####: 105: MPIU_CHKLMEM_FREEALL(); 180: branch 1 never executed 181: branch 2 never executed 182: #####: 107: return mpi_errno; 200: -: 122:int MPIDI_Win_free(MPID_Win **win_ptr) 201: function MPIDI_Win_free called 0 returned 0% blocks executed 0% 202: #####: 123:{ 203: #####: 124: int mpi_errno=MPI_SUCCESS, total_pt_rma_puts_accs, i, *recvcnts, comm_size; 204: -: 125: MPID_Comm *comm_ptr; 205: -: 126: int in_use; 206: #####: 127: MPIU_CHKLMEM_DECL(1); 212: -: 133: 213: -: 134: MPIU_THREADPRIV_GET; 214: #####: 135: MPIR_Nest_incr(); 216: -: 137: /* set up the recvcnts array for the reduce scatter to check if all 217: -: 138: passive target rma operations are done */ 218: #####: 139: MPID_Comm_get_ptr( (*win_ptr)->comm, comm_ptr ); 222: branch 3 never executed 223: call 4 never executed 224: #####: 140: comm_size = comm_ptr->local_size; 225: -: 141: 226: #####: 142: MPIU_CHKLMEM_MALLOC(recvcnts, int *, comm_size*sizeof(int), mpi_errno, 236: call 9 never executed 237: -: 143: "recvcnts"); 238: #####: 144: for (i=0; ipt_rma_puts_accs, 249: call 2 never executed 250: -: 150: 251: #####: 151: if (total_pt_rma_puts_accs != (*win_ptr)->my_pt_rma_puts_accs) 256: -: 154: 257: -: 155: /* poke the progress engine until the two are equal */ 258: #####: 156: MPID_Progress_start(&progress_state); 259: #####: 157: while (total_pt_rma_puts_accs != (*win_ptr)->my_pt_rma_puts_accs) 261: branch 1 never executed 262: -: 158: { 263: #####: 159: mpi_errno = MPID_Progress_wait(&progress_state); 277: -: 169: } 278: -: 170: 279: #####: 171: NMPI_Comm_free(&((*win_ptr)->comm)); 280: call 0 never executed 281: -: 172: 282: #####: 173: MPIU_Free((*win_ptr)->base_addrs); 283: call 0 never executed 284: #####: 174: MPIU_Free((*win_ptr)->disp_units); 285: call 0 never executed 286: #####: 175: MPIU_Free((*win_ptr)->all_win_handles); 287: call 0 never executed 288: #####: 176: MPIU_Free((*win_ptr)->pt_rma_puts_accs); 289: call 0 never executed 290: -: 177: 291: #####: 178: MPIU_Object_release_ref(*win_ptr, &in_use); 295: call 3 never executed 296: -: 179: /* MPI windows don't have reference count semantics, so this should always be true */ 297: #####: 180: MPIU_Assert(!in_use); 300: call 2 never executed 301: call 3 never executed 302: #####: 181: MPIU_Handle_obj_free( &MPID_Win_mem, *win_ptr ); 303: call 0 never executed 304: -: 182: 305: #####: 183: fn_exit: 306: #####: 184: MPIR_Nest_decr(); 307: #####: 185: MPIU_CHKLMEM_FREEALL(); 310: branch 1 never executed 311: branch 2 never executed 312: #####: 187: return mpi_errno; 326: -: 201: int target_count, MPI_Datatype target_datatype, MPID_Win *win_ptr) 327: function MPIDI_Put called 0 returned 0% blocks executed 0% 328: #####: 202:{ 329: #####: 203: int mpi_errno = MPI_SUCCESS; 333: -: 207: MPI_Aint dt_true_lb; 334: -: 208: MPIDI_msg_sz_t data_sz; 335: #####: 209: MPIU_CHKPMEM_DECL(1); 340: -: 214: 341: -: 215: MPIU_THREADPRIV_GET; 342: #####: 216: MPIDI_Datatype_get_info(origin_count, origin_datatype, 350: -: 217: dt_contig, data_sz, dtp,dt_true_lb); 351: -: 218: 352: #####: 219: if ((data_sz == 0) || (target_rank == MPI_PROC_NULL)) 354: branch 1 never executed 355: -: 220: { 356: #####: 221: goto fn_exit; 362: -: 227: just the handle 363: -: 228: */ 364: #####: 229: MPIR_Nest_incr(); 365: #####: 230: NMPI_Comm_rank(win_ptr->comm, &rank); 366: call 0 never executed 367: #####: 231: MPIR_Nest_decr(); 368: -: 232: 369: -: 233: /* If the put is a local operation, do it here */ 370: #####: 234: if (target_rank == rank) 372: branch 1 never executed 373: -: 235: { 374: #####: 236: mpi_errno = MPIR_Localcopy(origin_addr, origin_count, origin_datatype, 380: -: 241: { 381: -: 242: /* queue it up */ 382: #####: 243: curr_ptr = win_ptr->rma_ops_list; 383: #####: 244: prev_ptr = curr_ptr; 384: #####: 245: while (curr_ptr != NULL) 386: branch 1 never executed 387: -: 246: { 388: #####: 247: prev_ptr = curr_ptr; 389: #####: 248: curr_ptr = curr_ptr->next; 391: -: 250: 392: -: 251: /* FIXME: Where does this memory get freed? */ 393: #####: 252: MPIU_CHKPMEM_MALLOC(new_ptr, MPIDI_RMA_ops *, sizeof(MPIDI_RMA_ops), 401: call 7 never executed 402: -: 253: mpi_errno, "RMA operation entry"); 403: #####: 254: if (prev_ptr != NULL) 404: branch 0 never executed 405: branch 1 never executed 406: #####: 255: prev_ptr->next = new_ptr; 407: -: 256: else 408: #####: 257: win_ptr->rma_ops_list = new_ptr; 409: -: 258: 410: #####: 259: new_ptr->next = NULL; 411: #####: 260: new_ptr->type = MPIDI_RMA_PUT; 412: #####: 261: new_ptr->origin_addr = origin_addr; 413: #####: 262: new_ptr->origin_count = origin_count; 414: #####: 263: new_ptr->origin_datatype = origin_datatype; 415: #####: 264: new_ptr->target_rank = target_rank; 416: #####: 265: new_ptr->target_disp = target_disp; 417: #####: 266: new_ptr->target_count = target_count; 418: #####: 267: new_ptr->target_datatype = target_datatype; 420: -: 269: /* if source or target datatypes are derived, increment their 421: -: 270: reference counts */ 422: #####: 271: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(origin_datatype, predefined); 427: branch 4 never executed 428: branch 5 never executed 429: #####: 272: if (!predefined) 431: branch 1 never executed 432: -: 273: { 433: #####: 274: MPID_Datatype_get_ptr(origin_datatype, dtp); 437: branch 3 never executed 438: call 4 never executed 439: #####: 275: MPID_Datatype_add_ref(dtp); 443: call 3 never executed 444: -: 276: } 445: #####: 277: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(target_datatype, predefined); 450: branch 4 never executed 451: branch 5 never executed 452: #####: 278: if (!predefined) 454: branch 1 never executed 455: -: 279: { 456: #####: 280: MPID_Datatype_get_ptr(target_datatype, dtp); 460: branch 3 never executed 461: call 4 never executed 462: #####: 281: MPID_Datatype_add_ref(dtp); 468: -: 283: } 469: -: 284: 470: #####: 285: fn_exit: 471: #####: 285: fn_exit: 472: #####: 287: return mpi_errno; 492: -: 304: int target_count, MPI_Datatype target_datatype, MPID_Win *win_ptr) 493: function MPIDI_Get called 0 returned 0% blocks executed 0% 494: #####: 305:{ 495: #####: 306: int mpi_errno = MPI_SUCCESS; 499: -: 310: MPIDI_RMA_ops *curr_ptr, *prev_ptr, *new_ptr; 500: -: 311: MPID_Datatype *dtp; 501: #####: 312: MPIU_CHKPMEM_DECL(1); 506: -: 317: 507: -: 318: MPIU_THREADPRIV_GET; 508: #####: 319: MPIDI_Datatype_get_info(origin_count, origin_datatype, 516: -: 320: dt_contig, data_sz, dtp, dt_true_lb); 517: -: 321: 518: #####: 322: if ((data_sz == 0) || (target_rank == MPI_PROC_NULL)) 520: branch 1 never executed 521: -: 323: { 522: #####: 324: goto fn_exit; 525: -: 327: /* FIXME: It makes sense to save the rank (and size) of the 526: -: 328: communicator in the window structure to speed up these operations */ 527: #####: 329: MPIR_Nest_incr(); 528: #####: 330: NMPI_Comm_rank(win_ptr->comm, &rank); 529: call 0 never executed 530: #####: 331: MPIR_Nest_decr(); 531: -: 332: 532: -: 333: /* If the get is a local operation, do it here */ 533: #####: 334: if (target_rank == rank) 535: branch 1 never executed 536: -: 335: { 537: #####: 336: mpi_errno = MPIR_Localcopy((char *) win_ptr->base + 545: -: 343: { 546: -: 344: /* queue it up */ 547: #####: 345: curr_ptr = win_ptr->rma_ops_list; 548: #####: 346: prev_ptr = curr_ptr; 549: #####: 347: while (curr_ptr != NULL) 551: branch 1 never executed 552: -: 348: { 553: #####: 349: prev_ptr = curr_ptr; 554: #####: 350: curr_ptr = curr_ptr->next; 555: -: 351: } 556: -: 352: 557: #####: 353: MPIU_CHKPMEM_MALLOC(new_ptr, MPIDI_RMA_ops *, sizeof(MPIDI_RMA_ops), 565: call 7 never executed 566: -: 354: mpi_errno, "RMA operation entry"); 567: #####: 355: if (prev_ptr != NULL) 569: branch 1 never executed 570: -: 356: { 571: #####: 357: prev_ptr->next = new_ptr; 573: -: 359: else 574: -: 360: { 575: #####: 361: win_ptr->rma_ops_list = new_ptr; 576: -: 362: } 577: -: 363: 578: #####: 364: new_ptr->next = NULL; 579: #####: 365: new_ptr->type = MPIDI_RMA_GET; 580: #####: 366: new_ptr->origin_addr = origin_addr; 581: #####: 367: new_ptr->origin_count = origin_count; 582: #####: 368: new_ptr->origin_datatype = origin_datatype; 583: #####: 369: new_ptr->target_rank = target_rank; 584: #####: 370: new_ptr->target_disp = target_disp; 585: #####: 371: new_ptr->target_count = target_count; 586: #####: 372: new_ptr->target_datatype = target_datatype; 588: -: 374: /* if source or target datatypes are derived, increment their 589: -: 375: reference counts */ 590: #####: 376: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(origin_datatype, predefined); 595: branch 4 never executed 596: branch 5 never executed 597: #####: 377: if (!predefined) 599: branch 1 never executed 600: -: 378: { 601: #####: 379: MPID_Datatype_get_ptr(origin_datatype, dtp); 605: branch 3 never executed 606: call 4 never executed 607: #####: 380: MPID_Datatype_add_ref(dtp); 611: call 3 never executed 612: -: 381: } 613: #####: 382: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(target_datatype, predefined); 618: branch 4 never executed 619: branch 5 never executed 620: #####: 383: if (!predefined) 622: branch 1 never executed 623: -: 384: { 624: #####: 385: MPID_Datatype_get_ptr(target_datatype, dtp); 628: branch 3 never executed 629: call 4 never executed 630: #####: 386: MPID_Datatype_add_ref(dtp); 636: -: 388: } 637: -: 389: 638: #####: 390: fn_exit: 639: #####: 390: fn_exit: 640: #####: 392: return mpi_errno; 661: -: 410: MPID_Win *win_ptr) 662: function MPIDI_Accumulate called 0 returned 0% blocks executed 0% 663: #####: 411:{ 664: #####: 412: int nest_level_inc = FALSE; 665: #####: 413: int mpi_errno=MPI_SUCCESS; 669: -: 417: MPIDI_RMA_ops *curr_ptr, *prev_ptr, *new_ptr; 670: -: 418: MPID_Datatype *dtp; 671: #####: 419: MPIU_CHKLMEM_DECL(2); 672: #####: 420: MPIU_CHKPMEM_DECL(1); 677: -: 425: 678: -: 426: MPIU_THREADPRIV_GET; 679: #####: 427: MPIDI_Datatype_get_info(origin_count, origin_datatype, 687: -: 428: dt_contig, data_sz, dtp, dt_true_lb); 688: -: 429: 689: #####: 430: if ((data_sz == 0) || (target_rank == MPI_PROC_NULL)) 691: branch 1 never executed 692: -: 431: { 693: #####: 432: goto fn_exit; 694: -: 433: } 695: -: 434: 696: #####: 435: MPIR_Nest_incr(); 697: #####: 436: nest_level_inc = TRUE; 702: -: 441: just the handle 703: -: 442: */ 704: #####: 443: NMPI_Comm_rank(win_ptr->comm, &rank); 705: call 0 never executed 706: -: 444: 707: #####: 445: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(origin_datatype, origin_predefined); 712: branch 4 never executed 713: branch 5 never executed 714: #####: 446: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(target_datatype, target_predefined); 720: branch 5 never executed 721: -: 447: 722: #####: 448: if (target_rank == rank) 726: -: 450: MPI_User_function *uop; 727: -: 451: 728: #####: 452: if (op == MPI_REPLACE) 730: branch 1 never executed 731: -: 453: { 732: #####: 454: mpi_errno = MPIR_Localcopy(origin_addr, origin_count, 735: -: 456: (char *) win_ptr->base + win_ptr->disp_unit * 736: -: 457: target_disp, target_count, target_datatype); 737: #####: 458: goto fn_exit; 738: -: 459: } 739: -: 460: 740: #####: 461: MPIU_ERR_CHKANDJUMP1((HANDLE_GET_KIND(op) != HANDLE_KIND_BUILTIN), 746: -: 464: 747: -: 465: /* get the function by indexing into the op table */ 748: #####: 466: uop = MPIR_Op_table[(op)%16 - 1]; 749: -: 467: 750: #####: 468: if (origin_predefined && target_predefined) 752: branch 1 never executed 753: -: 469: { 754: #####: 470: (*uop)(origin_addr, (char *) win_ptr->base + win_ptr->disp_unit * 766: -: 481: MPI_Datatype type; 767: -: 482: MPI_Aint true_lb, true_extent, extent; 768: #####: 483: void *tmp_buf=NULL, *source_buf, *target_buf; 769: -: 484: 770: #####: 485: if (origin_datatype != target_datatype) 776: -: 489: accumulate operation. */ 777: -: 490: 778: #####: 491: mpi_errno = NMPI_Type_get_true_extent(target_datatype, 784: call 2 never executed 785: -: 494: 786: #####: 495: MPID_Datatype_get_extent_macro(target_datatype, extent); 790: call 3 never executed 791: -: 496: 792: #####: 497: MPIU_CHKLMEM_MALLOC(tmp_buf, void *, 804: -: 499: mpi_errno, "temporary buffer"); 805: -: 500: /* adjust for potential negative lower bound in datatype */ 806: #####: 501: tmp_buf = (void *)((char*)tmp_buf - true_lb); 807: -: 502: 808: #####: 503: mpi_errno = MPIR_Localcopy(origin_addr, origin_count, 816: -: 507: } 817: -: 508: 818: #####: 509: if (target_predefined) { 821: -: 510: /* target predefined type, origin derived datatype */ 822: -: 511: 823: #####: 512: (*uop)(tmp_buf, (char *) win_ptr->base + win_ptr->disp_unit * 827: -: 515: else { 828: -: 516: 829: #####: 517: segp = MPID_Segment_alloc(); 830: call 0 never executed 831: #####: 518: MPIU_ERR_CHKANDJUMP((!segp), mpi_errno, MPI_ERR_OTHER, "**nomem"); 833: branch 1 never executed 834: call 2 never executed 835: #####: 519: MPID_Segment_init(NULL, target_count, target_datatype, segp, 0); 836: call 0 never executed 837: #####: 520: first = 0; 838: #####: 521: last = SEGMENT_IGNORE_LAST; 839: -: 522: 840: #####: 523: MPID_Datatype_get_ptr(target_datatype, dtp); 844: branch 3 never executed 845: call 4 never executed 846: #####: 524: vec_len = dtp->max_contig_blocks * target_count + 1; 847: -: 525: /* +1 needed because Rob says so */ 848: #####: 526: MPIU_CHKLMEM_MALLOC(dloop_vec, DLOOP_VECTOR *, 860: -: 528: mpi_errno, "dloop vector"); 861: -: 529: 862: #####: 530: MPID_Segment_pack_vector(segp, first, &last, dloop_vec, &vec_len); 863: call 0 never executed 864: -: 531: 865: #####: 532: source_buf = (tmp_buf != NULL) ? tmp_buf : origin_addr; 866: branch 0 never executed 867: branch 1 never executed 868: #####: 533: target_buf = (char *) win_ptr->base + 869: -: 534: win_ptr->disp_unit * target_disp; 870: #####: 535: type = dtp->eltype; 871: #####: 536: type_size = MPID_Datatype_get_basic_size(type); 872: #####: 537: for (i=0; irma_ops_list; 892: #####: 553: prev_ptr = curr_ptr; 893: #####: 554: while (curr_ptr != NULL) 895: branch 1 never executed 896: -: 555: { 897: #####: 556: prev_ptr = curr_ptr; 898: #####: 557: curr_ptr = curr_ptr->next; 899: -: 558: } 900: -: 559: 901: #####: 560: MPIU_CHKPMEM_MALLOC(new_ptr, MPIDI_RMA_ops *, sizeof(MPIDI_RMA_ops), 909: call 7 never executed 910: -: 561: mpi_errno, "RMA operation entry"); 911: #####: 562: if (prev_ptr != NULL) 913: branch 1 never executed 914: -: 563: { 915: #####: 564: prev_ptr->next = new_ptr; 917: -: 566: else 918: -: 567: { 919: #####: 568: win_ptr->rma_ops_list = new_ptr; 920: -: 569: } 921: -: 570: 922: #####: 571: new_ptr->next = NULL; 923: #####: 572: new_ptr->type = MPIDI_RMA_ACCUMULATE; 924: #####: 573: new_ptr->origin_addr = origin_addr; 925: #####: 574: new_ptr->origin_count = origin_count; 926: #####: 575: new_ptr->origin_datatype = origin_datatype; 927: #####: 576: new_ptr->target_rank = target_rank; 928: #####: 577: new_ptr->target_disp = target_disp; 929: #####: 578: new_ptr->target_count = target_count; 930: #####: 579: new_ptr->target_datatype = target_datatype; 931: #####: 580: new_ptr->op = op; 933: -: 582: /* if source or target datatypes are derived, increment their 934: -: 583: reference counts */ 935: #####: 584: if (!origin_predefined) 937: branch 1 never executed 938: -: 585: { 939: #####: 586: MPID_Datatype_get_ptr(origin_datatype, dtp); 943: branch 3 never executed 944: call 4 never executed 945: #####: 587: MPID_Datatype_add_ref(dtp); 949: call 3 never executed 950: -: 588: } 951: #####: 589: if (!target_predefined) 953: branch 1 never executed 954: -: 590: { 955: #####: 591: MPID_Datatype_get_ptr(target_datatype, dtp); 959: branch 3 never executed 960: call 4 never executed 961: #####: 592: MPID_Datatype_add_ref(dtp); 968: -: 595: 969: -: 596: fn_exit: 970: #####: 597: MPIU_CHKLMEM_FREEALL(); 972: branch 1 never executed 973: branch 2 never executed 974: #####: 598: if (nest_level_inc) 976: branch 1 never executed 977: -: 599: { 978: #####: 600: MPIR_Nest_decr(); 979: #####: 600: MPIR_Nest_decr(); 980: -: 601: } 981: #####: 603: return mpi_errno; 998: -: 617:void *MPIDI_Alloc_mem( size_t size, MPID_Info *info_ptr ) 999: function MPIDI_Alloc_mem called 0 returned 0% blocks executed 0% 1000: #####: 618:{ 1004: -: 622: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_ALLOC_MEM); 1005: -: 623: 1006: #####: 624: ap = MPIU_Malloc(size); 1008: call 0 never executed 1009: -: 625: 1010: #####: 627: return ap; 1018: -: 635:int MPIDI_Free_mem( void *ptr ) 1019: function MPIDI_Free_mem called 0 returned 0% blocks executed 0% 1020: #####: 636:{ 1021: #####: 637: int mpi_errno = MPI_SUCCESS; 1024: -: 640: MPIDI_FUNC_ENTER(MPID_STATE_MPIDI_FREE_MEM); 1025: -: 641: 1026: #####: 642: MPIU_Free(ptr); 1028: call 0 never executed 1029: -: 643: 1030: #####: 645: return mpi_errno; 229 line(s) not covered by tests in src/mpid/ch3/src/ch3u_rma_ops.c.gcov Uncovered lines in src/mpid/ch3/src/ch3u_rma_sync.c.gcov 51: -: 46:int MPIDI_Win_fence(int assert, MPID_Win *win_ptr) 52: function MPIDI_Win_fence called 0 returned 0% blocks executed 0% 53: #####: 47:{ 54: #####: 48: int mpi_errno = MPI_SUCCESS; 57: -: 51: MPIDI_RMA_ops *curr_ptr, *next_ptr; 58: -: 52: MPID_Comm *comm_ptr; 59: #####: 53: MPID_Request **requests=NULL; /* array of requests */ 60: -: 54: MPI_Win source_win_handle, target_win_handle; 61: #####: 55: MPIDI_RMA_dtype_info *dtype_infos=NULL; 62: #####: 56: void **dataloops=NULL; /* to store dataloops for each datatype */ 63: -: 57: MPID_Progress_state progress_state; 64: #####: 58: MPIU_CHKLMEM_DECL(7); 76: -: 70: * there is a lock, poke the progress engine until the operartions 77: -: 71: * have completed and the lock is released. */ 78: #####: 72: if (win_ptr->current_lock_type != MPID_LOCK_NONE) 80: branch 1 never executed 81: -: 73: { 82: #####: 74: MPID_Progress_start(&progress_state); 83: #####: 75: while (win_ptr->current_lock_type != MPID_LOCK_NONE) 86: -: 76: { 87: -: 77: /* poke the progress engine */ 88: #####: 78: mpi_errno = MPID_Progress_wait(&progress_state); 104: -: 90: /* Note that the NOPRECEDE and NOSUCCEED must be specified by all processes 105: -: 91: in the window's group if any specify it */ 106: #####: 92: if (assert & MPI_MODE_NOPRECEDE) 108: branch 1 never executed 109: -: 93: { 110: #####: 94: win_ptr->fence_cnt = (assert & MPI_MODE_NOSUCCEED) ? 0 : 1; 111: #####: 95: goto fn_exit; 112: -: 96: } 113: -: 97: 114: #####: 98: if (win_ptr->fence_cnt == 0) 123: -: 105: Otherwise just increment the fence count and return. */ 124: -: 106: 125: #####: 107: if (!(assert & MPI_MODE_NOSUCCEED)) win_ptr->fence_cnt = 1; 131: -: 111: /* This is the second or later fence. Do all the preceding RMA ops. */ 132: -: 112: 133: #####: 113: MPID_Comm_get_ptr( win_ptr->comm, comm_ptr ); 140: -: 115: /* First inform every process whether it is a target of RMA 141: -: 116: ops from this process */ 142: #####: 117: comm_size = comm_ptr->local_size; 143: -: 118: 144: #####: 119: MPIU_CHKLMEM_MALLOC(rma_target_proc, int *, comm_size*sizeof(int), 154: call 9 never executed 155: -: 120: mpi_errno, "rma_target_proc"); 156: #####: 121: for (i=0; irma_ops_list; 184: #####: 135: while (curr_ptr != NULL) 186: branch 1 never executed 187: -: 136: { 188: #####: 137: total_op_count++; 189: #####: 138: rma_target_proc[curr_ptr->target_rank] = 1; 190: #####: 139: nops_to_proc[curr_ptr->target_rank]++; 191: #####: 140: curr_ptr = curr_ptr->next; 192: -: 141: } 193: -: 142: 194: #####: 143: MPIU_CHKLMEM_MALLOC(curr_ops_cnt, int *, comm_size*sizeof(int), 204: call 9 never executed 205: -: 144: mpi_errno, "curr_ops_cnt"); 206: #####: 145: for (i=0; imy_counter = comm_size; 264: -: 167: 265: -: 168: /* set up the recvcnts array for reduce scatter */ 266: #####: 169: MPIU_CHKLMEM_MALLOC(recvcnts, int *, comm_size*sizeof(int), 276: call 9 never executed 277: -: 170: mpi_errno, "recvcnts"); 278: #####: 171: for (i=0; icomm); 287: -: 177: /* result is stored in rma_target_proc[0] */ 288: #####: 178: MPIR_Nest_decr(); 295: -: 182: /* FIXME: MT: this needs to be done atomically because other 296: -: 183: procs have the address and could decrement it. */ 297: #####: 184: win_ptr->my_counter = win_ptr->my_counter - comm_size + 298: -: 185: rma_target_proc[0]; 299: -: 186: 300: #####: 187: i = 0; 301: #####: 188: curr_ptr = win_ptr->rma_ops_list; 302: #####: 189: while (curr_ptr != NULL) 308: -: 193: passing the source_win_handle only on the last operation. 309: -: 194: Otherwise, we pass NULL */ 310: #####: 195: if (curr_ops_cnt[curr_ptr->target_rank] == 312: branch 1 never executed 313: -: 196: nops_to_proc[curr_ptr->target_rank] - 1) 314: #####: 197: source_win_handle = win_ptr->handle; 315: -: 198: else 316: #####: 199: source_win_handle = MPI_WIN_NULL; 317: -: 200: 318: #####: 201: target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank]; 319: -: 202: 320: #####: 203: switch (curr_ptr->type) 325: -: 205: case (MPIDI_RMA_PUT): 326: -: 206: case (MPIDI_RMA_ACCUMULATE): 327: #####: 207: mpi_errno = MPIDI_CH3I_Send_rma_msg(curr_ptr, win_ptr, 336: -: 212: break; 337: -: 213: case (MPIDI_RMA_GET): 338: #####: 214: mpi_errno = MPIDI_CH3I_Recv_rma_msg(curr_ptr, win_ptr, 350: call 0 never executed 351: -: 222: } 352: #####: 223: i++; 353: #####: 224: curr_ops_cnt[curr_ptr->target_rank]++; 354: #####: 225: curr_ptr = curr_ptr->next; 356: -: 227: 357: -: 228: 358: #####: 229: if (total_op_count) 360: branch 1 never executed 361: -: 230: { 362: #####: 231: done = 1; 363: #####: 232: MPID_Progress_start(&progress_state); 364: #####: 233: while (total_op_count) 366: branch 1 never executed 367: -: 234: { 368: #####: 235: for (i=0; icc_ptr) != 0) 378: branch 1 never executed 379: -: 240: { 380: #####: 241: done = 0; 381: #####: 242: break; 383: -: 244: else 384: -: 245: { 385: #####: 246: mpi_errno = requests[i]->status.MPI_ERROR; 397: -: 255: datatype, it will get freed when the 398: -: 256: request gets freed. */ 399: #####: 257: MPID_Request_release(requests[i]); 405: branch 5 never executed 406: call 6 never executed 407: #####: 258: requests[i] = NULL; 410: -: 261: } 411: -: 262: 412: #####: 263: if (done) 414: branch 1 never executed 415: -: 264: { 416: #####: 265: break; 417: -: 266: } 418: -: 267: 419: #####: 268: mpi_errno = MPID_Progress_wait(&progress_state); 429: call 0 never executed 430: -: 275: 431: #####: 276: done = 1; 434: -: 279: } 435: -: 280: 436: #####: 281: if (total_op_count != 0) 438: branch 1 never executed 439: -: 282: { 440: #####: 283: for (i=0; irma_ops_list; 457: #####: 295: while (curr_ptr != NULL) 459: branch 1 never executed 460: -: 296: { 461: #####: 297: next_ptr = curr_ptr->next; 462: #####: 298: MPIU_Free(curr_ptr); 463: call 0 never executed 464: #####: 299: curr_ptr = next_ptr; 465: -: 300: } 466: #####: 301: win_ptr->rma_ops_list = NULL; 467: -: 302: 468: -: 303: /* wait for all operations from other processes to finish */ 469: #####: 304: if (win_ptr->my_counter) 471: branch 1 never executed 472: -: 305: { 473: #####: 306: MPID_Progress_start(&progress_state); 474: #####: 307: while (win_ptr->my_counter) 476: branch 1 never executed 477: -: 308: { 478: #####: 309: mpi_errno = MPID_Progress_wait(&progress_state); 491: -: 318: } 492: -: 319: 493: #####: 320: if (assert & MPI_MODE_NOSUCCEED) 495: branch 1 never executed 496: -: 321: { 497: #####: 322: win_ptr->fence_cnt = 0; 500: -: 325: 501: -: 326: fn_exit: 502: #####: 327: MPIU_CHKLMEM_FREEALL(); 505: branch 1 never executed 506: branch 2 never executed 507: #####: 329: return mpi_errno; 523: -: 345: MPID_Datatype **combined_dtp) 524: function create_datatype called 0 returned 0% blocks executed 0% 525: #####: 346:{ 526: #####: 347: int mpi_errno = MPI_SUCCESS; 530: -: 351: blocklens into ints later. */ 531: -: 352: int ints[4]; 532: #####: 353: int *blocklens = &ints[1]; 533: -: 354: MPI_Aint displaces[3]; 534: -: 355: MPI_Datatype datatypes[3]; 535: #####: 356: const int count = 3; 540: -: 361: 541: -: 362: /* create datatype */ 542: #####: 363: displaces[0] = MPIU_PtrToAint(dtype_info); 543: #####: 364: blocklens[0] = sizeof(*dtype_info); 544: #####: 365: datatypes[0] = MPI_BYTE; 545: -: 366: 546: #####: 367: displaces[1] = MPIU_PtrToAint(dataloop); 547: #####: 368: blocklens[1] = dataloop_sz; 548: #####: 369: datatypes[1] = MPI_BYTE; 549: -: 370: 550: #####: 371: displaces[2] = MPIU_PtrToAint(o_addr); 551: #####: 372: blocklens[2] = o_count; 552: #####: 373: datatypes[2] = o_datatype; 553: -: 374: 554: #####: 375: mpi_errno = MPID_Type_struct(count, 563: call 2 never executed 564: -: 381: 565: #####: 382: ints[0] = count; 566: -: 383: 567: #####: 384: MPID_Datatype_get_ptr(combined_datatype, *combined_dtp); 571: branch 3 never executed 572: call 4 never executed 573: #####: 385: mpi_errno = MPID_Datatype_set_contents(*combined_dtp, 587: -: 395: /* Commit datatype */ 588: -: 396: 589: #####: 397: MPID_Dataloop_create(combined_datatype, 595: -: 402: 596: -: 403: /* create heterogeneous dataloop */ 597: #####: 404: MPID_Dataloop_create(combined_datatype, 602: -: 408: MPID_DATALOOP_HETEROGENEOUS); 603: -: 409: 604: #####: 410: fn_exit: 605: #####: 410: fn_exit: 606: #####: 412: return mpi_errno; 620: -: 426: void **dataloop, MPID_Request **request) 621: function MPIDI_CH3I_Send_rma_msg called 0 returned 0% blocks executed 0% 622: #####: 427:{ 623: -: 428: MPIDI_CH3_Pkt_t upkt; 624: #####: 429: MPIDI_CH3_Pkt_put_t *put_pkt = &upkt.put; 625: #####: 430: MPIDI_CH3_Pkt_accum_t *accum_pkt = &upkt.accum; 626: -: 431: MPID_IOV iov[MPID_IOV_LIMIT]; 627: #####: 432: int mpi_errno=MPI_SUCCESS, predefined; 629: -: 434: MPIDI_VC_t * vc; 630: -: 435: MPID_Comm *comm_ptr; 631: #####: 436: MPID_Datatype *target_dtp=NULL, *origin_dtp=NULL; 632: #####: 437: MPIU_CHKPMEM_DECL(1); 636: -: 441: MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_SEND_RMA_MSG); 637: -: 442: 638: #####: 443: *request = NULL; 639: -: 444: 640: #####: 445: if (rma_op->type == MPIDI_RMA_PUT) 642: branch 1 never executed 643: -: 446: { 644: #####: 447: MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT); 645: #####: 448: put_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] + 646: -: 449: win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp; 647: -: 450: 648: #####: 451: put_pkt->count = rma_op->target_count; 649: #####: 452: put_pkt->datatype = rma_op->target_datatype; 650: #####: 453: put_pkt->dataloop_size = 0; 651: #####: 454: put_pkt->target_win_handle = target_win_handle; 652: #####: 455: put_pkt->source_win_handle = source_win_handle; 653: -: 456: 654: #####: 457: iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) put_pkt; 655: #####: 458: iov[0].MPID_IOV_LEN = sizeof(*put_pkt); 657: -: 460: else 658: -: 461: { 659: #####: 462: MPIDI_Pkt_init(accum_pkt, MPIDI_CH3_PKT_ACCUMULATE); 660: #####: 463: accum_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] + 661: -: 464: win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp; 662: #####: 465: accum_pkt->count = rma_op->target_count; 663: #####: 466: accum_pkt->datatype = rma_op->target_datatype; 664: #####: 467: accum_pkt->dataloop_size = 0; 665: #####: 468: accum_pkt->op = rma_op->op; 666: #####: 469: accum_pkt->target_win_handle = target_win_handle; 667: #####: 470: accum_pkt->source_win_handle = source_win_handle; 668: -: 471: 669: #####: 472: iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST) accum_pkt; 670: #####: 473: iov[0].MPID_IOV_LEN = sizeof(*accum_pkt); 676: -: 479: */ 677: -: 480: 678: #####: 481: MPID_Comm_get_ptr(win_ptr->comm, comm_ptr); 682: branch 3 never executed 683: call 4 never executed 684: #####: 482: MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc); 686: branch 1 never executed 687: -: 483: 688: #####: 484: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(rma_op->origin_datatype, predefined); 699: branch 10 never executed 700: branch 11 never executed 701: #####: 485: if (!predefined) 703: branch 1 never executed 704: -: 486: { 705: #####: 487: origin_dt_derived = 1; 706: #####: 488: MPID_Datatype_get_ptr(rma_op->origin_datatype, origin_dtp); 713: -: 490: else 714: -: 491: { 715: #####: 492: origin_dt_derived = 0; 716: -: 493: } 717: -: 494: 718: #####: 495: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(rma_op->target_datatype, predefined); 729: branch 10 never executed 730: branch 11 never executed 731: #####: 496: if (!predefined) 733: branch 1 never executed 734: -: 497: { 735: #####: 498: target_dt_derived = 1; 736: #####: 499: MPID_Datatype_get_ptr(rma_op->target_datatype, target_dtp); 743: -: 501: else 744: -: 502: { 745: #####: 503: target_dt_derived = 0; 746: -: 504: } 747: -: 505: 748: #####: 506: if (target_dt_derived) 751: -: 507: { 752: -: 508: /* derived datatype on target. fill derived datatype info */ 753: #####: 509: dtype_info->is_contig = target_dtp->is_contig; 754: #####: 510: dtype_info->max_contig_blocks = target_dtp->max_contig_blocks; 755: #####: 511: dtype_info->size = target_dtp->size; 756: #####: 512: dtype_info->extent = target_dtp->extent; 757: #####: 513: dtype_info->dataloop_size = target_dtp->dataloop_size; 758: #####: 514: dtype_info->dataloop_depth = target_dtp->dataloop_depth; 759: #####: 515: dtype_info->eltype = target_dtp->eltype; 760: #####: 516: dtype_info->dataloop = target_dtp->dataloop; 761: #####: 517: dtype_info->ub = target_dtp->ub; 762: #####: 518: dtype_info->lb = target_dtp->lb; 763: #####: 519: dtype_info->true_ub = target_dtp->true_ub; 764: #####: 520: dtype_info->true_lb = target_dtp->true_lb; 765: #####: 521: dtype_info->has_sticky_ub = target_dtp->has_sticky_ub; 766: #####: 522: dtype_info->has_sticky_lb = target_dtp->has_sticky_lb; 767: -: 523: 768: #####: 524: MPIU_CHKPMEM_MALLOC(*dataloop, void *, target_dtp->dataloop_size, 780: -: 526: 781: -: 527: MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY); 782: #####: 528: MPIU_Memcpy(*dataloop, target_dtp->dataloop, target_dtp->dataloop_size); 811: -: 532: MPIU_VG_MAKE_MEM_DEFINED(*dataloop, target_dtp->dataloop_size); 812: -: 533: 813: #####: 534: if (rma_op->type == MPIDI_RMA_PUT) 815: branch 1 never executed 816: -: 535: { 817: #####: 536: put_pkt->dataloop_size = target_dtp->dataloop_size; 819: -: 538: else 820: -: 539: { 821: #####: 540: accum_pkt->dataloop_size = target_dtp->dataloop_size; 823: -: 542: } 824: -: 543: 825: #####: 544: MPID_Datatype_get_size_macro(rma_op->origin_datatype, origin_type_size); 830: call 4 never executed 831: -: 545: 832: #####: 546: if (!target_dt_derived) 835: -: 547: { 836: -: 548: /* basic datatype on target */ 837: #####: 549: if (!origin_dt_derived) 840: -: 550: { 841: -: 551: /* basic datatype on origin */ 842: #####: 552: iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)rma_op->origin_addr; 843: #####: 553: iov[1].MPID_IOV_LEN = rma_op->origin_count * origin_type_size; 844: #####: 554: iovcnt = 2; 845: -: 555: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 846: #####: 556: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsgv(vc, iov, iovcnt, request)); 847: call 0 never executed 848: -: 557: MPIU_THREAD_CS_EXIT(CH3COMM,vc); 849: #####: 558: MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg"); 855: -: 561: { 856: -: 562: /* derived datatype on origin */ 857: #####: 563: *request = MPID_Request_create(); 858: call 0 never executed 859: #####: 564: MPIU_ERR_CHKANDJUMP(*request == NULL,mpi_errno,MPI_ERR_OTHER,"**nomem"); 862: call 2 never executed 863: -: 565: 864: #####: 566: MPIU_Object_set_ref(*request, 2); 865: #####: 567: (*request)->kind = MPID_REQUEST_SEND; 866: -: 568: 867: #####: 569: (*request)->dev.segment_ptr = MPID_Segment_alloc( ); 868: call 0 never executed 869: #####: 570: MPIU_ERR_CHKANDJUMP1((*request)->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 872: call 2 never executed 873: -: 571: 874: #####: 572: (*request)->dev.datatype_ptr = origin_dtp; 875: -: 573: /* this will cause the datatype to be freed when the request 876: -: 574: is freed. */ 877: #####: 575: MPID_Segment_init(rma_op->origin_addr, rma_op->origin_count, 879: -: 576: rma_op->origin_datatype, 880: -: 577: (*request)->dev.segment_ptr, 0); 881: #####: 578: (*request)->dev.segment_first = 0; 882: #####: 579: (*request)->dev.segment_size = rma_op->origin_count * origin_type_size; 883: -: 580: 884: #####: 581: (*request)->dev.OnFinal = 0; 885: #####: 582: (*request)->dev.OnDataAvail = 0; 886: -: 583: 887: -: 584: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 888: #####: 585: mpi_errno = vc->sendNoncontig_fn(vc, *request, iov[0].MPID_IOV_BUF, iov[0].MPID_IOV_LEN); 889: call 0 never executed 890: -: 586: MPIU_THREAD_CS_EXIT(CH3COMM,vc); 891: #####: 587: MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg"); 898: -: 591: { 899: -: 592: /* derived datatype on target */ 900: #####: 593: MPID_Datatype *combined_dtp = NULL; 901: -: 594: 902: #####: 595: *request = MPID_Request_create(); 903: call 0 never executed 904: #####: 596: if (*request == NULL) { 909: -: 598: } 910: -: 599: 911: #####: 600: MPIU_Object_set_ref(*request, 2); 912: #####: 601: (*request)->kind = MPID_REQUEST_SEND; 913: -: 602: 914: #####: 603: (*request)->dev.segment_ptr = MPID_Segment_alloc( ); 915: call 0 never executed 916: #####: 604: MPIU_ERR_CHKANDJUMP1((*request)->dev.segment_ptr == NULL, mpi_errno, MPI_ERR_OTHER, "**nomem", "**nomem %s", "MPID_Segment_alloc"); 921: -: 606: /* create a new datatype containing the dtype_info, dataloop, and origin data */ 922: -: 607: 923: #####: 608: mpi_errno = create_datatype(dtype_info, *dataloop, target_dtp->dataloop_size, rma_op->origin_addr, 929: call 2 never executed 930: -: 611: 931: #####: 612: (*request)->dev.datatype_ptr = combined_dtp; 932: -: 613: /* combined_datatype will be freed when request is freed */ 933: -: 614: 934: #####: 615: MPID_Segment_init(MPI_BOTTOM, 1, combined_dtp->handle, 935: call 0 never executed 936: -: 616: (*request)->dev.segment_ptr, 0); 937: #####: 617: (*request)->dev.segment_first = 0; 938: #####: 618: (*request)->dev.segment_size = combined_dtp->size; 939: -: 619: 940: #####: 620: (*request)->dev.OnFinal = 0; 941: #####: 621: (*request)->dev.OnDataAvail = 0; 942: -: 622: 943: -: 623: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 944: #####: 624: mpi_errno = vc->sendNoncontig_fn(vc, *request, iov[0].MPID_IOV_BUF, iov[0].MPID_IOV_LEN); 945: call 0 never executed 946: -: 625: MPIU_THREAD_CS_EXIT(CH3COMM,vc); 947: #####: 626: MPIU_ERR_CHKANDJUMP(mpi_errno, mpi_errno, MPI_ERR_OTHER, "**ch3|rmamsg"); 951: -: 627: 952: -: 628: /* we're done with the datatypes */ 953: #####: 629: if (origin_dt_derived) 954: branch 0 never executed 955: branch 1 never executed 956: #####: 630: MPID_Datatype_release(origin_dtp); 969: branch 12 never executed 970: call 13 never executed 971: #####: 631: MPID_Datatype_release(target_dtp); 986: -: 632: } 987: -: 633: 988: #####: 634: fn_exit: 989: #####: 634: fn_exit: 990: #####: 636: return mpi_errno; 1038: -: 662: void **dataloop, MPID_Request **request) 1039: function MPIDI_CH3I_Recv_rma_msg called 0 returned 0% blocks executed 0% 1040: #####: 663:{ 1041: -: 664: MPIDI_CH3_Pkt_t upkt; 1042: #####: 665: MPIDI_CH3_Pkt_get_t *get_pkt = &upkt.get; 1043: #####: 666: int mpi_errno=MPI_SUCCESS, predefined; 1044: -: 667: MPIDI_VC_t * vc; 1045: -: 668: MPID_Comm *comm_ptr; 1046: #####: 669: MPID_Request *req = NULL; 1047: -: 670: MPID_Datatype *dtp; 1048: -: 671: MPID_IOV iov[MPID_IOV_LIMIT]; 1049: #####: 672: MPIU_CHKPMEM_DECL(1); 1057: -: 680: response comes from the target, it will contain the request 1058: -: 681: handle. */ 1059: #####: 682: req = MPID_Request_create(); 1060: call 0 never executed 1061: #####: 683: if (req == NULL) { 1066: -: 685: } 1067: -: 686: 1068: #####: 687: *request = req; 1069: -: 688: 1070: #####: 689: MPIU_Object_set_ref(req, 2); 1071: -: 690: 1072: #####: 691: req->dev.user_buf = rma_op->origin_addr; 1073: #####: 692: req->dev.user_count = rma_op->origin_count; 1074: #####: 693: req->dev.datatype = rma_op->origin_datatype; 1075: #####: 694: req->dev.target_win_handle = MPI_WIN_NULL; 1076: #####: 695: req->dev.source_win_handle = source_win_handle; 1077: #####: 696: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(req->dev.datatype, predefined); 1088: branch 10 never executed 1089: branch 11 never executed 1090: #####: 697: if (!predefined) 1092: branch 1 never executed 1093: -: 698: { 1094: #####: 699: MPID_Datatype_get_ptr(req->dev.datatype, dtp); 1098: branch 3 never executed 1099: call 4 never executed 1100: #####: 700: req->dev.datatype_ptr = dtp; 1103: -: 703: } 1104: -: 704: 1105: #####: 705: MPIDI_Pkt_init(get_pkt, MPIDI_CH3_PKT_GET); 1106: #####: 706: get_pkt->addr = (char *) win_ptr->base_addrs[rma_op->target_rank] + 1107: -: 707: win_ptr->disp_units[rma_op->target_rank] * rma_op->target_disp; 1108: #####: 708: get_pkt->count = rma_op->target_count; 1109: #####: 709: get_pkt->datatype = rma_op->target_datatype; 1110: #####: 710: get_pkt->request_handle = req->handle; 1111: #####: 711: get_pkt->target_win_handle = target_win_handle; 1112: #####: 712: get_pkt->source_win_handle = source_win_handle; 1117: -: 717:*/ 1118: -: 718: 1119: #####: 719: MPID_Comm_get_ptr(win_ptr->comm, comm_ptr); 1123: branch 3 never executed 1124: call 4 never executed 1125: #####: 720: MPIDI_Comm_get_vc_set_active(comm_ptr, rma_op->target_rank, &vc); 1127: branch 1 never executed 1128: -: 721: 1129: #####: 722: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(rma_op->target_datatype, predefined); 1140: branch 10 never executed 1141: branch 11 never executed 1142: #####: 723: if (predefined) 1146: -: 725: /* basic datatype on target. simply send the get_pkt. */ 1147: -: 726: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 1148: #####: 727: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, get_pkt, sizeof(*get_pkt), &req)); 1155: -: 733: send it along with get_pkt. */ 1156: -: 734: 1157: #####: 735: MPID_Datatype_get_ptr(rma_op->target_datatype, dtp); 1161: branch 3 never executed 1162: call 4 never executed 1163: #####: 736: dtype_info->is_contig = dtp->is_contig; 1164: #####: 737: dtype_info->max_contig_blocks = dtp->max_contig_blocks; 1165: #####: 738: dtype_info->size = dtp->size; 1166: #####: 739: dtype_info->extent = dtp->extent; 1167: #####: 740: dtype_info->dataloop_size = dtp->dataloop_size; 1168: #####: 741: dtype_info->dataloop_depth = dtp->dataloop_depth; 1169: #####: 742: dtype_info->eltype = dtp->eltype; 1170: #####: 743: dtype_info->dataloop = dtp->dataloop; 1171: #####: 744: dtype_info->ub = dtp->ub; 1172: #####: 745: dtype_info->lb = dtp->lb; 1173: #####: 746: dtype_info->true_ub = dtp->true_ub; 1174: #####: 747: dtype_info->true_lb = dtp->true_lb; 1175: #####: 748: dtype_info->has_sticky_ub = dtp->has_sticky_ub; 1176: #####: 749: dtype_info->has_sticky_lb = dtp->has_sticky_lb; 1177: -: 750: 1178: #####: 751: MPIU_CHKPMEM_MALLOC(*dataloop, void *, dtp->dataloop_size, 1190: -: 753: 1191: -: 754: MPIDI_FUNC_ENTER(MPID_STATE_MEMCPY); 1192: #####: 755: MPIU_Memcpy(*dataloop, dtp->dataloop, dtp->dataloop_size); 1222: -: 760: MPIU_VG_MAKE_MEM_DEFINED(*dataloop, dtp->dataloop_size); 1223: -: 761: 1224: #####: 762: get_pkt->dataloop_size = dtp->dataloop_size; 1225: -: 763: 1226: #####: 764: iov[0].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)get_pkt; 1227: #####: 765: iov[0].MPID_IOV_LEN = sizeof(*get_pkt); 1228: #####: 766: iov[1].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)dtype_info; 1229: #####: 767: iov[1].MPID_IOV_LEN = sizeof(*dtype_info); 1230: #####: 768: iov[2].MPID_IOV_BUF = (MPID_IOV_BUF_CAST)*dataloop; 1231: #####: 769: iov[2].MPID_IOV_LEN = dtp->dataloop_size; 1232: -: 770: 1233: -: 771: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 1234: #####: 772: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsgv(vc, iov, 3, &req)); 1237: -: 774: 1238: -: 775: /* release the target datatype */ 1239: #####: 776: MPID_Datatype_release(dtp); 1254: -: 777: } 1255: -: 778: 1256: #####: 779: if (mpi_errno != MPI_SUCCESS) { 1262: -: 782: 1263: -: 783: /* release the request returned by iStartMsg or iStartMsgv */ 1264: #####: 784: if (req != NULL) 1266: branch 1 never executed 1267: -: 785: { 1268: #####: 786: MPID_Request_release(req); 1276: -: 787: } 1277: -: 788: 1278: #####: 789: fn_exit: 1279: #####: 789: fn_exit: 1280: #####: 791: return mpi_errno; 1299: -: 807:int MPIDI_Win_post(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr) 1300: function MPIDI_Win_post called 0 returned 0% blocks executed 0% 1301: #####: 808:{ 1302: #####: 809: int nest_level_inc = FALSE; 1303: #####: 810: int mpi_errno=MPI_SUCCESS; 1304: -: 811: MPI_Group win_grp, post_grp; 1305: -: 812: int i, post_grp_size, *ranks_in_post_grp, *ranks_in_win_grp, dst, rank; 1306: #####: 813: MPIU_CHKLMEM_DECL(2); 1328: -: 835: * there is a lock, poke the progress engine until the operations 1329: -: 836: * have completed and the lock is therefore released. */ 1330: #####: 837: if (win_ptr->current_lock_type != MPID_LOCK_NONE) 1335: -: 840: 1336: -: 841: /* poke the progress engine */ 1337: #####: 842: MPID_Progress_start(&progress_state); 1338: #####: 843: while (win_ptr->current_lock_type != MPID_LOCK_NONE) 1340: branch 1 never executed 1341: -: 844: { 1342: #####: 845: mpi_errno = MPID_Progress_wait(&progress_state); 1355: -: 854: } 1356: -: 855: 1357: #####: 856: post_grp_size = group_ptr->size; 1358: -: 857: 1359: -: 858: /* initialize the completion counter */ 1360: #####: 859: win_ptr->my_counter = post_grp_size; 1361: -: 860: 1362: #####: 861: if ((assert & MPI_MODE_NOCHECK) == 0) 1371: -: 868: can do communication */ 1372: -: 869: 1373: #####: 870: MPIU_CHKLMEM_MALLOC(ranks_in_post_grp, int *, 1384: -: 871: post_grp_size * sizeof(int), 1385: -: 872: mpi_errno, "ranks_in_post_grp"); 1386: #####: 873: MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, 1398: -: 875: mpi_errno, "ranks_in_win_grp"); 1399: -: 876: 1400: #####: 877: for (i=0; icomm, &win_grp); 1415: call 2 never executed 1416: -: 887: 1417: #####: 888: post_grp = group_ptr->handle; 1418: -: 889: 1419: #####: 890: mpi_errno = NMPI_Group_translate_ranks(post_grp, post_grp_size, 1426: call 2 never executed 1427: -: 894: 1428: #####: 895: NMPI_Comm_rank(win_ptr->comm, &rank); 1430: -: 896: 1431: -: 897: /* Send a 0-byte message to the source processes */ 1432: #####: 898: for (i=0; icomm); 1448: -: 906: } 1449: -: 907: 1450: #####: 908: mpi_errno = NMPI_Group_free(&win_grp); 1457: -: 911: 1458: -: 912: fn_exit: 1459: #####: 913: MPIU_CHKLMEM_FREEALL(); 1461: branch 1 never executed 1462: branch 2 never executed 1463: #####: 914: if (nest_level_inc) 1465: branch 1 never executed 1466: -: 915: { 1467: #####: 916: MPIR_Nest_decr(); 1468: #####: 916: MPIR_Nest_decr(); 1469: -: 917: } 1470: #####: 919: return mpi_errno; 1483: -: 932:int MPIDI_Win_start(MPID_Group *group_ptr, int assert, MPID_Win *win_ptr) 1484: function MPIDI_Win_start called 0 returned 0% blocks executed 0% 1485: #####: 933:{ 1486: #####: 934: int mpi_errno=MPI_SUCCESS; 1504: -: 952: * there is a lock, poke the progress engine until the operations 1505: -: 953: * have completed and the lock is therefore released. */ 1506: #####: 954: if (win_ptr->current_lock_type != MPID_LOCK_NONE) 1511: -: 957: 1512: -: 958: /* poke the progress engine */ 1513: #####: 959: MPID_Progress_start(&progress_state); 1514: #####: 960: while (win_ptr->current_lock_type != MPID_LOCK_NONE) 1516: branch 1 never executed 1517: -: 961: { 1518: #####: 962: mpi_errno = MPID_Progress_wait(&progress_state); 1531: -: 971: } 1532: -: 972: 1533: #####: 973: win_ptr->start_group_ptr = group_ptr; 1534: #####: 974: MPIR_Group_add_ref( group_ptr ); 1537: call 2 never executed 1538: call 3 never executed 1539: #####: 975: win_ptr->start_assert = assert; 1541: #####: 975: win_ptr->start_assert = assert; 1542: -: 976: 1543: #####: 979: return mpi_errno; 1552: -: 988:int MPIDI_Win_complete(MPID_Win *win_ptr) 1553: function MPIDI_Win_complete called 0 returned 0% blocks executed 0% 1554: #####: 989:{ 1555: #####: 990: int nest_level_inc = FALSE; 1556: #####: 991: int mpi_errno = MPI_SUCCESS; 1561: -: 996: MPID_Request **requests; /* array of requests */ 1562: -: 997: MPI_Win source_win_handle, target_win_handle; 1563: #####: 998: MPIDI_RMA_dtype_info *dtype_infos=NULL; 1564: #####: 999: void **dataloops=NULL; /* to store dataloops for each datatype */ 1565: -: 1000: MPI_Group win_grp, start_grp; 1566: -: 1001: int start_grp_size, *ranks_in_start_grp, *ranks_in_win_grp, rank; 1567: #####: 1002: MPIU_CHKLMEM_DECL(7); 1572: -: 1007: 1573: -: 1008: MPIU_THREADPRIV_GET; 1574: #####: 1009: MPID_Comm_get_ptr( win_ptr->comm, comm_ptr ); 1578: branch 3 never executed 1579: call 4 never executed 1580: #####: 1010: comm_size = comm_ptr->local_size; 1583: -: 1013: start_group to ranks in win_ptr->comm */ 1584: -: 1014: 1585: #####: 1015: start_grp_size = win_ptr->start_group_ptr->size; 1586: -: 1016: 1587: #####: 1017: MPIU_CHKLMEM_MALLOC(ranks_in_start_grp, int *, start_grp_size*sizeof(int), 1598: -: 1018: mpi_errno, "ranks_in_start_grp"); 1599: -: 1019: 1600: #####: 1020: MPIU_CHKLMEM_MALLOC(ranks_in_win_grp, int *, start_grp_size*sizeof(int), 1611: -: 1021: mpi_errno, "ranks_in_win_grp"); 1612: -: 1022: 1613: #####: 1023: for (i=0; icomm, &win_grp); 1628: call 2 never executed 1629: -: 1033: 1630: #####: 1034: start_grp = win_ptr->start_group_ptr->handle; 1631: -: 1035: 1632: #####: 1036: mpi_errno = NMPI_Group_translate_ranks(start_grp, start_grp_size, 1640: -: 1040: 1641: -: 1041: 1642: #####: 1042: NMPI_Comm_rank(win_ptr->comm, &rank); 1645: -: 1044: Win_post was called on the target processes. Wait for a 0-byte sync 1646: -: 1045: message from each target process */ 1647: #####: 1046: if ((win_ptr->start_assert & MPI_MODE_NOCHECK) == 0) 1649: branch 1 never executed 1650: -: 1047: { 1651: #####: 1048: for (i=0; irma_ops_list; 1693: #####: 1070: while (curr_ptr != NULL) 1695: branch 1 never executed 1696: -: 1071: { 1697: #####: 1072: nops_to_proc[curr_ptr->target_rank]++; 1698: #####: 1073: total_op_count++; 1699: #####: 1074: curr_ptr = curr_ptr->next; 1700: -: 1075: } 1701: -: 1076: 1702: #####: 1077: MPIU_CHKLMEM_MALLOC(requests, MPID_Request **, 1717: -: 1082: to decrement the completion counter. */ 1718: -: 1083: 1719: #####: 1084: MPIU_CHKLMEM_MALLOC(curr_ops_cnt, int *, comm_size*sizeof(int), 1729: call 9 never executed 1730: -: 1085: mpi_errno, "curr_ops_cnt"); 1731: #####: 1086: for (i=0; irma_ops_list; 1771: #####: 1100: while (curr_ptr != NULL) 1777: -: 1104: passing the source_win_handle only on the last operation. 1778: -: 1105: Otherwise, we pass NULL */ 1779: #####: 1106: if (curr_ops_cnt[curr_ptr->target_rank] == 1781: branch 1 never executed 1782: -: 1107: nops_to_proc[curr_ptr->target_rank] - 1) 1783: #####: 1108: source_win_handle = win_ptr->handle; 1784: -: 1109: else 1785: #####: 1110: source_win_handle = MPI_WIN_NULL; 1786: -: 1111: 1787: #####: 1112: target_win_handle = win_ptr->all_win_handles[curr_ptr->target_rank]; 1788: -: 1113: 1789: #####: 1114: switch (curr_ptr->type) 1794: -: 1116: case (MPIDI_RMA_PUT): 1795: -: 1117: case (MPIDI_RMA_ACCUMULATE): 1796: #####: 1118: mpi_errno = MPIDI_CH3I_Send_rma_msg(curr_ptr, win_ptr, 1805: -: 1123: break; 1806: -: 1124: case (MPIDI_RMA_GET): 1807: #####: 1125: mpi_errno = MPIDI_CH3I_Recv_rma_msg(curr_ptr, win_ptr, 1819: call 0 never executed 1820: -: 1133: } 1821: #####: 1134: i++; 1822: #####: 1135: curr_ops_cnt[curr_ptr->target_rank]++; 1823: #####: 1136: curr_ptr = curr_ptr->next; 1829: -: 1142: the completion counter */ 1830: -: 1143: 1831: #####: 1144: j = i; 1832: #####: 1145: new_total_op_count = total_op_count; 1833: #####: 1146: for (i=0; imy_counter -= 1; 1843: -: 1152: } 1844: #####: 1153: else if (nops_to_proc[dst] == 0) 1847: -: 1154: { 1848: -: 1155: MPIDI_CH3_Pkt_t upkt; 1849: #####: 1156: MPIDI_CH3_Pkt_put_t *put_pkt = &upkt.put; 1850: -: 1157: MPIDI_VC_t * vc; 1851: -: 1158: 1852: #####: 1159: MPIDI_Pkt_init(put_pkt, MPIDI_CH3_PKT_PUT); 1853: #####: 1160: put_pkt->addr = NULL; 1854: #####: 1161: put_pkt->count = 0; 1855: #####: 1162: put_pkt->datatype = MPI_INT; 1856: #####: 1163: put_pkt->target_win_handle = win_ptr->all_win_handles[dst]; 1857: #####: 1164: put_pkt->source_win_handle = win_ptr->handle; 1858: -: 1165: 1859: #####: 1166: MPIDI_Comm_get_vc_set_active(comm_ptr, dst, &vc); 1862: -: 1167: 1863: -: 1168: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 1864: #####: 1169: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, put_pkt, 1867: -: 1171: &requests[j])); 1868: -: 1172: MPIU_THREAD_CS_EXIT(CH3COMM,vc); 1869: #####: 1173: if (mpi_errno != MPI_SUCCESS) { 1873: call 0 never executed 1874: -: 1175: } 1875: #####: 1176: j++; 1876: #####: 1177: new_total_op_count++; 1878: -: 1179: } 1879: -: 1180: 1880: #####: 1181: if (new_total_op_count) 1884: -: 1183: MPID_Progress_state progress_state; 1885: -: 1184: 1886: #####: 1185: done = 1; 1887: #####: 1186: MPID_Progress_start(&progress_state); 1888: #####: 1187: while (new_total_op_count) 1890: branch 1 never executed 1891: -: 1188: { 1892: #####: 1189: for (i=0; icc_ptr) != 0) 1902: branch 1 never executed 1903: -: 1194: { 1904: #####: 1195: done = 0; 1905: #####: 1196: break; 1907: -: 1198: else 1908: -: 1199: { 1909: #####: 1200: mpi_errno = requests[i]->status.MPI_ERROR; 1918: -: 1199: { 1919: #####: 1200: mpi_errno = requests[i]->status.MPI_ERROR; 1920: #####: 1208: MPID_Request_release(requests[i]); 1926: branch 5 never executed 1927: call 6 never executed 1928: #####: 1209: requests[i] = NULL; 1931: -: 1212: } 1932: -: 1213: 1933: #####: 1214: if (done) 1935: branch 1 never executed 1936: -: 1215: { 1937: #####: 1216: break; 1938: -: 1217: } 1939: -: 1218: 1940: #####: 1219: mpi_errno = MPID_Progress_wait(&progress_state); 1941: call 0 never executed 1942: #####: 1220: done = 1; 1945: -: 1223: } 1946: -: 1224: 1947: #####: 1225: if (total_op_count != 0) 1949: branch 1 never executed 1950: -: 1226: { 1951: #####: 1227: for (i=0; irma_ops_list; 1967: #####: 1238: while (curr_ptr != NULL) 1969: branch 1 never executed 1970: -: 1239: { 1971: #####: 1240: next_ptr = curr_ptr->next; 1972: #####: 1241: MPIU_Free(curr_ptr); 1973: call 0 never executed 1974: #####: 1242: curr_ptr = next_ptr; 1975: -: 1243: } 1976: #####: 1244: win_ptr->rma_ops_list = NULL; 1977: -: 1245: 1978: #####: 1246: mpi_errno = NMPI_Group_free(&win_grp); 1984: -: 1248: 1985: -: 1249: /* free the group stored in window */ 1986: #####: 1250: MPIR_Group_release(win_ptr->start_group_ptr); 1987: call 0 never executed 1988: #####: 1251: win_ptr->start_group_ptr = NULL; 1989: -: 1252: 1990: #####: 1253: fn_exit: 1991: #####: 1254: if (nest_level_inc) 1993: branch 1 never executed 1994: -: 1255: { 1995: #####: 1256: MPIR_Nest_decr(); 1996: -: 1257: } 1997: #####: 1258: MPIU_CHKLMEM_FREEALL(); 2000: branch 1 never executed 2001: branch 2 never executed 2002: #####: 1260: return mpi_errno; 2015: -: 1273:int MPIDI_Win_wait(MPID_Win *win_ptr) 2016: function MPIDI_Win_wait called 0 returned 0% blocks executed 0% 2017: #####: 1274:{ 2018: #####: 1275: int mpi_errno=MPI_SUCCESS; 2023: -: 1280: 2024: -: 1281: /* wait for all operations from other processes to finish */ 2025: #####: 1282: if (win_ptr->my_counter) 2029: -: 1284: MPID_Progress_state progress_state; 2030: -: 1285: 2031: #####: 1286: MPID_Progress_start(&progress_state); 2032: #####: 1287: while (win_ptr->my_counter) 2034: branch 1 never executed 2035: -: 1288: { 2036: #####: 1289: mpi_errno = MPID_Progress_wait(&progress_state); 2051: -: 1300: } 2052: -: 1301: 2053: #####: 1303: return mpi_errno; 2060: -: 1310:int MPIDI_Win_test(MPID_Win *win_ptr, int *flag) 2061: function MPIDI_Win_test called 0 returned 0% blocks executed 0% 2062: #####: 1311:{ 2063: #####: 1312: int mpi_errno=MPI_SUCCESS; 2067: -: 1316: MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_TEST); 2068: -: 1317: 2069: #####: 1318: mpi_errno = MPID_Progress_test(); 2070: call 0 never executed 2071: #####: 1319: if (mpi_errno != MPI_SUCCESS) { 2076: -: 1321: } 2077: -: 1322: 2078: #####: 1323: *flag = (win_ptr->my_counter) ? 0 : 1; 2080: #####: 1323: *flag = (win_ptr->my_counter) ? 0 : 1; 2081: -: 1324: 2082: #####: 1327: return mpi_errno; 2092: -: 1337:int MPIDI_Win_lock(int lock_type, int dest, int assert, MPID_Win *win_ptr) 2093: function MPIDI_Win_lock called 0 returned 0% blocks executed 0% 2094: #####: 1338:{ 2095: #####: 1339: int mpi_errno = MPI_SUCCESS; 2096: -: 1340: MPIDI_RMA_ops *new_ptr; 2097: -: 1341: MPID_Comm *comm_ptr; 2098: #####: 1342: MPIU_CHKPMEM_DECL(1); 2111: -: 1355:#endif 2112: -: 1356: 2113: #####: 1357: if (dest == MPI_PROC_NULL) goto fn_exit; 2115: branch 1 never executed 2116: -: 1358: 2117: #####: 1359: MPID_Comm_get_ptr( win_ptr->comm, comm_ptr ); 2122: call 4 never executed 2123: -: 1360: 2124: #####: 1361: if (dest == comm_ptr->rank) { 2129: -: 1364: 2130: -: 1365: /* poke the progress engine until lock is granted */ 2131: #####: 1366: if (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_type) == 0) 2136: -: 1368: MPID_Progress_state progress_state; 2137: -: 1369: 2138: #####: 1370: MPID_Progress_start(&progress_state); 2139: #####: 1371: while (MPIDI_CH3I_Try_acquire_win_lock(win_ptr, lock_type) == 0) 2142: branch 2 never executed 2143: -: 1372: { 2144: #####: 1373: mpi_errno = MPID_Progress_wait(&progress_state); 2163: -: 1388: /* target is some other process. add the lock request to rma_ops_list */ 2164: -: 1389: 2165: #####: 1390: MPIU_CHKPMEM_MALLOC(new_ptr, MPIDI_RMA_ops *, sizeof(MPIDI_RMA_ops), 2174: -: 1391: mpi_errno, "RMA operation entry"); 2175: -: 1392: 2176: #####: 1393: win_ptr->rma_ops_list = new_ptr; 2177: -: 1394: 2178: #####: 1395: new_ptr->next = NULL; 2179: #####: 1396: new_ptr->type = MPIDI_RMA_LOCK; 2180: #####: 1397: new_ptr->target_rank = dest; 2181: #####: 1398: new_ptr->lock_type = lock_type; 2182: -: 1399: } 2183: -: 1400: 2184: #####: 1401: fn_exit: 2185: #####: 1401: fn_exit: 2186: #####: 1403: return mpi_errno; 2201: -: 1415:int MPIDI_Win_unlock(int dest, MPID_Win *win_ptr) 2202: function MPIDI_Win_unlock called 0 returned 0% blocks executed 0% 2203: #####: 1416:{ 2204: #####: 1417: int mpi_errno=MPI_SUCCESS; 2206: -: 1419: MPIDI_RMA_ops *rma_op, *curr_op; 2207: -: 1420: MPID_Comm *comm_ptr; 2208: #####: 1421: MPID_Request *req=NULL; 2209: -: 1422: MPIDI_CH3_Pkt_t upkt; 2210: #####: 1423: MPIDI_CH3_Pkt_lock_t *lock_pkt = &upkt.lock; 2211: -: 1424: MPIDI_VC_t * vc; 2212: #####: 1425: int wait_for_rma_done_pkt = 0, predefined; 2214: -: 1427: MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_WIN_UNLOCK); 2215: -: 1428: 2216: #####: 1429: if (dest == MPI_PROC_NULL) goto fn_exit; 2218: branch 1 never executed 2219: -: 1430: 2220: #####: 1431: MPID_Comm_get_ptr( win_ptr->comm, comm_ptr ); 2225: call 4 never executed 2226: -: 1432: 2227: #####: 1433: if (dest == comm_ptr->rank) { 2230: -: 1434: /* local lock. release the lock on the window, grant the next one 2231: -: 1435: * in the queue, and return. */ 2232: #####: 1436: mpi_errno = MPIDI_CH3I_Release_lock(win_ptr); 2233: call 0 never executed 2234: #####: 1437: if (mpi_errno != MPI_SUCCESS) goto fn_exit; 2235: branch 0 never executed 2236: branch 1 never executed 2237: #####: 1438: mpi_errno = MPID_Progress_poke(); 2238: call 0 never executed 2239: #####: 1439: goto fn_exit; 2240: -: 1440: } 2241: -: 1441: 2242: #####: 1442: rma_op = win_ptr->rma_ops_list; 2243: -: 1443: 2244: -: 1444: /* win_lock was not called. return error */ 2245: #####: 1445: if ( (rma_op == NULL) || (rma_op->type != MPIDI_RMA_LOCK) ) { 2252: -: 1447: } 2253: -: 1448: 2254: #####: 1449: if (rma_op->target_rank != dest) { 2261: -: 1453: } 2262: -: 1454: 2263: #####: 1455: if (rma_op->next == NULL) { 2265: branch 1 never executed 2266: -: 1456: /* only win_lock called, no put/get/acc. Do nothing and return. */ 2267: #####: 1457: MPIU_Free(rma_op); 2268: call 0 never executed 2269: #####: 1458: win_ptr->rma_ops_list = NULL; 2270: #####: 1459: goto fn_exit; 2271: -: 1460: } 2272: -: 1461: 2273: #####: 1462: single_op_opt = 0; 2274: -: 1463: 2275: #####: 1464: MPIDI_Comm_get_vc_set_active(comm_ptr, dest, &vc); 2277: branch 1 never executed 2278: -: 1465: 2279: #####: 1466: if (rma_op->next->next == NULL) { 2286: -: 1471: * request first. */ 2287: -: 1472: 2288: #####: 1473: curr_op = rma_op->next; 2289: -: 1474: 2290: #####: 1475: MPID_Datatype_get_size_macro(curr_op->origin_datatype, type_size); 2295: call 4 never executed 2296: -: 1476: 2297: #####: 1477: MPIDI_CH3I_DATATYPE_IS_PREDEFINED(curr_op->target_datatype, predefined); 2309: branch 11 never executed 2310: -: 1478: 2311: #####: 1479: if ( predefined && 2315: branch 3 never executed 2316: -: 1480: (type_size * curr_op->origin_count <= vc->eager_max_msg_sz) ) { 2317: #####: 1481: single_op_opt = 1; 2318: -: 1482: /* Set the lock granted flag to 1 */ 2319: #####: 1483: win_ptr->lock_granted = 1; 2320: #####: 1484: if (curr_op->type == MPIDI_RMA_GET) { 2321: branch 0 never executed 2322: branch 1 never executed 2323: #####: 1485: mpi_errno = MPIDI_CH3I_Send_lock_get(win_ptr); 2324: call 0 never executed 2325: #####: 1486: wait_for_rma_done_pkt = 0; 2326: -: 1487: } 2327: -: 1488: else { 2328: #####: 1489: mpi_errno = MPIDI_CH3I_Send_lock_put_or_acc(win_ptr); 2329: call 0 never executed 2330: #####: 1490: wait_for_rma_done_pkt = 1; 2337: -: 1494: } 2338: -: 1495: 2339: #####: 1496: if (single_op_opt == 0) { 2344: -: 1499: * reply. then do all the RMA ops. */ 2345: -: 1500: 2346: #####: 1501: MPIDI_Pkt_init(lock_pkt, MPIDI_CH3_PKT_LOCK); 2347: #####: 1502: lock_pkt->target_win_handle = win_ptr->all_win_handles[dest]; 2348: #####: 1503: lock_pkt->source_win_handle = win_ptr->handle; 2349: #####: 1504: lock_pkt->lock_type = rma_op->lock_type; 2350: -: 1505: 2351: -: 1506: /* Set the lock granted flag to 0 */ 2352: #####: 1507: win_ptr->lock_granted = 0; 2353: -: 1508: 2354: -: 1509: MPIU_THREAD_CS_ENTER(CH3COMM,vc); 2355: #####: 1510: mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, lock_pkt, sizeof(*lock_pkt), &req)); 2356: call 0 never executed 2357: -: 1511: MPIU_THREAD_CS_EXIT(CH3COMM,vc); 2358: #####: 1512: if (mpi_errno != MPI_SUCCESS) { 2364: -: 1515: 2365: -: 1516: /* release the request returned by iStartMsg */ 2366: #####: 1517: if (req != NULL) 2368: branch 1 never executed 2369: -: 1518: { 2370: #####: 1519: MPID_Request_release(req); 2384: -: 1526: 2385: -: 1527: /* poke the progress engine until lock_granted flag is set to 1 */ 2386: #####: 1528: if (win_ptr->lock_granted == 0) 2390: -: 1530: MPID_Progress_state progress_state; 2391: -: 1531: 2392: #####: 1532: MPID_Progress_start(&progress_state); 2393: #####: 1533: while (win_ptr->lock_granted == 0) 2395: branch 1 never executed 2396: -: 1534: { 2397: #####: 1535: mpi_errno = MPID_Progress_wait(&progress_state); 2411: -: 1545: 2412: -: 1546: /* Now do all the RMA operations */ 2413: #####: 1547: mpi_errno = MPIDI_CH3I_Do_passive_target_rma(win_ptr, 2423: -: 1553: optimization, we need to wait until the target informs us that 2424: -: 1554: all operations are done on the target. */ 2425: #####: 1555: if (wait_for_rma_done_pkt == 1) { 2431: -: 1559: 2432: -: 1560: /* poke the progress engine until lock_granted flag is reset to 0 */ 2433: #####: 1561: if (win_ptr->lock_granted != 0) 2437: -: 1563: MPID_Progress_state progress_state; 2438: -: 1564: 2439: #####: 1565: MPID_Progress_start(&progress_state); 2440: #####: 1566: while (win_ptr->lock_granted != 0) 2442: branch 1 never executed 2443: -: 1567: { 2444: #####: 1568: mpi_errno = MPID_Progress_wait(&progress_state); 2458: -: 1578: } 2459: -: 1579: else 2460: #####: 1580: win_ptr->lock_granted = 0; 2461: -: 1581: 2462: #####: 1582: fn_exit: 2463: #####: 1582: fn_exit: 2464: #####: 1584: return mpi_errno; 2477: -: 1597: int *wait_for_rma_done_pkt) 2478: function MPIDI_CH3I_Do_passive_target_rma called 0 returned 0% blocks executed 0% 2479: #####: 1598:{ 2480: #####: 1599: int mpi_errno = MPI_SUCCESS, done, i, nops; 2481: -: 1600: MPIDI_RMA_ops *curr_ptr, *next_ptr, **curr_ptr_ptr, *tmp_ptr; 2482: -: 1601: MPID_Comm *comm_ptr; 2483: #####: 1602: MPID_Request **requests=NULL; /* array of requests */ 2484: #####: 1603: MPIDI_RMA_dtype_info *dtype_infos=NULL; 2485: #####: 1604: void **dataloops=NULL; /* to store dataloops for each datatype */ 2486: -: 1605: MPI_Win source_win_handle, target_win_handle; 2487: #####: 1606: MPIU_CHKLMEM_DECL(3); 2490: -: 1609: MPIDI_RMA_FUNC_ENTER(MPID_STATE_MPIDI_CH3I_DO_PASSIVE_TARGET_RMA); 2491: -: 1610: 2492: #####: 1611: if (win_ptr->rma_ops_list->lock_type == MPI_LOCK_EXCLUSIVE) { 2494: branch 1 never execu