Skip to content

Commit 325778e

Browse files
author
Ralph Castain
authored
Merge pull request #3836 from rhc54/topic/ofi
Bring the ofi/rml component online
2 parents 855b430 + f7e8780 commit 325778e

Some content is hidden

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

59 files changed

+1300
-1379
lines changed

contrib/platform/intel/bend/linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enable_shared=yes
1111
enable_static=no
1212
enable_memchecker=no
1313
enable_ipv6=no
14-
enable_mpi_fortran=yes
14+
enable_mpi_fortran=no
1515
enable_mpi_cxx=no
1616
enable_mpi_cxx_seek=no
1717
enable_cxx_exceptions=no

opal/mca/pmix/pmix2x/pmix/VERSION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# major, minor, and release are generally combined in the form
1414
# <major>.<minor>.<release>.
1515

16-
major=2
17-
minor=1
16+
major=3
17+
minor=0
1818
release=0
1919

2020
# greek is used for alpha or beta release tags. If it is non-empty,
@@ -30,7 +30,7 @@ greek=
3030
# command, or with the date (if "git describe" fails) in the form of
3131
# "date<date>".
3232

33-
repo_rev=git4714f20
33+
repo_rev=gitd26d689
3434

3535
# If tarball_version is not empty, it is used as the version string in
3636
# the tarball filename, regardless of all other versions listed in
@@ -44,7 +44,7 @@ tarball_version=
4444

4545
# The date when this release was created
4646

47-
date="Jul 20, 2017"
47+
date="Jul 06, 2017"
4848

4949
# The shared library version of each of PMIx's public libraries.
5050
# These versions are maintained in accordance with the "Library

opal/mca/pmix/pmix2x/pmix/config/pmix_setup_libevent.m4

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
44
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights reserved.
55
# Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
6-
# Copyright (c) 2017 Research Organization for Information Science
7-
# and Technology (RIST). All rights reserved.
86
# $COPYRIGHT$
97
#
108
# Additional copyrights may follow
@@ -41,11 +39,8 @@ AC_DEFUN([_PMIX_LIBEVENT_EMBEDDED_MODE],[
4139
AC_MSG_CHECKING([for libevent])
4240
AC_MSG_RESULT([assumed available (embedded mode)])
4341

44-
AS_IF([test -z "$with_libevent_header" || test "$with_libevent_header" = "yes"],
45-
[PMIX_EVENT_HEADER="<event.h>"
46-
PMIX_EVENT2_THREAD_HEADER="<event2/thread.h>"],
47-
[PMIX_EVENT_HEADER="$with_libevent_header"
48-
PMIX_EVENT2_THREAD_HEADER="$with_libevent_header"])
42+
PMIX_EVENT_HEADER="$with_libevent_header"
43+
PMIX_EVENT2_THREAD_HEADER="$with_libevent_header"
4944

5045
])
5146

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2006 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2015-2017 Intel, Inc. All rights reserved.
13+
* Copyright (c) 2016 IBM Corporation. All rights reserved.
14+
* Copyright (c) 2017 Los Alamos National Security, LLC. All rights
15+
* reserved.
16+
* $COPYRIGHT$
17+
*
18+
* Additional copyrights may follow
19+
*
20+
* $HEADER$
21+
*/
22+
23+
#include <src/include/pmix_config.h>
24+
25+
26+
#include <stdio.h>
27+
#ifdef HAVE_UNISTD_H
28+
#include <unistd.h>
29+
#endif
30+
31+
#include "src/class/pmix_pointer_array.h"
32+
33+
#include "src/buffer_ops/internal.h"
34+
35+
/**
36+
* Internal function that resizes (expands) an inuse buffer if
37+
* necessary.
38+
*/
39+
char* pmix_bfrop_buffer_extend(pmix_buffer_t *buffer, size_t bytes_to_add)
40+
{
41+
size_t required, to_alloc;
42+
size_t pack_offset, unpack_offset;
43+
char *tmp;
44+
45+
/* Check to see if we have enough space already */
46+
47+
if ((buffer->bytes_allocated - buffer->bytes_used) >= bytes_to_add) {
48+
return buffer->pack_ptr;
49+
}
50+
51+
required = buffer->bytes_used + bytes_to_add;
52+
if (required >= pmix_bfrop_threshold_size) {
53+
to_alloc = (required + pmix_bfrop_threshold_size - 1) & ~(pmix_bfrop_threshold_size - 1);
54+
} else {
55+
to_alloc = buffer->bytes_allocated ? buffer->bytes_allocated : pmix_bfrop_initial_size;
56+
while(to_alloc < required) {
57+
to_alloc <<= 1;
58+
}
59+
}
60+
61+
pack_offset = ((char*) buffer->pack_ptr) - ((char*) buffer->base_ptr);
62+
unpack_offset = ((char*) buffer->unpack_ptr) - ((char*) buffer->base_ptr);
63+
tmp = (char*)realloc(buffer->base_ptr, to_alloc);
64+
if (NULL == tmp) {
65+
return NULL;
66+
}
67+
68+
buffer->base_ptr = tmp;
69+
70+
/* This memset is meant to keep valgrind happy. If possible it should be removed
71+
* in the future. */
72+
memset(buffer->base_ptr + pack_offset, 0, to_alloc - buffer->bytes_allocated);
73+
74+
buffer->pack_ptr = ((char*) buffer->base_ptr) + pack_offset;
75+
buffer->unpack_ptr = ((char*) buffer->base_ptr) + unpack_offset;
76+
buffer->bytes_allocated = to_alloc;
77+
78+
/* All done */
79+
80+
return buffer->pack_ptr;
81+
}
82+
83+
/*
84+
* Internal function that checks to see if the specified number of bytes
85+
* remain in the buffer for unpacking
86+
*/
87+
bool pmix_bfrop_too_small(pmix_buffer_t *buffer, size_t bytes_reqd)
88+
{
89+
size_t bytes_remaining_packed;
90+
91+
if (buffer->pack_ptr < buffer->unpack_ptr) {
92+
return true;
93+
}
94+
95+
bytes_remaining_packed = buffer->pack_ptr - buffer->unpack_ptr;
96+
97+
if (bytes_remaining_packed < bytes_reqd) {
98+
/* don't error log this - it could be that someone is trying to
99+
* simply read until the buffer is empty
100+
*/
101+
return true;
102+
}
103+
104+
return false;
105+
}
106+
107+
pmix_status_t pmix_bfrop_store_data_type(pmix_buffer_t *buffer, pmix_data_type_t type)
108+
{
109+
/* Lookup the pack function for the actual pmix_data_type type and call it */
110+
return pmix_bfrop_pack_datatype(buffer, &type, 1, PMIX_DATA_TYPE);
111+
}
112+
113+
pmix_status_t pmix_bfrop_get_data_type(pmix_buffer_t *buffer, pmix_data_type_t *type)
114+
{
115+
int32_t cnt = 1;
116+
117+
return pmix_bfrop_unpack_datatype(buffer, type, &cnt, PMIX_DATA_TYPE);
118+
}

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c

Lines changed: 99 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr,
270270
pmix_status_t rc, ret;
271271
pmix_value_t *val = NULL;
272272
int32_t cnt;
273-
pmix_proc_t proc;
273+
pmix_proc_t proc, proct;
274+
pmix_byte_object_t bo;
275+
pmix_buffer_t pbkt;
274276
pmix_kval_t *kv;
277+
pmix_peer_t *peer;
275278

276279
pmix_output_verbose(2, pmix_globals.debug_output,
277280
"pmix: get_nb callback recvd");
@@ -299,9 +302,82 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr,
299302
if (PMIX_SUCCESS != ret) {
300303
goto done;
301304
}
302-
PMIX_GDS_ACCEPT_KVS_RESP(rc, pmix_client_globals.myserver, buf);
303-
if (PMIX_SUCCESS != rc) {
304-
goto done;
305+
306+
/* the incoming payload is provided as a set of packed
307+
* byte objects, one for each rank. A pmix_proc_t is the first
308+
* entry in the byte object. If the rank=PMIX_RANK_WILDCARD,
309+
* then that byte object contains job level info
310+
* for the provided nspace. Otherwise, the byte
311+
* object contains the pmix_kval_t's that were "put" by the
312+
* referenced process */
313+
cnt = 1;
314+
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,
315+
buf, &bo, &cnt, PMIX_BYTE_OBJECT);
316+
while (PMIX_SUCCESS == rc) {
317+
/* setup the byte object for unpacking */
318+
PMIX_CONSTRUCT(&pbkt, pmix_buffer_t);
319+
PMIX_LOAD_BUFFER(pmix_client_globals.myserver,
320+
&pbkt, bo.bytes, bo.size);
321+
/* unpack the id of the providing process */
322+
cnt = 1;
323+
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,
324+
&pbkt, &proct, &cnt, PMIX_PROC);
325+
if (PMIX_SUCCESS != rc) {
326+
PMIX_ERROR_LOG(rc);
327+
goto done;
328+
}
329+
/* if the rank is WILDCARD, then the byte object contains
330+
* job-level data. Note that we can get job-level data
331+
* for a "get" request that referenced a specific non-wildcard
332+
* rank - this happens in the case where the nspace is
333+
* different than that of the requestor. We may also be
334+
* in a situation where the data for -all- ranks on a
335+
* remote node is being returned by a request for data
336+
* from only one of them - this can occur as an optimization.
337+
* So we have to check the rank here as it may not match the rank of
338+
* the requestor */
339+
if (PMIX_RANK_WILDCARD == proct.rank) {
340+
peer = pmix_client_globals.myserver; // job-level data is accessed via the server module
341+
} else {
342+
peer = pmix_globals.mypeer; // all other data is stored on my peer module
343+
}
344+
cnt = 1;
345+
kv = PMIX_NEW(pmix_kval_t);
346+
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,
347+
&pbkt, kv, &cnt, PMIX_KVAL);
348+
while (PMIX_SUCCESS == rc) {
349+
/* let the GDS component for this peer store it - if
350+
* the kval contains shmem connection info, then the
351+
* component will know what to do about it (or else
352+
* we selected the wrong component for this peer!) */
353+
PMIX_GDS_STORE_KV(rc, peer, &proct, PMIX_INTERNAL, kv);
354+
if (PMIX_SUCCESS != rc) {
355+
PMIX_ERROR_LOG(rc);
356+
PMIX_RELEASE(kv);
357+
PMIX_DESTRUCT(&pbkt);
358+
goto done;
359+
}
360+
PMIX_RELEASE(kv); // maintain accounting
361+
/* get the next one */
362+
kv = PMIX_NEW(pmix_kval_t);
363+
cnt = 1;
364+
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,
365+
&pbkt, kv, &cnt, PMIX_KVAL);
366+
}
367+
PMIX_RELEASE(kv); // maintain accounting
368+
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
369+
PMIX_ERROR_LOG(rc);
370+
PMIX_DESTRUCT(&pbkt);
371+
goto done;
372+
}
373+
PMIX_DESTRUCT(&pbkt);
374+
/* get the next one */
375+
cnt = 1;
376+
PMIX_BFROPS_UNPACK(rc, pmix_client_globals.myserver,
377+
buf, &bo, &cnt, PMIX_BYTE_OBJECT);
378+
}
379+
if (PMIX_ERR_UNPACK_READ_PAST_END_OF_BUFFER != rc) {
380+
PMIX_ERROR_LOG(rc);
305381
}
306382

307383
done:
@@ -315,7 +391,7 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr,
315391
/* we have the data for this proc - see if we can find the key */
316392
cb->proc = &proc;
317393
cb->scope = PMIX_SCOPE_UNDEF;
318-
/* fetch the data from server peer module - since it is passing
394+
/* fetch the data from my peer module - since we are passing
319395
* it back to the user, we need a copy of it */
320396
cb->copy = true;
321397
PMIX_GDS_FETCH_KV(rc, pmix_client_globals.myserver, cb);
@@ -410,6 +486,7 @@ static void _getnbfn(int fd, short flags, void *cbdata)
410486
pmix_proc_t proc;
411487
bool optional = false;
412488
struct timeval tv;
489+
bool my_nspace = false, my_rank = false;
413490

414491
/* cb was passed to us from another thread - acquire it */
415492
PMIX_ACQUIRE_OBJECT(cb);
@@ -448,13 +525,22 @@ static void _getnbfn(int fd, short flags, void *cbdata)
448525
}
449526
}
450527

451-
/* check the internal storage first */
452-
cb->proc = &proc;
453-
cb->copy = true;
454-
PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, cb);
455-
if (PMIX_SUCCESS == rc) {
456-
rc = process_values(&val, cb);
457-
goto respond;
528+
my_nspace = (0 == strncmp(cb->pname.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN));
529+
my_rank = (pmix_globals.myid.rank == cb->pname.rank);
530+
531+
/* if we are looking for data from ourselves, then
532+
* check the internal storage first */
533+
if (my_rank) {
534+
cb->proc = &proc;
535+
cb->copy = true;
536+
PMIX_GDS_FETCH_KV(rc, pmix_globals.mypeer, cb);
537+
if (PMIX_SUCCESS == rc) {
538+
rc = process_values(&val, cb);
539+
goto respond;
540+
}
541+
if (my_nspace) {
542+
goto respond;
543+
}
458544
}
459545

460546
/* if the key is NULL or starts with "pmix", then they are looking
@@ -466,7 +552,7 @@ static void _getnbfn(int fd, short flags, void *cbdata)
466552
cb->copy = true;
467553
PMIX_GDS_FETCH_KV(rc, pmix_client_globals.myserver, cb);
468554
if (PMIX_SUCCESS != rc) {
469-
if (0 != strncmp(cb->pname.nspace, pmix_globals.myid.nspace, PMIX_MAX_NSLEN)) {
555+
if (!my_nspace) {
470556
/* we are asking about the job-level info from another
471557
* namespace. It seems that we don't have it - go and
472558
* ask server

0 commit comments

Comments
 (0)