/* * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2005 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ #include "opal_config.h" #include "opal/constants.h" #include #include #include #include "opal/runtime/opal.h" #include "opal/dss/dss.h" #define NUM_ITERS 100 #define NUM_ELEMS 1024 static bool test1(void); /* verify dss_copy_payload */ static bool test2(void); /* verify dss_xfer_payload */ FILE *test_out; int main (int argc, char* argv[]) { opal_init(); test_out = stderr; /* run the tests */ fprintf(test_out, "executing test1\n"); if (test1()) { fprintf(test_out, "Test1 succeeded\n"); } else { fprintf(test_out, "Test1 failed\n"); } fprintf(test_out, "executing test2\n"); if (test2()) { fprintf(test_out, "Test2 succeeded\n"); } else { fprintf(test_out, "Test2 failed\n"); } opal_finalize(); return(0); } static bool test1(void) /* verify dss_copy_payload */ { opal_buffer_t *bufA, *bufB; int rc; int32_t i; int16_t src[NUM_ELEMS]; int16_t dst[NUM_ELEMS]; int32_t src32[NUM_ELEMS]; int32_t dst32[NUM_ELEMS]; /* init src arrays */ for (i=0; i < NUM_ELEMS; i++) { src[i] = i; src32[i] = 132 * i; } /* init A */ bufA = OBJ_NEW(opal_buffer_t); if (NULL == bufA) { fprintf(test_out, "orte_buffer failed init in OBJ_NEW\n"); return false; } opal_dss.set_buffer_type(bufA, OPAL_DSS_BUFFER_NON_DESC); /* pack something in A */ for (i=0;i