Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 27ffc88

Browse files
authored
Merge pull request #1237 from hjelmn/v2.x_missing
v2.x missing commits
2 parents 9ea5bf7 + 4779429 commit 27ffc88

File tree

5 files changed

+28
-23
lines changed

5 files changed

+28
-23
lines changed

ompi/request/req_wait.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,13 @@ int ompi_request_default_wait_any(size_t count,
8383
int *index,
8484
ompi_status_public_t * status)
8585
{
86-
size_t completed = count, num_requests_null_inactive = 0;
87-
int i, rc = OMPI_SUCCESS;
88-
ompi_request_t **rptr=NULL;
86+
size_t i, completed = count, num_requests_null_inactive = 0;
87+
int rc = OMPI_SUCCESS;
8988
ompi_request_t *request=NULL;
9089
ompi_wait_sync_t sync;
9190

9291
WAIT_SYNC_INIT(&sync, 1);
9392

94-
rptr = requests;
9593
num_requests_null_inactive = 0;
9694
for (i = 0; i < count; i++) {
9795
request = requests[i];
@@ -177,10 +175,10 @@ int ompi_request_default_wait_all( size_t count,
177175
ompi_request_t ** requests,
178176
ompi_status_public_t * statuses )
179177
{
180-
size_t completed = 0, failed = 0;
178+
size_t i, completed = 0, failed = 0;
181179
ompi_request_t **rptr;
182180
ompi_request_t *request;
183-
int i, mpi_error = OMPI_SUCCESS;
181+
int mpi_error = OMPI_SUCCESS;
184182
ompi_wait_sync_t sync;
185183

186184
WAIT_SYNC_INIT(&sync, count);

opal/mca/memory/patcher/configure.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# University of Stuttgart. All rights reserved.
1111
# Copyright (c) 2004-2005 The Regents of the University of California.
1212
# All rights reserved.
13-
# Copyright (c) 2008-2010 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2008-2016 Cisco Systems, Inc. All rights reserved.
1414
# Copyright (c) 2015 Research Organization for Information Science
1515
# and Technology (RIST). All rights reserved.
1616
# Copyright (c) 2016 Los Alamos National Security, LLC. All rights
@@ -84,7 +84,7 @@ AC_DEFUN([MCA_opal_memory_patcher_CONFIG],[
8484
AC_DEFINE_UNQUOTED([OPAL_MEMORY_PATCHER_HAVE___SYSCALL], [$memory_patcher_have___syscall],
8585
[Whether the internal __syscall call exists])
8686

87-
AC_CHECK_HEADERS([linux/mman.h])
87+
AC_CHECK_HEADERS([linux/mman.h sys/syscall.h])
8888

8989
[$1]
9090

opal/mca/memory/patcher/memory_patcher_component.c

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "opal/mca/memory/base/empty.h"
3232
#include "opal/mca/memory/base/base.h"
3333
#include "opal/memoryhooks/memory.h"
34+
#include "opal/mca/patcher/base/base.h"
3435

3536
#include <stdlib.h>
3637
#include <stdint.h>
@@ -41,8 +42,9 @@
4142
#include <dlfcn.h>
4243
#include <assert.h>
4344
#include <sys/time.h>
45+
#if defined(HAVE_SYS_SYSCALL_H)
4446
#include <sys/syscall.h>
45-
47+
#endif
4648
#if defined(HAVE_LINUX_MMAN_H)
4749
#include <linux/mman.h>
4850
#endif
@@ -367,7 +369,9 @@ static int intercept_shmdt (const void *shmaddr)
367369
OPAL_PATCHER_BEGIN;
368370
int result;
369371

370-
opal_mem_hooks_release_hook (shmaddr, memory_patcher_get_shm_seg_size (shmaddr), false);
372+
/* opal_mem_hooks_release_hook should probably be updated to take a const void *.
373+
* for now just cast away the const */
374+
opal_mem_hooks_release_hook ((void *) shmaddr, memory_patcher_get_shm_seg_size (shmaddr), false);
371375

372376
if (original_shmdt) {
373377
result = original_shmdt (shmaddr);
@@ -393,11 +397,16 @@ static int patcher_register (void)
393397

394398
static int patcher_query (int *priority)
395399
{
396-
if (opal_patcher->patch_symbol) {
397-
*priority = mca_memory_patcher_priority;
398-
} else {
400+
int rc;
401+
402+
rc = mca_base_framework_open (&opal_patcher_base_framework, 0);
403+
if (OPAL_SUCCESS != rc) {
399404
*priority = -1;
405+
return OPAL_SUCCESS;
400406
}
407+
408+
*priority = mca_memory_patcher_priority;
409+
401410
return OPAL_SUCCESS;
402411
}
403412

@@ -412,6 +421,12 @@ static int patcher_open (void)
412421

413422
was_executed_already = 1;
414423

424+
rc = opal_patcher_base_select ();
425+
if (OPAL_SUCCESS != rc) {
426+
mca_base_framework_close (&opal_patcher_base_framework);
427+
return OPAL_ERR_NOT_AVAILABLE;
428+
}
429+
415430
/* set memory hooks support level */
416431
opal_mem_hooks_set_support (OPAL_MEMORY_FREE_SUPPORT | OPAL_MEMORY_MUNMAP_SUPPORT);
417432

@@ -459,6 +474,8 @@ static int patcher_open (void)
459474

460475
static int patcher_close(void)
461476
{
477+
mca_base_framework_close (&opal_patcher_base_framework);
478+
462479
/* Note that we don't need to unpatch any symbols here; the
463480
patcher framework will take care of all of that for us. */
464481
return OPAL_SUCCESS;

opal/runtime/opal_finalize.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "opal/mca/memchecker/base/base.h"
4242
#include "opal/mca/memcpy/base/base.h"
4343
#include "opal/mca/memory/base/base.h"
44-
#include "opal/mca/patcher/base/base.h"
4544
#include "opal/mca/backtrace/base/base.h"
4645
#include "opal/mca/sec/base/base.h"
4746
#include "opal/mca/timer/base/base.h"
@@ -148,7 +147,6 @@ opal_finalize(void)
148147
hooks to the bowels of the mem_free code can still occur any
149148
time between now and end of application (even post main()!) */
150149
(void) mca_base_framework_close(&opal_memory_base_framework);
151-
(void) mca_base_framework_close(&opal_patcher_base_framework);
152150

153151
/* close the memcpy framework */
154152
(void) mca_base_framework_close(&opal_memcpy_base_framework);

opal/runtime/opal_init.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,6 @@ opal_init(int* pargc, char*** pargv)
452452
goto return_error;
453453
}
454454

455-
if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_patcher_base_framework, 0))) {
456-
error = "opal_patcher_base_open";
457-
goto return_error;
458-
}
459-
460-
/* select a patcher module. if a patcher module can not be found it is not an error. */
461-
(void) opal_patcher_base_select ();
462-
463455
/* open the memory manager components. Memory hooks may be
464456
triggered before this (any time after mem_free_init(),
465457
actually). This is a hook available for memory manager hooks

0 commit comments

Comments
 (0)