This source file includes following definitions.
- mca_rcache_base_mem_cb
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 #include "opal_config.h"
26
27 #ifdef HAVE_UNISTD_H
28 #include <unistd.h>
29 #endif
30
31 #include "opal/util/show_help.h"
32 #include "opal/util/proc.h"
33 #include "opal/runtime/opal_params.h"
34
35 #include "opal/mca/rcache/base/rcache_base_mem_cb.h"
36 #include "opal/mca/rcache/base/base.h"
37
38 #include "opal/mca/mca.h"
39 #include "opal/memoryhooks/memory.h"
40
41 static char msg[512];
42
43
44
45
46
47
48
49
50 void mca_rcache_base_mem_cb (void* base, size_t size, void* cbdata, bool from_alloc)
51 {
52 mca_rcache_base_selected_module_t* current;
53 int rc;
54
55
56
57 if ((from_alloc && (!opal_initialized)) || size == 0) {
58 return;
59 }
60
61 OPAL_LIST_FOREACH(current, &mca_rcache_base_modules, mca_rcache_base_selected_module_t) {
62 if (current->rcache_module->rcache_invalidate_range != NULL) {
63 rc = current->rcache_module->rcache_invalidate_range (current->rcache_module,
64 base, size);
65 if (rc != OPAL_SUCCESS) {
66 if (from_alloc) {
67 int len;
68 len = snprintf(msg, sizeof(msg), "[%s:%05d] Attempt to free memory that is still in "
69 "use by an ongoing MPI communication (buffer %p, size %lu). MPI job "
70 "will now abort.\n", opal_proc_local_get()->proc_hostname,
71 getpid(), base, (unsigned long) size);
72 msg[sizeof(msg) - 1] = '\0';
73 write(2, msg, len);
74 } else {
75 opal_show_help("help-rcache-base.txt",
76 "cannot deregister in-use memory", true,
77 current->rcache_component->rcache_version.mca_component_name,
78 opal_proc_local_get()->proc_hostname,
79 base, (unsigned long) size);
80 }
81
82
83
84
85
86
87
88 _exit(1);
89 }
90 }
91 }
92 }