File: info_subscriber.h

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 (84 lines) | stat: -rw-r--r-- 3,008 bytes parent folder | download | duplicates (5)
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
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
/*
 * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
 *                         University Research and Technology
 *                         Corporation.  All rights reserved.
 * Copyright (c) 2004-2007 The University of Tennessee and The University
 *                         of Tennessee Research Foundation.  All rights
 *                         reserved.
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
 *                         University of Stuttgart.  All rights reserved.
 * Copyright (c) 2004-2005 The Regents of the University of California.
 *                         All rights reserved.
 * Copyright (c) 2007-2012 Cisco Systems, Inc.  All rights reserved.
 * Copyright (c) 2009      Sun Microsystems, Inc.  All rights reserved.
 * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights
 *                         reserved.
 * Copyright (c) 2017      IBM Corporation. All rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef OMPI_INFOSUBSCRIBE_H
#define OMPI_INFOSUBSCRIBE_H

#include <string.h>

#include "opal/class/opal_hash_table.h"
#include "opal/class/opal_list.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/mca/threads/mutex.h"
#include "opal/util/info.h"

#include "opal/mca/base/mca_base_var_enum.h"

#define INFO_SUBSCRIBER_SIZE 5

struct opal_infosubscriber_t {
    opal_object_t s_base;
    opal_hash_table_t s_subscriber_table;
    opal_info_t *s_info;
};
typedef struct opal_infosubscriber_t opal_infosubscriber_t;

OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_infosubscriber_t);

typedef const char *(opal_key_interest_callback_t)(opal_infosubscriber_t *, const char *,
                                                   const char *);

/**
 *   opal_infosubscribe_change_info - Make changes to a Comm/Win/File Info
 *
 *   @param type Comm/Win/File
 *   @param object corresponding Com/Win/File object
 *   @param old_info previous info setting
 *   @param new_info new info setting
 *
 *   @retval OPAL status
 *
 *   Notifies subscribers of info's that have gone away and new info settings
 */
int opal_infosubscribe_change_info(opal_infosubscriber_t *, opal_info_t *);

/**
 *   opal_infosubscribe_subscribe - Request to be updated about info changes to a Comm/Win/File Info
 *
 *   @param type Comm/Win/File of obj
 *   @param obj either a comm, win or file
 *   @param key info key being set
 *   @param initial_value default value (or NULL if none)
 *   @param callback callback to be called when key changes
 *
 *   @retval OPAL status
 *
 *   Notifies subscribers of info's that have gone away and new info settings
 *   Does not try to optimize settings that are the same between old and new
 *   info's.
 */
int opal_infosubscribe_subscribe(opal_infosubscriber_t *, const char *, const char *,
                                 opal_key_interest_callback_t);

#endif /* OMPI_INFO_H */