File: test_init_fin.c

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (46 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2020-21   Triad National Security, LLC.
 *                         All rights reserved.
 *
 * Copyright (c) 2021      Nanook Consulting.  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

/* Basic test of PMIx_* functionality: Init, Finalize (in a loop) */

#include "pmix.h"
#include "test_common.h"

#define LOOPMAX 1000

int main(int argc, char *argv[])
{

    pmix_proc_t this_proc;
    size_t i, ninfo = 0;
    test_params l_params;
    validation_params v_params;
    //int (*fnptr)() = NULL;

    for (i = 0; i < LOOPMAX; i++) {
        /* Handles all setup that's required prior to calling PMIx_Init() */
        pmixt_pre_init(argc, argv, &l_params, &v_params, NULL);

        /* initialization */
        PMIXT_CHECK(PMIx_Init(&this_proc, NULL, ninfo), l_params, v_params);

        /* Handles everything that needs to happen after PMIx_Init() */
        pmixt_post_init(&this_proc, &l_params, &v_params);

        /* finalize */
        PMIXT_CHECK(PMIx_Finalize(NULL, 0), l_params, v_params);

        /* Handles cleanup */
        pmixt_post_finalize(&this_proc, &l_params, &v_params);
    }

}