Skip to content

mpool/rcache rewrite #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 15, 2016
Merged

mpool/rcache rewrite #1118

merged 6 commits into from
Mar 15, 2016

Conversation

hjelmn
Copy link
Member

@hjelmn hjelmn commented Nov 10, 2015

This PR brings in a complete rewrite of the mpool and rcache frameworks.

@vvenkates27 please verify memkind usability.

@hjelmn
Copy link
Member Author

hjelmn commented Nov 10, 2015

@jsquyres, @bosilca, @hppritcha Comments on the new interfaces are welcome. Let me know soon if you see any problems or things that can be improved. This is targeted for 2.0.0.

@vvenkates27
Copy link
Contributor

Hi Nathan,

Thanks for putting this together. I tested this out. It worked for the MPI_Alloc_mem.
MPI_Free_mem was not picking up right mpool module because the allocated address was not added to the rb-tree maintained in the base module in mca_mpool_base_alloc.c:99. "mem" needs to be added as the key to the rb-tree. Doing that fixes that issue.

I will let you know if I find any other issues.

Thanks
Vish

@hjelmn
Copy link
Member Author

hjelmn commented Nov 11, 2015

Fixed the red-black tree issue. Still trying to track down the mellanox issue.

@hjelmn
Copy link
Member Author

hjelmn commented Nov 23, 2015

:bot:retest

Can't reproduce the Mellanox Jenkins failure.

@hjelmn
Copy link
Member Author

hjelmn commented Nov 23, 2015

:bot:retest:

@hjelmn
Copy link
Member Author

hjelmn commented Nov 24, 2015

PR got screwed up on rebase. Fixing.

@jsquyres
Copy link
Member

@hjelmn Any idea what's going wrong at btl_openib_endpoint.c:356?

@hppritcha
Copy link
Member

Assuming this isn't addressing a bug in the existing mpool/rcache implementation, I think this is too large a change to go in to 2.0 at this point. It looks like a good candidate for 2.1.

@hjelmn
Copy link
Member Author

hjelmn commented Dec 9, 2015

Should be working now. @bosilca, @jsquyres Any comments on the new interfaces?

@hjelmn hjelmn force-pushed the mpool_rewrite branch 3 times, most recently from 65a7312 to 484f04d Compare December 9, 2015 22:27
@hjelmn
Copy link
Member Author

hjelmn commented Dec 9, 2015

@miked-mellanox I can't tell what in the Mellanox Jenkins failed.

@hjelmn
Copy link
Member Author

hjelmn commented Dec 9, 2015

:bot:retest:

2 similar comments
@hjelmn
Copy link
Member Author

hjelmn commented Dec 11, 2015

:bot:retest:

@hjelmn
Copy link
Member Author

hjelmn commented Dec 15, 2015

:bot:retest:

@hjelmn
Copy link
Member Author

hjelmn commented Dec 17, 2015

@miked-mellanox This looks like a false failure. When I run your env_mpi by hand with valgrind I get this:

==12372== Invalid read of size 8
==12372==    at 0x40082D: main (in /lustre/scratch1/yellow/hjelmn/ibm/env_mpi)
==12372==  Address 0xe132510 is 0 bytes inside a block of size 960 free'd
==12372==    at 0x4C27C20: realloc (vg_replace_malloc.c:662)
==12372==    by 0x56AD3FC: __add_to_environ (setenv.c:143)
==12372==    by 0x4C2B679: setenv (mc_replace_strmem.c:1756)
==12372==    by 0x50A2E34: ompi_mtl_mxm_component_open (mtl_mxm_component.c:216)
==12372==    by 0x698B9FE: open_components (mca_base_components_open.c:125)
==12372==    by 0x698B91B: mca_base_framework_components_open (mca_base_components_open.c:68)
==12372==    by 0x699A4B2: mca_base_framework_open (mca_base_framework.c:176)
==12372==    by 0x511281B: mca_pml_cm_component_open (pml_cm_component.c:112)
==12372==    by 0x698B9FE: open_components (mca_base_components_open.c:125)
==12372==    by 0x698B91B: mca_base_framework_components_open (mca_base_components_open.c:68)
==12372==    by 0x50E6AA9: mca_pml_base_open (pml_base_frame.c:183)
==12372==    by 0x699A49C: mca_base_framework_open (mca_base_framework.c:174)
==12372== 

If I include unistd.h and use __environ instead the test program works. Looks like this happens because the values of env and __environ differ if setenv or putenv is called anywere in the program. You will have to drop the usage of the non-standard three-argument main.

@hjelmn
Copy link
Member Author

hjelmn commented Dec 17, 2015

Rebased off master.

@hjelmn
Copy link
Member Author

hjelmn commented Dec 21, 2015

:bot:retest:

2 similar comments
@hjelmn
Copy link
Member Author

hjelmn commented Dec 22, 2015

:bot:retest:

@hjelmn
Copy link
Member Author

hjelmn commented Jan 4, 2016

:bot:retest:

@hjelmn
Copy link
Member Author

hjelmn commented Feb 23, 2016

:bot:retest:

1 similar comment
@hjelmn
Copy link
Member Author

hjelmn commented Feb 24, 2016

:bot:retest:

@hjelmn hjelmn force-pushed the mpool_rewrite branch 2 times, most recently from 6614192 to fb833e8 Compare March 1, 2016 17:44
@hjelmn
Copy link
Member Author

hjelmn commented Mar 8, 2016

@sjeaugey Thanks for running MTT on the branch. I was able to fix what I think was causing the problems.

Also, I making an attempt to put CUDA support in vader. Should have something ready this week.

@bosilca
Copy link
Member

bosilca commented Mar 9, 2016

@hjelmn I would suggest you don't do it based on current SM support. We have a big PR coming with a significantly better approach (and also better performance). Would you be interested in attempting to add support in vader there ?

@hjelmn
Copy link
Member Author

hjelmn commented Mar 9, 2016

@bosilca Sure, I will wait. Once I get positive MTT results I will commit this PR. I will wait until your PR to look at smcuda.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 9, 2016

@sjeaugey Looks like the updated PR wasn't run last night. Can you check what revision was run?

@sjeaugey
Copy link
Member

sjeaugey commented Mar 9, 2016

@hjelmn I don't understand why it didn't run. Running it manually right now.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2016

@sjeaugey Any results? If this is working I want to get it merged in as soon as possible.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2016

@sjeaugey Looks like it ran last night and it looks clean. I will merge this later today.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2016

:bot:retest

@sjeaugey
Copy link
Member

@hjelmn Indeed it looks cleaner, except for one cuda test. However, I noticed yesterday that when running without any --mca btl argument (in fact when running with the default configuration) I got a segmentation fault on all the tests I tried. I don't know what we're using in this case (yalla?) but there seem to be an issue.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2016

Might be worth adding a -mca pml_base_verbose 100 to see what pml is being selected.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2016

@sjeaugey Found the bug that is causing the MTT failure. Will push after some testing.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 10, 2016

@sjeaugey Ok, should be good for real now.

hjelmn and others added 6 commits March 14, 2016 10:50
This commit rewrites both the mpool and rcache frameworks. Summary of
changes:

 - Before this change a significant portion of the rcache
   functionality lived in mpool components. This meant that it was
   impossible to add a new memory pool to use with rdma networks
   (ugni, openib, etc) without duplicating the functionality of an
   existing mpool component. All the registration functionality has
   been removed from the mpool and placed in the rcache framework.

 - All registration cache mpools components (udreg, grdma, gpusm,
   rgpusm) have been changed to rcache components. rcaches are
   allocated and released in the same way mpool components were.

 - It is now valid to pass NULL as the resources argument when
   creating an rcache. At this time the gpusm and rgpusm components
   support this. All other rcache components require non-NULL
   resources.

 - A new mpool component has been added: hugepage. This component
   supports huge page allocations on linux.

 - Memory pools are now allocated using "hints". Each mpool component
   is queried with the hints and returns a priority. The current hints
   supported are NULL (uses posix_memalign/malloc), page_size=x (huge
   page mpool), and mpool=x.

 - The sm mpool has been moved to common/sm. This reflects that the sm
   mpool is specialized and not meant for any general
   allocations. This mpool may be moved back into the mpool framework
   if there is any objection.

 - The opal_free_list_init arguments have been updated. The unused0
   argument is not used to pass in the registration cache module. The
   mpool registration flags are now rcache registration flags.

 - All components have been updated to make use of the new framework
   interfaces.

As this commit makes significant changes to both the mpool and rcache
frameworks both versions have been bumped to 3.0.0.

Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
This means we need not check for jemalloc in the configure script for
this component. Removing this.

In some machines having the TLS option on can cause errors in
opening this component. --disable-tls while configuring jemalloc.
Please look for instructions for installing jemalloc as a static
library linked directly into memkind in CONTRIBUTING file
github.com/memkind/memkindw
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
@sjeaugey
Copy link
Member

@hjelmn looks indeed good now !

@sjeaugey
Copy link
Member

@nhjelmn Oh wait. The test count in MTT is not right. The IBM test were not run. Need to figure out why.

@hjelmn
Copy link
Member Author

hjelmn commented Mar 15, 2016

@sjeaugey Should be ok. Those tests don't have any CUDA specific so should be no different than what I see on my mlx4 systems.

hjelmn added a commit that referenced this pull request Mar 15, 2016
@hjelmn hjelmn merged commit ec97120 into open-mpi:master Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants