Index: openmpi-4.1.0/opal/mca/pmix/pmix3x/pmix/include/pmix_server.h
===================================================================
--- openmpi-4.1.0.orig/opal/mca/pmix/pmix3x/pmix/include/pmix_server.h
+++ openmpi-4.1.0/opal/mca/pmix/pmix3x/pmix/include/pmix_server.h
@@ -85,6 +85,12 @@ extern "C" {
 typedef pmix_status_t (*pmix_server_client_connected_fn_t)(const pmix_proc_t *proc, void* server_object,
                                                            pmix_op_cbfunc_t cbfunc, void *cbdata);
 
+/* REPLACES ABOVE FUNCTION TO ALLOW PASSING ADDITIONAL INFO */
+typedef pmix_status_t (*pmix_server_client_connected2_fn_t)(const pmix_proc_t *proc, void* server_object,
+                                                            pmix_info_t info[], size_t ninfo,
+                                                            pmix_op_cbfunc_t cbfunc, void *cbdata);
+
+
 /* Notify the host server that a client called PMIx_Finalize - note
  * that the client will be in a blocked state until the host server
  * executes the callback function, thus allowing the PMIx server support
@@ -492,7 +498,44 @@ typedef pmix_status_t (*pmix_server_stdi
                                                 pmix_op_cbfunc_t cbfunc, void *cbdata);
 
 
-typedef struct pmix_server_module_2_0_0_t {
+/* Perform a "fence" operation across the specified procs, plus any special
+ * actions included in the directives. Return the result of any special action
+ * requests in the info cbfunc when the fence is completed. Actions may include:
+ *
+ * PMIX_GROUP_ASSIGN_CONTEXT_ID - request that the RM assign a unique
+ *                                numerical (size_t) ID to this group
+ *
+ * grp - user-assigned string ID of this group
+ *
+ * op - pmix_group_operation_t value indicating the operation to perform
+ *      Current values support construct and destruct of the group
+ *
+ * procs - pointer to array of pmix_proc_t ID's of group members
+ *
+ * nprocs - number of group members
+ *
+ * directives - array of key-value attributes specifying special actions.
+ *
+ * ndirs - size of the directives array
+ *
+ * cbfunc - callback function when the operation is completed
+ *
+ * cbdata - object to be returned in cbfunc
+ */
+typedef pmix_status_t (*pmix_server_grp_fn_t)(pmix_group_operation_t op, char grp[],
+                                              const pmix_proc_t procs[], size_t nprocs,
+                                              const pmix_info_t directives[], size_t ndirs,
+                                              pmix_info_cbfunc_t cbfunc, void *cbdata);
+
+/* Retrieve fabric-related information from the server supporting
+ * the system scheduler.
+ */
+typedef pmix_status_t (*pmix_server_fabric_fn_t)(const pmix_proc_t *requestor,
+                                                 pmix_fabric_operation_t op,
+                                                 const pmix_info_t directives[], size_t ndirs,
+                                                 pmix_info_cbfunc_t cbfunc, void *cbdata);
+
+typedef struct pmix_server_module_4_0_0_t {
     /* v1x interfaces */
     pmix_server_client_connected_fn_t   client_connected;
     pmix_server_client_finalized_fn_t   client_finalized;
@@ -521,6 +564,10 @@ typedef struct pmix_server_module_2_0_0_
     pmix_server_validate_cred_fn_t      validate_credential;
     pmix_server_iof_fn_t                iof_pull;
     pmix_server_stdin_fn_t              push_stdin;
+    /* v4x interfaces */
+    pmix_server_grp_fn_t                group;
+    pmix_server_fabric_fn_t             fabric;
+    pmix_server_client_connected2_fn_t  client_connected2;
 } pmix_server_module_t;
 
 /****    HOST RM FUNCTIONS FOR INTERFACE TO PMIX SERVER    ****/
Index: openmpi-4.1.0/opal/mca/pmix/pmix3x/pmix/include/pmix_common.h.in
===================================================================
--- openmpi-4.1.0.orig/opal/mca/pmix/pmix3x/pmix/include/pmix_common.h.in
+++ openmpi-4.1.0/opal/mca/pmix/pmix3x/pmix/include/pmix_common.h.in
@@ -1009,6 +1009,20 @@ typedef uint16_t pmix_iof_channel_t;
 #define PMIX_FWD_STDDIAG_CHANNEL    0x0008
 #define PMIX_FWD_ALL_CHANNELS       0x00ff
 
+/* define values associated with PMIx_Group_join
+ * to indicate accept and decline - this is
+ * done for readability of user code */
+typedef enum {
+    PMIX_GROUP_DECLINE,
+    PMIX_GROUP_ACCEPT
+} pmix_group_opt_t;
+
+typedef enum {
+    PMIX_GROUP_CONSTRUCT,
+    PMIX_GROUP_DESTRUCT
+} pmix_group_operation_t;
+
+
 /* define some "hooks" external libraries can use to
  * intercept memory allocation/release operations */
 static inline void* pmix_malloc(size_t n)
@@ -1060,6 +1074,24 @@ static inline void* pmix_calloc(size_t n
 #define PMIX_CHECK_PROCID(a, b) \
     (PMIX_CHECK_NSPACE((a)->nspace, (b)->nspace) && ((a)->rank == (b)->rank || (PMIX_RANK_WILDCARD == (a)->rank || PMIX_RANK_WILDCARD == (b)->rank)))
 
+/****   PMIX CPUSET    ****/
+typedef struct{
+    char *source;
+    void *bitmap;
+} pmix_cpuset_t;
+
+#define PMIX_CPUSET_CONSTRUCT(m) \
+    memset((m), 0, sizeof(pmix_cpuset_t))
+
+#define PMIX_CPUSET_DESTRUCT(m) \
+    pmix_ploc_base_destruct_cpuset((m))
+
+#define PMIX_CPUSET_CREATE(m, n)    \
+    (m) = (pmix_cpuset_t*)calloc((n), sizeof(pmix_cpuset_t));
+
+#define PMIX_CPUSET_FREE(m, n) \
+    pmix_ploc_base_release_cpuset((m), (n))
+
 
 /****    PMIX BYTE OBJECT    ****/
 typedef struct pmix_byte_object {
@@ -1810,6 +1842,31 @@ typedef struct pmix_query {
     } while (0)
 
 
+/****    FABRIC STRUCT    ****/
+/* Define a pmix_fabric_t struct for
+ * interacting with fabric-related interfaces */
+typedef struct pmix_fabric_s {
+    /* user-supplied name for this fabric */
+    char *name;
+    /* a PMIx-supplied index identifying this registration object */
+    size_t index;
+    /* array containing information (provided by the PMIx library)
+     * about the fabric */
+    pmix_info_t *info;
+    size_t ninfo;
+    /* object pointer for use by the PMIx library */
+    void *module;
+} pmix_fabric_t;
+
+/* convenience macros to support pmix_fabric_t */
+#define PMIX_FABRIC_CONSTRUCT(x) \
+    memset(x, 0, sizeof(pmix_fabric_t))
+
+typedef enum {
+    PMIX_FABRIC_REQUEST_INFO,
+    PMIX_FABRIC_UPDATE_INFO
+} pmix_fabric_operation_t;
+
 /****    GENERIC HELPER MACROS    ****/
 
 /* Append a string (by value) to an new or existing NULL-terminated
