root/opal/mca/pmix/pmix4x/pmix/src/mca/pnet/base/base.h

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

INCLUDED FROM


   1 /* -*- C -*-
   2  *
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2006 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2012      Los Alamos National Security, Inc.  All rights reserved.
  14  * Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
  15  * Copyright (c) 2015      Research Organization for Information Science
  16  *                         and Technology (RIST). All rights reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  *
  23  */
  24 #ifndef PMIX_PNET_BASE_H_
  25 #define PMIX_PNET_BASE_H_
  26 
  27 #include <src/include/pmix_config.h>
  28 
  29 
  30 #ifdef HAVE_SYS_TIME_H
  31 #include <sys/time.h> /* for struct timeval */
  32 #endif
  33 #ifdef HAVE_STRING_H
  34 #include <string.h>
  35 #endif
  36 
  37 #include "src/class/pmix_list.h"
  38 #include "src/class/pmix_pointer_array.h"
  39 #include "src/mca/mca.h"
  40 #include "src/mca/base/pmix_mca_base_framework.h"
  41 
  42 #include "src/mca/pnet/pnet.h"
  43 
  44 
  45 BEGIN_C_DECLS
  46 
  47 /*
  48  * MCA Framework
  49  */
  50 PMIX_EXPORT extern pmix_mca_base_framework_t pmix_pnet_base_framework;
  51 /**
  52  * PNET select function
  53  *
  54  * Cycle across available components and construct the list
  55  * of active modules
  56  */
  57 PMIX_EXPORT pmix_status_t pmix_pnet_base_select(void);
  58 
  59 /**
  60  * Track an active component / module
  61  */
  62 struct pmix_pnet_base_active_module_t {
  63     pmix_list_item_t super;
  64     int pri;
  65     pmix_pnet_module_t *module;
  66     pmix_pnet_base_component_t *component;
  67 };
  68 typedef struct pmix_pnet_base_active_module_t pmix_pnet_base_active_module_t;
  69 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_base_active_module_t);
  70 
  71 typedef struct {
  72     pmix_list_item_t super;
  73     char *nspace;
  74     pmix_rank_t *ranks;
  75     size_t np;
  76 } pmix_pnet_local_procs_t;
  77 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_local_procs_t);
  78 
  79 typedef struct {
  80     pmix_list_item_t super;
  81     char *name;
  82     pmix_list_t resources;
  83 }pmix_pnet_resource_t;
  84 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_resource_t);
  85 
  86 typedef struct {
  87     pmix_list_item_t super;
  88     size_t index;
  89     char *name;
  90     pmix_list_t local_jobs;    // list of pmix_pnet_local_procs_t
  91     pmix_list_t resources;     // list of pmix_pnet_resource_t
  92 } pmix_pnet_node_t;
  93 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_node_t);
  94 
  95 typedef struct {
  96     pmix_list_item_t super;
  97     char *nspace;
  98     pmix_pointer_array_t nodes;
  99 } pmix_pnet_job_t;
 100 PMIX_EXPORT PMIX_CLASS_DECLARATION(pmix_pnet_job_t);
 101 
 102 /* framework globals */
 103 struct pmix_pnet_globals_t {
 104     pmix_lock_t lock;
 105     pmix_list_t actives;
 106     bool initialized;
 107     pmix_list_t jobs;
 108     pmix_list_t nodes;
 109 };
 110 typedef struct pmix_pnet_globals_t pmix_pnet_globals_t;
 111 
 112 PMIX_EXPORT extern pmix_pnet_globals_t pmix_pnet_globals;
 113 
 114 PMIX_EXPORT pmix_status_t pmix_pnet_base_allocate(char *nspace,
 115                                                   pmix_info_t info[], size_t ninfo,
 116                                                   pmix_list_t *ilist);
 117 PMIX_EXPORT pmix_status_t pmix_pnet_base_setup_local_network(char *nspace,
 118                                                              pmix_info_t info[],
 119                                                              size_t ninfo);
 120 PMIX_EXPORT pmix_status_t pmix_pnet_base_setup_fork(const pmix_proc_t *peer, char ***env);
 121 PMIX_EXPORT void pmix_pnet_base_child_finalized(pmix_proc_t *peer);
 122 PMIX_EXPORT void pmix_pnet_base_local_app_finalized(pmix_namespace_t *nptr);
 123 PMIX_EXPORT void pmix_pnet_base_deregister_nspace(char *nspace);
 124 PMIX_EXPORT void pmix_pnet_base_collect_inventory(pmix_info_t directives[], size_t ndirs,
 125                                                   pmix_inventory_cbfunc_t cbfunc,
 126                                                   void *cbdata);
 127 PMIX_EXPORT void pmix_pnet_base_deliver_inventory(pmix_info_t info[], size_t ninfo,
 128                                                   pmix_info_t directives[], size_t ndirs,
 129                                                   pmix_op_cbfunc_t cbfunc, void *cbdata);
 130 PMIX_EXPORT pmix_status_t pmix_pnet_base_harvest_envars(char **incvars, char **excvars,
 131                                                         pmix_list_t *ilist);
 132 
 133 END_C_DECLS
 134 
 135 #endif

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