File: opal_progress_threads.h

package info (click to toggle)
openmpi 5.0.8-3
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,692 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 (71 lines) | stat: -rw-r--r-- 2,348 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
/*
 * Copyright (c) 2014      Intel, Inc.  All rights reserved.
 * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
 * Copyright (c) 2020      Amazon.com, Inc. or its affiliates.
 *                         All Rights reserved.
 * $COPYRIGHT$
 *
 * Additional copyrights may follow
 *
 * $HEADER$
 */

#ifndef OPAL_PROGRESS_THREADS_H
#define OPAL_PROGRESS_THREADS_H

#include "opal_config.h"

#include "opal/util/event.h"

/**
 * Initialize a progress thread name; if a progress thread is not
 * already associated with that name, start a progress thread.
 *
 * If you have general events that need to run in *a* progress thread
 * (but not necessarily a your own, dedicated progress thread), pass
 * NULL the "name" argument to the opal_progress_thead_init() function
 * to glom on to the general OPAL-wide progress thread.
 *
 * If a name is passed that was already used in a prior call to
 * opal_progress_thread_init(), the event base associated with that
 * already-running progress thread will be returned (i.e., no new
 * progress thread will be started).
 */
OPAL_DECLSPEC opal_event_base_t *opal_progress_thread_init(const char *name);

/**
 * Finalize a progress thread name (reference counted).
 *
 * Once this function is invoked as many times as
 * opal_progress_thread_init() was invoked on this name (or NULL), the
 * progress function is shut down and the event base associated with
 * it is destroyed.
 *
 * Will return OPAL_ERR_NOT_FOUND if the progress thread name does not
 * exist; OPAL_SUCCESS otherwise.
 */
OPAL_DECLSPEC int opal_progress_thread_finalize(const char *name);

/**
 * Temporarily pause the progress thread associated with this name.
 *
 * This function does not destroy the event base associated with this
 * progress thread name, but it does stop processing all events on
 * that event base until opal_progress_thread_resume() is invoked on
 * that name.
 *
 * Will return OPAL_ERR_NOT_FOUND if the progress thread name does not
 * exist; OPAL_SUCCESS otherwise.
 */
OPAL_DECLSPEC int opal_progress_thread_pause(const char *name);

/**
 * Restart a previously-paused progress thread associated with this
 * name.
 *
 * Will return OPAL_ERR_NOT_FOUND if the progress thread name does not
 * exist; OPAL_SUCCESS otherwise.
 */
OPAL_DECLSPEC int opal_progress_thread_resume(const char *name);

#endif