Skip to content

Commit afad266

Browse files
authored
Merge pull request #1991 from hoopoepg/topic/v1.2.x
UCX: backports from 1.3/master
2 parents 46bd382 + 808406b commit afad266

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+261
-67
lines changed

config/m4/ucm.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,8 @@ esac
4242

4343
AM_CONDITIONAL([HAVE_UCM_PTMALLOC286],[test "x$HAVE_UCM_PTMALLOC286" = "xyes"])
4444

45+
AC_CHECK_FUNCS([malloc_get_state malloc_set_state],
46+
[],
47+
[],
48+
[#include <stdlib.h>])
49+

src/ucp/api/ucp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
#include <ucs/type/thread_mode.h>
1515
#include <ucs/type/cpu_set.h>
1616
#include <ucs/config/types.h>
17+
#include <ucs/sys/compiler_def.h>
1718
#include <stdio.h>
1819

20+
BEGIN_C_DECLS
1921

2022
/**
2123
* @defgroup UCP_API Unified Communication Protocol (UCP) API
@@ -2446,5 +2448,6 @@ ucs_status_t ucp_worker_flush(ucp_worker_h worker);
24462448
* UCP hello world client / server example utility.
24472449
*/
24482450

2451+
END_C_DECLS
24492452

24502453
#endif

src/ucp/api/ucp_compat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111

1212
#include <ucp/api/ucp_def.h>
13+
#include <ucs/sys/compiler_def.h>
1314

15+
BEGIN_C_DECLS
1416

1517
/**
1618
* @ingroup UCP_COMM
@@ -32,5 +34,6 @@ void ucp_request_release(void *request);
3234
*/
3335
void ucp_ep_destroy(ucp_ep_h ep);
3436

37+
END_C_DECLS
3538

3639
#endif

src/ucp/wireup/wireup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ ucs_status_t ucp_wireup_init_lanes(ucp_ep_h ep, unsigned address_count,
452452
key.reachable_md_map |= ucp_ep_config(ep)->key.reachable_md_map;
453453

454454
new_cfg_index = ucp_worker_get_ep_config(worker, &key);
455-
if ((ep->cfg_index == new_cfg_index)) {
455+
if (ep->cfg_index == new_cfg_index) {
456456
return UCS_OK; /* No change */
457457
}
458458

src/ucs/algorithm/crc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
#include <stddef.h>
1111
#include <stdint.h>
1212

13+
#include <ucs/sys/compiler_def.h>
14+
15+
BEGIN_C_DECLS
16+
1317
/**
1418
* Calculate CRC16 of an arbitrary buffer.
1519
*
@@ -26,5 +30,6 @@ uint16_t ucs_crc16(const void *buffer, size_t size);
2630
*/
2731
uint16_t ucs_crc16_string(const char *s);
2832

33+
END_C_DECLS
2934

3035
#endif

src/ucs/algorithm/qsort_r.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
#include <stddef.h>
3939

40+
#include <ucs/sys/compiler_def.h>
41+
42+
BEGIN_C_DECLS
4043

4144
/**
4245
* Compare callback for @ref qsort_r.
@@ -59,5 +62,6 @@ typedef int ucs_qsort_r_compare_cb_t(const void *elem1, const void *elem2,
5962
void ucs_qsort_r(void *base, size_t nmemb, size_t size,
6063
ucs_qsort_r_compare_cb_t *compare, void *arg);
6164

65+
END_C_DECLS
6266

6367
#endif

src/ucs/arch/aarch64/cpu.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "config.h"
1212
#include <time.h>
1313
#include <sys/times.h>
14+
#include <ucs/sys/compiler_def.h>
1415
#include <ucs/arch/generic/cpu.h>
1516
#if __ARM_NEON
1617
#include <arm_neon.h>
@@ -19,6 +20,8 @@
1920

2021
#define UCS_ARCH_CACHE_LINE_SIZE 64
2122

23+
BEGIN_C_DECLS
24+
2225
/**
2326
* Assume the worst - weak memory ordering.
2427
*/
@@ -63,8 +66,6 @@ static inline int ucs_arch_get_cpu_flag()
6366
return UCS_CPU_FLAG_UNKNOWN;
6467
}
6568

66-
#endif
67-
6869
static inline void ucs_arch_wait_mem(void *address)
6970
{
7071
unsigned long tmp;
@@ -73,3 +74,8 @@ static inline void ucs_arch_wait_mem(void *address)
7374
: "=&r"(tmp)
7475
: "r"(address));
7576
}
77+
78+
END_C_DECLS
79+
80+
#endif
81+

src/ucs/arch/ppc64/cpu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
#ifdef HAVE_SYS_PLATFORM_PPC_H
1414
# include <sys/platform/ppc.h>
1515
#endif
16+
#include <ucs/sys/compiler_def.h>
1617
#include <ucs/arch/generic/cpu.h>
1718
#include <stdint.h>
1819

20+
BEGIN_C_DECLS
1921

2022
#define UCS_ARCH_CACHE_LINE_SIZE 128
2123

@@ -53,4 +55,6 @@ double ucs_arch_get_clocks_per_sec();
5355

5456
#define ucs_arch_wait_mem ucs_arch_generic_wait_mem
5557

58+
END_C_DECLS
59+
5660
#endif

src/ucs/arch/x86_64/cpu.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <ucs/sys/compiler.h>
1212
#include <ucs/arch/generic/cpu.h>
13+
#include <ucs/sys/compiler_def.h>
1314
#include <stdint.h>
1415

1516
#ifdef __SSE4_1__
@@ -19,6 +20,7 @@
1920
# include <immintrin.h>
2021
#endif
2122

23+
BEGIN_C_DECLS
2224

2325
#define UCS_ARCH_CACHE_LINE_SIZE 64
2426

@@ -48,6 +50,7 @@ ucs_cpu_flag_t ucs_arch_get_cpu_flag() UCS_F_NOOPTIMIZE;
4850

4951
#define ucs_arch_wait_mem ucs_arch_generic_wait_mem
5052

53+
END_C_DECLS
5154

5255
#endif
5356

src/ucs/async/async.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
#include "signal.h"
1212
#include "async_fwd.h"
1313

14+
#include <ucs/sys/compiler_def.h>
1415
#include <ucs/datastruct/mpmc.h>
1516
#include <ucs/time/time.h>
1617
#include <ucs/debug/log.h>
1718

19+
BEGIN_C_DECLS
1820

1921
/**
2022
* Async event context. Manages timer and fd notifications.
@@ -119,4 +121,6 @@ static inline int ucs_async_check_miss(ucs_async_context_t *async)
119121
} while (0)
120122

121123

124+
END_C_DECLS
125+
122126
#endif

0 commit comments

Comments
 (0)