root/opal/mca/pmix/pmix4x/pmix/test/cli_stages.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2015-2019 Intel, Inc.  All rights reserved.
   4  * Copyright (c) 2015      Research Organization for Information Science
   5  *                         and Technology (RIST). All rights reserved.
   6  * Copyright (c) 2015-2018 Mellanox Technologies, Inc.
   7  *                         All rights reserved.
   8  * $COPYRIGHT$
   9  *
  10  * Additional copyrights may follow
  11  *
  12  * $HEADER$
  13  */
  14 
  15 #ifndef CLI_STAGES_H
  16 #define CLI_STAGES_H
  17 
  18 #include <src/include/pmix_config.h>
  19 #include <signal.h>
  20 #include <fcntl.h>
  21 #include <sys/types.h>
  22 #include <sys/socket.h>
  23 #include <sys/stat.h>
  24 #include <sys/un.h>
  25 #include <sys/wait.h>
  26 #include <sys/time.h>
  27 #include <time.h>
  28 #include <errno.h>
  29 #include "src/include/pmix_globals.h"
  30 #include "pmix_server.h"
  31 #include "src/class/pmix_list.h"
  32 #include "src/mca/ptl/base/base.h"
  33 
  34 #include "test_common.h"
  35 
  36 // In correct scenario each client has to sequentially pass all of this stages
  37 typedef enum {
  38     CLI_UNINIT, CLI_FORKED, CLI_CONNECTED, CLI_FIN, CLI_DISCONN, CLI_TERM, CLI_UNDEF
  39 } cli_state_t;
  40 
  41 typedef struct {
  42     pmix_list_t modex;
  43     pid_t pid;
  44     int sd;
  45     pmix_event_t *ev;
  46     cli_state_t state;
  47     cli_state_t next_state[CLI_TERM+1];
  48     pmix_rank_t rank;
  49     char *ns;
  50 } cli_info_t;
  51 
  52 extern cli_info_t *cli_info;
  53 extern int cli_info_cnt;
  54 extern bool test_abort;
  55 
  56 int cli_rank(cli_info_t *cli);
  57 void cli_init(int nprocs);
  58 void cli_connect(cli_info_t *cli, int sd, struct event_base * ebase, event_callback_fn callback);
  59 void cli_finalize(cli_info_t *cli);
  60 void cli_disconnect(cli_info_t *cli);
  61 void cli_terminate(cli_info_t *cli);
  62 void cli_cleanup(cli_info_t *cli);
  63 void cli_wait_all(double timeout);
  64 void cli_kill_all(void);
  65 
  66 bool test_terminated(void);
  67 
  68 void errhandler(size_t evhdlr_registration_id,
  69                 pmix_status_t status,
  70                 const pmix_proc_t *source,
  71                 pmix_info_t info[], size_t ninfo,
  72                 pmix_info_t results[], size_t nresults,
  73                 pmix_event_notification_cbfunc_fn_t cbfunc,
  74                 void *cbdata);
  75 
  76 void op_callbk(pmix_status_t status,
  77                void *cbdata);
  78 
  79 void errhandler_reg_callbk (pmix_status_t status,
  80                             size_t errhandler_ref,
  81                             void *cbdata);
  82 
  83 #endif // CLI_STAGES_H

/* [<][>][^][v][top][bottom][index][help] */