File: utils.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 (97 lines) | stat: -rw-r--r-- 3,104 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
 * Copyright (c) 2015-2018 Intel, Inc.  All rights reserved.
 * Copyright (c) 2015-2018 Mellanox Technologies, Inc.
 *                         All rights reserved.
 * Copyright (c) 2016      Research Organization for Information Science
 *                         and Technology (RIST). All rights reserved.
 * Copyright (c) 2021-2022 Nanook Consulting  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 *
 */

#include "utils.h"
#include "cli_stages.h"
#include "pmix_server.h"
#include "test_common.h"
#include "test_server.h"

void set_client_argv(test_params *params, char ***argv)
{
    PMIx_Argv_append_nosize(argv, params->binary);
    PMIx_Argv_append_nosize(argv, "-n");
    if (NULL == params->np) {
        PMIx_Argv_append_nosize(argv, "1");
    } else {
        PMIx_Argv_append_nosize(argv, params->np);
    }
    if (params->verbose) {
        PMIx_Argv_append_nosize(argv, "-v");
    }
    if (NULL != params->prefix) {
        PMIx_Argv_append_nosize(argv, "-o");
        PMIx_Argv_append_nosize(argv, params->prefix);
    }
    if (params->early_fail) {
        PMIx_Argv_append_nosize(argv, "--early-fail");
    }
    if (NULL != params->fences) {
        PMIx_Argv_append_nosize(argv, "--fence");
        PMIx_Argv_append_nosize(argv, params->fences);
        if (params->use_same_keys) {
            PMIx_Argv_append_nosize(argv, "--use-same-keys");
        }
    }
    if (params->test_job_fence) {
        PMIx_Argv_append_nosize(argv, "--job-fence");
        if (params->nonblocking) {
            PMIx_Argv_append_nosize(argv, "-nb");
        }
        if (params->collect) {
            PMIx_Argv_append_nosize(argv, "-c");
        }
        if (params->collect_bad) {
            PMIx_Argv_append_nosize(argv, "--collect-corrupt");
        }
    }
    if (NULL != params->noise) {
        PMIx_Argv_append_nosize(argv, "--noise");
        PMIx_Argv_append_nosize(argv, params->noise);
    }
    if (NULL != params->ns_dist) {
        PMIx_Argv_append_nosize(argv, "--ns-dist");
        PMIx_Argv_append_nosize(argv, params->ns_dist);
    }
    if (params->test_publish) {
        PMIx_Argv_append_nosize(argv, "--test-publish");
    }
    if (params->test_spawn) {
        PMIx_Argv_append_nosize(argv, "--test-spawn");
    }
    if (params->test_connect) {
        PMIx_Argv_append_nosize(argv, "--test-connect");
    }
    if (params->test_resolve_peers) {
        PMIx_Argv_append_nosize(argv, "--test-resolve-peers");
    }
    if (params->test_error) {
        PMIx_Argv_append_nosize(argv, "--test-error");
    }
    if (params->key_replace) {
        PMIx_Argv_append_nosize(argv, "--test-replace");
        PMIx_Argv_append_nosize(argv, params->key_replace);
    }
    if (params->test_internal) {
        char tmp[32];
        snprintf(tmp, 32, "%d", params->test_internal);
        PMIx_Argv_append_nosize(argv, "--test-internal");
        PMIx_Argv_append_nosize(argv, tmp);
    }
    if (params->gds_mode) {
        PMIx_Argv_append_nosize(argv, "--gds");
        PMIx_Argv_append_nosize(argv, params->gds_mode);
    }
}