Skip to content

Commit

Permalink
Merge pull request #3130 from artpol84/dstore_fix/v2.x
Browse files Browse the repository at this point in the history
opal/pmix: Bring dstore fixes for rc3 testing
  • Loading branch information
jsquyres authored Mar 9, 2017
2 parents e38309b + f4511f9 commit f0654ce
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
4 changes: 3 additions & 1 deletion opal/mca/pmix/pmix112/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Additional copyrights may follow
$HEADER$

===========================================================================
This internal component includes PMIx v1.2.1 plus these two commits
This internal component includes PMIx v1.2.1 plus following commits
cherry-picked from the PMIx v1.2 branch (which will be included in the
eventual PMIx v1.2.2 release). Newer patches at top.

* https://github.com/pmix/pmix/commit/1b86a6e7ee99fc5969a0789a9905a4a2159a6dc0
* https://github.com/pmix/pmix/commit/14f865c4b631827fb99779d42eaf0567f117a76f
* https://github.com/pmix/pmix/commit/4269e8484bd883523ae485bf2e1b7bbc0719c494
* https://github.com/pmix/pmix/commit/a2d431cbec162b01e15920cc75df1af9ad244f06
* https://github.com/pmix/pmix/commit/8587f278a17301633ccf6f0d7cb086e3be8f4793
26 changes: 20 additions & 6 deletions opal/mca/pmix/pmix112/pmix/src/sm/pmix_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,38 @@ int _mmap_segment_create(pmix_sm_seg_t *sm_seg, const char *file_name, size_t si
}
/* size backing file - note the use of real_size here */
#ifdef HAVE_POSIX_FALLOCATE
if (0 != posix_fallocate(sm_seg->seg_id, 0, size)) {
if (0 != (rc = posix_fallocate(sm_seg->seg_id, 0, size))) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call posix_fallocate(2) fail\n");
if (ENOSPC == errno) {
if (ENOSPC == rc) {
rc = PMIX_ERR_OUT_OF_RESOURCE;
} else {
goto out;
} else if ((ENOTSUP != rc)
#ifdef EOPNOTSUPP
&& (EOPNOTSUPP != rc)
#endif
){
rc = PMIX_ERROR;
goto out;
}
goto out;
/* else:
* Not supported by OS and/or filesystem.
* Must fall-back to ftruncate().
*/
} else {
goto map_memory;
}
#else
#endif
if (0 != ftruncate(sm_seg->seg_id, size)) {
pmix_output_verbose(2, pmix_globals.debug_output,
"sys call ftruncate(2) fail\n");
rc = PMIX_ERROR;
goto out;
} else {
rc = PMIX_SUCCESS;
}
#endif

map_memory:
if (MAP_FAILED == (seg_addr = mmap(NULL, size,
PROT_READ | PROT_WRITE, MAP_SHARED,
sm_seg->seg_id, 0))) {
Expand Down

0 comments on commit f0654ce

Please sign in to comment.