2 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3 * University Research and Technology
4 * Corporation. All rights reserved.
5 * Copyright (c) 2004-2005 The University of Tennessee and The University
6 * of Tennessee Research Foundation. All rights
8 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9 * University of Stuttgart. All rights reserved.
10 * Copyright (c) 2004-2005 The Regents of the University of California.
11 * All rights reserved.
14 * Additional copyrights may follow
19 #include "orte_config.h"
20 #include "orte/orte_constants.h"
21 #include "orte/orte_types.h"
27 #ifdef HAVE_SYS_PARAM_H
28 #include <sys/param.h>
30 #ifdef HAVE_NETINET_IN_H
31 #include <netinet/in.h>
34 #include "opal/runtime/opal.h"
35 #include "orte/util/proc_info.h"
36 #include "orte/mca/errmgr/errmgr.h"
38 #include "orte/dss/dss.h"
41 #define NUM_ELEMS 1024
43 static bool test1(void); /* verify different buffer inits */
44 static bool test2(void); /* verify int16 */
45 static bool test3(void); /* verify int */
46 static bool test4(void); /* verify int32 */
47 static bool test5(void); /* verify int64 */
48 static bool test6(void); /* verify string */
49 static bool test7(void); /* verify BOOL */
50 static bool test8(void); /* verify OBJECT */
51 static bool test9(void); /* verify composite (multiple types and element counts) */
52 static bool test10(void); /* verify KEYVAL */
53 static bool test11(void); /* verify size_t */
54 static bool test12(void); /* verify pid_t */
59 int main (int argc
, char* argv
[])
65 /* register handler for errnum -> string converstion */
66 opal_error_register("ORTE", ORTE_ERR_BASE
, ORTE_ERR_MAX
, orte_err2str
);
70 /* Ensure the process info structure is instantiated and initialized */
71 if (ORTE_SUCCESS
!= (ret
= orte_proc_info())) {
75 orte_process_info
.seed
= true;
76 orte_process_info
.my_name
= (orte_process_name_t
*)malloc(sizeof(orte_process_name_t
));
77 orte_process_info
.my_name
->cellid
= 0;
78 orte_process_info
.my_name
->jobid
= 0;
79 orte_process_info
.my_name
->vpid
= 0;
83 if (ORTE_SUCCESS
== orte_dss_open()) {
84 fprintf(test_out
, "DSS started\n");
86 fprintf(test_out
, "DSS could not start\n");
92 fprintf(test_out
, "executing test1\n");
94 fprintf(test_out
, "Test1 succeeded\n");
97 fprintf(test_out
, "Test1 failed\n");
100 fprintf(test_out
, "executing test2\n");
102 fprintf(test_out
, "Test2 succeeded\n");
105 fprintf(test_out
, "Test2 failed\n");
108 fprintf(test_out
, "executing test3\n");
110 fprintf(test_out
, "Test3 succeeded\n");
113 fprintf(test_out
, "Test3 failed\n");
116 fprintf(test_out
, "executing test4\n");
118 fprintf(test_out
, "Test4 succeeded\n");
121 fprintf(test_out
, "Test4 failed\n");
124 fprintf(test_out
, "executing test5\n");
126 fprintf(test_out
, "Test5 succeeded\n");
129 fprintf(test_out
, "Test5 failed\n");
132 fprintf(test_out
, "executing test6\n");
134 fprintf(test_out
, "Test6 succeeded\n");
137 fprintf(test_out
, "Test6 failed\n");
140 fprintf(test_out
, "executing test7\n");
142 fprintf(test_out
, "Test7 succeeded\n");
145 fprintf(test_out
, "Test7 failed\n");
148 fprintf(test_out
, "executing test8\n");
150 fprintf(test_out
, "Test8 succeeded\n");
153 fprintf(test_out
, "Test8 failed\n");
156 fprintf(test_out
, "executing test9\n");
158 fprintf(test_out
, "Test9 succeeded\n");
161 fprintf(test_out
, "orte_dss test9 failed\n");
164 fprintf(test_out
, "executing test10\n");
166 fprintf(test_out
, "Test10 succeeded\n");
169 fprintf(test_out
, "orte_dss test10 failed\n");
172 fprintf(test_out
, "executing test11\n");
174 fprintf(test_out
, "Test11 succeeded\n");
177 fprintf(test_out
, "orte_dss test11 failed\n");
180 fprintf(test_out
, "executing test12\n");
182 fprintf(test_out
, "Test12 succeeded\n");
185 fprintf(test_out
, "orte_dss test12 failed\n");
197 static bool test1(void) /* verify different buffer inits */
201 bufA
= OBJ_NEW(orte_buffer_t
);
203 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
209 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
216 * OMPI_INT16 pack/unpack
218 static bool test2(void)
223 int16_t src
[NUM_ELEMS
];
224 int16_t dst
[NUM_ELEMS
];
226 for(i
=0; i
<NUM_ELEMS
; i
++)
229 bufA
= OBJ_NEW(orte_buffer_t
);
231 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
235 for (i
=0;i
<NUM_ITERS
;i
++) {
236 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_INT16
);
237 if (ORTE_SUCCESS
!= rc
) {
238 fprintf(test_out
, "orte_dss.pack failed with return code %d\n", rc
);
243 for (i
=0; i
<NUM_ITERS
; i
++) {
247 for(j
=0; j
<NUM_ELEMS
; j
++)
251 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_INT16
);
252 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
253 fprintf(test_out
, "orte_dss.unpack failed with return code %d\n", rc
);
257 for(j
=0; j
<NUM_ELEMS
; j
++) {
258 if(src
[j
] != dst
[j
]) {
259 fprintf(test_out
, "test2: invalid results from unpack\n");
267 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
275 * OMPI_INT pack/unpack
277 static bool test3(void)
285 for(i
=0; i
<NUM_ELEMS
; i
++)
288 bufA
= OBJ_NEW(orte_buffer_t
);
290 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
294 for (i
=0;i
<NUM_ITERS
;i
++) {
295 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_INT
);
296 if (ORTE_SUCCESS
!= rc
) {
297 fprintf(test_out
, "orte_dss.pack failed with return code %d\n", rc
);
302 for (i
=0; i
<NUM_ITERS
; i
++) {
306 for(j
=0; j
<NUM_ELEMS
; j
++)
310 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_INT
);
311 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
312 fprintf(test_out
, "orte_dss.unpack failed with return code %d\n", rc
);
316 for(j
=0; j
<NUM_ELEMS
; j
++) {
317 if(src
[j
] != dst
[j
]) {
318 fprintf(test_out
, "test2: invalid results from unpack\n");
326 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
334 * OMPI_INT32 pack/unpack
336 static bool test4(void)
341 int32_t src
[NUM_ELEMS
];
342 int32_t dst
[NUM_ELEMS
];
344 for(i
=0; i
<NUM_ELEMS
; i
++)
347 bufA
= OBJ_NEW(orte_buffer_t
);
349 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
353 for (i
=0;i
<NUM_ITERS
;i
++) {
354 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_INT32
);
355 if (ORTE_SUCCESS
!= rc
) {
356 fprintf(test_out
, "orte_dss.pack failed with return code %d\n", rc
);
361 for (i
=0; i
<NUM_ITERS
; i
++) {
363 size_t count
= NUM_ELEMS
;
365 for(j
=0; j
<NUM_ELEMS
; j
++)
368 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_INT32
);
369 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
370 fprintf(test_out
, "orte_dss.unpack failed with return code %d\n", rc
);
374 for(j
=0; j
<NUM_ELEMS
; j
++) {
375 if(src
[j
] != dst
[j
]) {
376 fprintf(test_out
, "test2: invalid results from unpack\n");
384 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
392 * ORTE_INT64 pack/unpack
394 static bool test5(void)
399 int64_t src
[NUM_ELEMS
];
400 int64_t dst
[NUM_ELEMS
];
402 for(i
=0; i
<NUM_ELEMS
; i
++)
405 bufA
= OBJ_NEW(orte_buffer_t
);
407 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
411 for (i
=0;i
<NUM_ITERS
;i
++) {
412 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_INT64
);
413 if (ORTE_SUCCESS
!= rc
) {
414 fprintf(test_out
, "orte_dss.pack int64 failed with return code %d\n", rc
);
419 for (i
=0; i
<NUM_ITERS
; i
++) {
421 size_t count
= NUM_ELEMS
;
423 for(j
=0; j
<NUM_ELEMS
; j
++)
426 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_INT64
);
427 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
428 fprintf(test_out
, "orte_dss.unpack int64 failed with return code %d\n", rc
);
432 for(j
=0; j
<NUM_ELEMS
; j
++) {
433 if(src
[j
] != dst
[j
]) {
434 fprintf(test_out
, "test2: invalid results from unpack int64\n");
442 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
450 * OMPI_STRING pack/unpack
453 static bool test6(void)
458 char* src
[NUM_ELEMS
];
459 char* dst
[NUM_ELEMS
];
461 for(i
=0; i
<NUM_ELEMS
; i
++) {
462 asprintf(&src
[i
], "%d", i
);
465 bufA
= OBJ_NEW(orte_buffer_t
);
467 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
471 for (i
=0;i
<NUM_ITERS
;i
++) {
472 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_STRING
);
473 if (ORTE_SUCCESS
!= rc
) {
474 fprintf(test_out
, "orte_dss.pack failed with return code %d\n", rc
);
479 for (i
=0; i
<NUM_ITERS
; i
++) {
481 size_t count
= NUM_ELEMS
;
483 for(j
=0; j
<NUM_ELEMS
; j
++)
486 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_STRING
);
487 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
488 fprintf(test_out
, "orte_dss.unpack failed with return code %d\n", rc
);
492 for(j
=0; j
<NUM_ELEMS
; j
++) {
493 if(strcmp(src
[j
],dst
[j
]) != 0) {
494 fprintf(test_out
, "test4: invalid results from unpack\n");
495 fprintf(test_out
, "item %d src=[%s] len=%d dst=[%s] len=%d\n", j
, src
[j
], (int)strlen(src
[j
]), dst
[j
], (int)strlen(dst
[j
]));
503 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
512 * OMPI_BOOL pack/unpack
515 static bool test7(void)
523 for(i
=0; i
<NUM_ELEMS
; i
++)
524 src
[i
] = ((i
% 2) == 0) ? true : false;
526 bufA
= OBJ_NEW(orte_buffer_t
);
528 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
532 for (i
=0;i
<NUM_ITERS
;i
++) {
533 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_BOOL
);
534 if (ORTE_SUCCESS
!= rc
) {
535 fprintf(test_out
, "orte_dss.pack failed with return code %d\n", rc
);
540 for (i
=0; i
<NUM_ITERS
; i
++) {
542 size_t count
= NUM_ELEMS
;
543 memset(dst
,-1,sizeof(dst
));
545 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_BOOL
);
546 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
547 fprintf(test_out
, "orte_dss.unpack failed with return code %d\n", rc
);
551 for(j
=0; j
<NUM_ELEMS
; j
++) {
552 if(src
[j
] != dst
[j
]) {
553 fprintf(test_out
, "test6: invalid results from unpack\n");
561 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
569 * OMPI_BYTE_OBJECT pack/unpack
572 static bool test8(void)
578 orte_byte_object_t
*src
[NUM_ELEMS
];
579 orte_byte_object_t
*dst
[NUM_ELEMS
];
581 for(i
=0; i
<NUM_ELEMS
; i
++) {
582 src
[i
] = (orte_byte_object_t
*)malloc(sizeof(orte_byte_object_t
));
583 asprintf((char**)&(src
[i
]->bytes
), "%d", i
);
584 src
[i
]->size
= strlen((char*)(src
[i
]->bytes
)) + 1;
587 bufA
= OBJ_NEW(orte_buffer_t
);
589 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
593 for (i
=0;i
<NUM_ITERS
;i
++) {
594 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_BYTE_OBJECT
);
595 if (ORTE_SUCCESS
!= rc
) {
596 fprintf(test_out
, "orte_dss.pack failed with return code %d\n", rc
);
601 for (i
=0; i
<NUM_ITERS
; i
++) {
603 size_t count
= NUM_ELEMS
;
605 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_BYTE_OBJECT
);
606 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
607 fprintf(test_out
, "orte_dss.unpack failed with return code %d\n", rc
);
611 for(j
=0; j
<NUM_ELEMS
; j
++) {
612 if(src
[j
]->size
!= dst
[j
]->size
||
613 memcmp(src
[j
]->bytes
,dst
[j
]->bytes
,src
[j
]->size
) != 0) {
614 fprintf(test_out
, "test7: invalid results from unpack\n");
615 fprintf(test_out
, "test7: object element %d has incorrect unpacked value\n", j
);
624 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
632 * ompi everything composite multipack/unpack
635 static bool test9(void)
642 /* pack and unpack in this order */
643 /* each block now has an offset to make debugging easier.. first block=100, 200,... */
644 orte_byte_object_t
*srco
[NUM_ELEMS
];
645 orte_byte_object_t
*dsto
[NUM_ELEMS
];
646 char* srcs
[NUM_ELEMS
];
647 char* dsts
[NUM_ELEMS
];
648 bool srcb
[NUM_ELEMS
];
649 bool dstb
[NUM_ELEMS
];
650 int32_t src32
[NUM_ELEMS
];
651 int32_t dst32
[NUM_ELEMS
];
652 int16_t src16
[NUM_ELEMS
];
653 int16_t dst16
[NUM_ELEMS
];
655 for(i
=0; i
<NUM_ELEMS
; i
++) {
656 /* object offset 100 */
657 srco
[i
] = (orte_byte_object_t
*)malloc(sizeof(orte_byte_object_t
));
658 asprintf((char**)&(srco
[i
]->bytes
), "%d", i
+100);
659 srco
[i
]->size
= strlen((char*)(srco
[i
]->bytes
)) + 1;
662 asprintf(&srcs
[i
], "%d", i
+200);
665 srcb
[i
] = ((i
% 2) == 0) ? true : false;
674 bufA
= OBJ_NEW(orte_buffer_t
);
676 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
680 for (i
=0;i
<NUM_ITERS
;i
++) {
682 rc
= orte_dss
.pack(bufA
, srco
, NUM_ELEMS
, ORTE_BYTE_OBJECT
);
683 if (ORTE_SUCCESS
!= rc
) {
684 fprintf(test_out
, "orte_dss.pack on object failed with return code %d\n", rc
);
688 rc
= orte_dss
.pack(bufA
, srcs
, NUM_ELEMS
, ORTE_STRING
);
689 if (ORTE_SUCCESS
!= rc
) {
690 fprintf(test_out
, "orte_dss.pack on string failed with return code %d\n", rc
);
694 rc
= orte_dss
.pack(bufA
, srcb
, NUM_ELEMS
, ORTE_BOOL
);
695 if (ORTE_SUCCESS
!= rc
) {
696 fprintf(test_out
, "orte_dss.pack on bool failed with return code %d\n", rc
);
700 rc
= orte_dss
.pack(bufA
, src32
, NUM_ELEMS
, ORTE_INT32
);
701 if (ORTE_SUCCESS
!= rc
) {
702 fprintf(test_out
, "orte_dss.pack on INT32 failed with return code %d\n", rc
);
706 rc
= orte_dss
.pack(bufA
, src16
, NUM_ELEMS
, ORTE_INT16
);
707 if (ORTE_SUCCESS
!= rc
) {
708 fprintf(test_out
, "orte_dss.pack on INT16 failed with return code %d\n", rc
);
713 /* fprintf(test_out,"test8:packed buffer info for STRING with %d iterations %d elements each\n", NUM_ITERS, NUM_ELEMS); */
715 for (i
=0; i
<NUM_ITERS
; i
++) {
720 for(j
=0; j
<NUM_ELEMS
; j
++) dsts
[j
] = NULL
;
722 memset(dstb
,-1,sizeof(dstb
));
724 for(j
=0; j
<NUM_ELEMS
; j
++) dst32
[j
] = -1;
726 for(j
=0; j
<NUM_ELEMS
; j
++) dst16
[j
] = -1;
731 rc
= orte_dss
.unpack(bufA
, dsto
, &count
, ORTE_BYTE_OBJECT
);
732 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
733 fprintf(test_out
, "orte_dss.unpack on object failed with return code %d\n", rc
);
737 for(j
=0; j
<NUM_ELEMS
; j
++) {
738 if(srco
[j
]->size
!= dsto
[j
]->size
||
739 memcmp(srco
[j
]->bytes
,dsto
[j
]->bytes
,srco
[j
]->size
) != 0) {
740 fprintf(test_out
, "test8: object element %d has incorrect unpacked value\n", j
);
747 rc
= orte_dss
.unpack(bufA
, dsts
, &count
, ORTE_STRING
);
748 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
749 fprintf(test_out
, "orte_dss.unpack on string failed with return code %d\n", rc
);
753 for(j
=0; j
<NUM_ELEMS
; j
++) {
754 if(strcmp(srcs
[j
],dsts
[j
]) != 0) {
755 fprintf(test_out
, "test8: invalid results from unpack\n");
756 fprintf(test_out
, "item %d src=[%s] len=%d dst=[%s] len=%d\n", j
, srcs
[j
], (int)strlen(srcs
[j
]), dsts
[j
], (int)strlen(dsts
[j
]));
763 rc
= orte_dss
.unpack(bufA
, dstb
, &count
, ORTE_BOOL
);
764 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
765 fprintf(test_out
, "orte_dss.unpack on bool failed with return code %d\n", rc
);
769 for(j
=0; j
<NUM_ELEMS
; j
++) {
770 if(srcb
[j
] != dstb
[j
]) {
771 fprintf(test_out
, "test8: invalid results from unpack\n");
778 rc
= orte_dss
.unpack(bufA
, dst32
, &count
, ORTE_INT32
);
779 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
780 fprintf(test_out
, "orte_dss.unpack on int32 failed with return code %d\n", rc
);
784 for(j
=0; j
<NUM_ELEMS
; j
++) {
785 if(src32
[j
] != dst32
[j
]) {
786 fprintf(test_out
, "test8: invalid results from unpack\n");
793 rc
= orte_dss
.unpack(bufA
, dst16
, &count
, ORTE_INT16
);
794 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
795 fprintf(test_out
, "orte_dss.unpack on int16 failed with return code %d\n", rc
);
799 for(j
=0; j
<NUM_ELEMS
; j
++) {
800 if(src16
[j
] != dst16
[j
]) {
801 fprintf(test_out
, "test8: invalid results from unpack\n");
807 } /* per iteration */
811 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
818 /* ORTE_DATA_VALUE */
819 static bool test10(void)
824 int16_t i16
[NUM_ELEMS
];
825 orte_data_value_t
*src
[NUM_ELEMS
];
826 orte_data_value_t
*dst
[NUM_ELEMS
];
828 /* setup source array of data values */
829 for(i
=0; i
<NUM_ELEMS
; i
++) {
831 src
[i
] = OBJ_NEW(orte_data_value_t
);
832 src
[i
]->type
= ((i
% 2) == 0) ? ORTE_INT16
: ORTE_STRING
;
833 if (ORTE_INT16
== src
[i
]->type
)
834 src
[i
]->data
= &i16
[i
];
836 src
[i
]->data
= strdup("truly-a-dumb-test");
839 bufA
= OBJ_NEW(orte_buffer_t
);
841 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW\n");
845 for (i
=0;i
<NUM_ITERS
;i
++) {
846 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_DATA_VALUE
);
847 if (ORTE_SUCCESS
!= rc
) {
848 fprintf(test_out
, "orte_dss.pack failed with error code %d\n", rc
);
853 for (i
=0; i
<NUM_ITERS
; i
++) {
855 size_t count
= NUM_ELEMS
;
856 memset(dst
,-1,sizeof(dst
));
858 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_DATA_VALUE
);
859 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
861 "orte_dss.unpack (DATA_VALUE) failed on iteration %d with error code %d\n",
866 for(j
=0; j
<NUM_ELEMS
; j
++) {
867 if (src
[j
]->type
!= dst
[j
]->type
) {
868 fprintf(test_out
, "orte_dss.unpack (DATA_VALUE) invalid results type mismatch from unpack\n");
871 if (0 != orte_dss
.compare(src
[j
], dst
[j
], src
[j
]->type
)) {
872 fprintf(test_out
, "orte_dss.unpack (DATA_VALUE) invalid results value mismatch from unpack");
880 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");
889 static bool test11(void)
894 size_t src
[NUM_ELEMS
];
895 size_t dst
[NUM_ELEMS
];
897 for(i
=0; i
<NUM_ELEMS
; i
++)
900 bufA
= OBJ_NEW(orte_buffer_t
);
902 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW");
903 fprintf(test_out
, "OBJ_NEW failed\n");
907 for (i
=0;i
<NUM_ITERS
;i
++) {
908 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_SIZE
);
909 if (ORTE_SUCCESS
!= rc
) {
910 fprintf(test_out
, "orte_dss.pack size_t failed");
911 fprintf(test_out
, "orte_pack_size_t failed with return code %d\n", rc
);
916 for (i
=0; i
<NUM_ITERS
; i
++) {
921 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_SIZE
);
922 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
923 fprintf(test_out
, "orte_dss.unpack size_t failed");
924 fprintf(test_out
, "orte_unpack_size_t failed with return code %d\n", rc
);
928 for(j
=0; j
<NUM_ELEMS
; j
++) {
929 if(src
[j
] != dst
[j
]) {
930 fprintf(test_out
, "test2: invalid results from unpack size_t");
938 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer");
939 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer");
950 static bool test12(void)
955 pid_t src
[NUM_ELEMS
];
956 pid_t dst
[NUM_ELEMS
];
958 for(i
=0; i
<NUM_ELEMS
; i
++)
961 bufA
= OBJ_NEW(orte_buffer_t
);
963 fprintf(test_out
, "orte_buffer failed init in OBJ_NEW");
964 fprintf(test_out
, "OBJ_NEW failed\n");
968 for (i
=0;i
<NUM_ITERS
;i
++) {
969 rc
= orte_dss
.pack(bufA
, src
, NUM_ELEMS
, ORTE_PID
);
970 if (ORTE_SUCCESS
!= rc
) {
971 fprintf(test_out
, "orte_dss.pack failed");
972 fprintf(test_out
, "orte_pack pid_t failed with return code %d\n", rc
);
977 for (i
=0; i
<NUM_ITERS
; i
++) {
982 rc
= orte_dss
.unpack(bufA
, dst
, &count
, ORTE_PID
);
983 if (ORTE_SUCCESS
!= rc
|| count
!= NUM_ELEMS
) {
984 fprintf(test_out
, "orte_dss.unpack failed");
985 fprintf(test_out
, "orte_pack pid_t failed with return code %d\n", rc
);
989 for(j
=0; j
<NUM_ELEMS
; j
++) {
990 if(src
[j
] != dst
[j
]) {
991 fprintf(test_out
, "test2: invalid results from unpack");
999 fprintf(test_out
, "OBJ_RELEASE did not NULL the buffer pointer\n");