File: test_server.h

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • 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 (74 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download | duplicates (7)
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
/*
 * Copyright (c) 2018      Mellanox Technologies, Inc.
 *                         All rights reserved.
 *
 * Copyright (c) 2021      Nanook Consulting.  All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 *
 */

#ifndef TEST_SERVER_C
#define TEST_SERVER_C

#include "pmix_server.h"
#include "test_common.h"

typedef enum {
    CMD_BARRIER_REQUEST,
    CMD_BARRIER_RESPONSE,
    CMD_FENCE_CONTRIB,
    CMD_FENCE_COMPLETE,
    CMD_DMDX_REQUEST,
    CMD_DMDX_RESPONSE
} server_cmd_t;

typedef struct {
    int dst_id;
    int src_id;
    int cmd;
    size_t size;
} msg_hdr_t;

struct server_info_t {
    pmix_list_item_t super;
    char *hostname;
    pid_t pid;
    int idx;
    int rd_fd;
    int wr_fd;
    pmix_event_t *evread;
    pmix_lock_t lock;
    pmix_modex_cbfunc_t modex_cbfunc;
    void *cbdata;
};
typedef struct server_info_t server_info_t;
PMIX_EXPORT PMIX_CLASS_DECLARATION(server_info_t);

struct server_nspace_t {
    pmix_list_item_t super;
    char name[PMIX_MAX_NSLEN + 1];
    size_t ntasks; /* total number of tasks in this namespace */
    size_t ltasks; /* local */
    int *task_map;
};
typedef struct server_nspace_t server_nspace_t;
PMIX_EXPORT PMIX_CLASS_DECLARATION(server_nspace_t);

extern int my_server_id;
extern pmix_list_t *server_list;
extern server_info_t *my_server_info;
extern pmix_list_t *server_nspace;

int server_init(test_params *params);
int server_finalize(test_params *params, int local_fail);
int server_barrier(void);
int server_fence_contrib(char *data, size_t ndata, pmix_modex_cbfunc_t cbfunc, void *cbdata);
int server_dmdx_get(const char *nspace, int rank, pmix_modex_cbfunc_t cbfunc, void *cbdata);
int server_launch_clients(int local_size, int univ_size, int base_rank, test_params *params,
                          char ***client_env, char ***base_argv);

#endif // TEST_SERVER_C