Skip to content

Commit 6a2fb80

Browse files
authored
Merge pull request #3062 from jjhursey/fix/v2.x/suncc-pmix
Make Oracle compilers happy with PMIx 1.2.1+
2 parents cd6227c + 03b250a commit 6a2fb80

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

opal/mca/pmix/pmix112/README

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright (c) 2017 IBM Corporation. All rights reserved.
2+
$COPYRIGHT$
3+
4+
Additional copyrights may follow
5+
6+
$HEADER$
7+
8+
===========================================================================
9+
This internal component includes PMIx v1.2.1 plus these two commits
10+
cherry-picked from the PMIx v1.2 branch (which will be included in the
11+
eventual PMIx v1.2.2 release).
12+
13+
* https://github.com/pmix/master/commit/a2d431cbec162b01e15920cc75df1af9ad244f06
14+
* https://github.com/pmix/master/commit/8587f278a17301633ccf6f0d7cb086e3be8f4793

opal/mca/pmix/pmix112/pmix/config/pmix_check_lock.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ dnl
33
dnl Copyright (c) 2017 Mellanox Technologies, Inc.
44
dnl All rights reserved.
55
dnl Copyright (c) 2017 IBM Corporation. All rights reserved.
6+
dnl Copyright (c) 2017 Research Organization for Information Science
7+
dnl and Technology (RIST). All rights reserved.
68
dnl $COPYRIGHT$
79
dnl
810
dnl Additional copyrights may follow
@@ -52,7 +54,7 @@ AC_DEFUN([PMIX_CHECK_DSTOR_LOCK],[
5254
if test "$_x_ac_fcntl_lock_found" == "0"; then
5355
AC_MSG_ERROR([dstore: no available locking mechanisms was found. Can not continue. Try disabling dstore])
5456
fi
57+
LIBS="$orig_libs"
5558
fi
5659

57-
LIBS="$orig_libs"
5860
])

opal/mca/pmix/pmix112/pmix/src/dstore/pmix_esh.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,11 @@ __extension__ ({ \
136136
})
137137

138138
#ifdef ESH_PTHREAD_LOCK
139-
#define _ESH_LOCK(rwlock, operation) \
139+
#define _ESH_LOCK(rwlock, func) \
140140
__extension__ ({ \
141141
pmix_status_t ret = PMIX_SUCCESS; \
142142
int rc; \
143-
switch (operation) { \
144-
case F_WRLCK: \
145-
rc = pthread_rwlock_wrlock(rwlock); \
146-
break; \
147-
case F_RDLCK: \
148-
rc = pthread_rwlock_rdlock(rwlock); \
149-
break; \
150-
case F_UNLCK: \
151-
rc = pthread_rwlock_unlock(rwlock); \
152-
break; \
153-
default: \
154-
rc = PMIX_ERR_BAD_PARAM; \
155-
} \
143+
rc = pthread_rwlock_##func(rwlock); \
156144
if (0 != rc) { \
157145
switch (errno) { \
158146
case EINVAL: \
@@ -169,6 +157,10 @@ __extension__ ({ \
169157
} \
170158
ret; \
171159
})
160+
161+
#define _ESH_WRLOCK(rwlock) _ESH_LOCK(rwlock, wrlock)
162+
#define _ESH_RDLOCK(rwlock) _ESH_LOCK(rwlock, rdlock)
163+
#define _ESH_UNLOCK(rwlock) _ESH_LOCK(rwlock, unlock)
172164
#endif
173165

174166
#ifdef ESH_FCNTL_LOCK
@@ -209,11 +201,11 @@ __extension__ ({ \
209201
} \
210202
ret; \
211203
})
212-
#endif
213204

214205
#define _ESH_WRLOCK(lock) _ESH_LOCK(lock, F_WRLCK)
215206
#define _ESH_RDLOCK(lock) _ESH_LOCK(lock, F_RDLCK)
216207
#define _ESH_UNLOCK(lock) _ESH_LOCK(lock, F_UNLCK)
208+
#endif
217209

218210
#define ESH_INIT_SESSION_TBL_SIZE 2
219211
#define ESH_INIT_NS_MAP_TBL_SIZE 2

0 commit comments

Comments
 (0)