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
Support for hypre mixedint #1583
Conversation
@jandrej , I think I found all of the Thanks for tackling this! |
Thanks! Compiles fine,
This is not testing problems larger than |
That looks like something @dylan-copeland will want to take a look at. I'm not familiar with |
This branch doesn't seem to compile with HYPRE version 2.12.0 because |
I think this will be easy to add: for older versions of hypre (checked using |
The issue with |
I pulled from master and checked that the unit tests pass, so @v-dobrev is right. |
Great, lets wait for the merge and then I try some large problems and report back what breaks. |
A few tweaks to support older versions of hypre. Run 'make style'.
It turns out --enable-mixedint Use long long int for HYPRE_BigInt and int for
HYPRE_Int (default is int for both). Note: This
option disables Euclid, ParaSails, pilut and CGC
coarsening. Because of this and how the makefiles work, building on Mac with ar -rcu libHYPRE.a
ar: no archive members specified
usage: ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...] One workaround for this is to combine the following lines: https://github.com/hypre-space/hypre/blob/b075d642550c9947b758201f41f5d38dabfe7a51/src/lib/Makefile#L82-L84 with the previous line, so that the list of files is not empty. |
Fix a bug affecting HYPRE_MIXEDINT builds -- 'make test' still shows a lot of failures in this case.
All tests in 'make test' seem to pass now.
of HYPRE_Int where appropriate.
number of elements is less than the number of processors.
For proper mixedint support, we need to use the latest HYPRE master (any commit after hypre-space/hypre@13e2cad). We should document this in |
Take 2: How far are we from marking this as |
I'd like to do 2 things before we go into review
|
Running My personal feeling is that testing ex1p, ex2p, ex3p and ex4p should be sufficient. We can add maybe ex8p, ex11p and ex13p to that, but I don't think we need to run every single parallel example. |
/** This is a compact text representation of the local data of the | ||
HypreParMatrix that can be used to compare matrices from different runs | ||
without the need to save the whole matrix. */ | ||
void PrintHash(std::ostream &out) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -212,6 +213,84 @@ class HashTable : public BlockArray<T> | |||
}; | |||
|
|||
|
|||
/// Hash function for data sequences. | |||
/** Depends on GnuTLS for SHA-256 hashing. */ | |||
class HashFunction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be #ifdef MFEM_USE_GNUTLS
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need -- the implementation has the #ifdef
s. If you don't have GnuTLS, you'll get a hash string that says you need GnuTLS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks. Do you want to mention any of the hash changes in CHANGELOG
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not crucial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is GnuTLS already installed on LC, or does someone know how to install it? Is it the one at https://github.com/gnutls/gnutls so we just need to clone and follow their build instructions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @v-dobrev, I tried that but apparently need something else:
In file included from general/hash.cpp(15):
/usr/include/gnutls/crypto.h(35): error: identifier "gnutls_cipher_algorithm_t" is undefined
gnutls_cipher_algorithm_t cipher,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Mac I got it working, using a brew
installation of gnutls
. Maybe on LC some include directory needs to be specified? Anyway, the hash feature is a really nice addition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the mac it works for me too. On LC I get the same error with @dylan-copeland. All paths look ok... so It's not clear to me what's wrong here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for testing this. I pushed a fix for the issue -- that version of GnuTLS needed <gnutls/gnutls.h>
to be included before <gnutls/crypto.h>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I confirmed it works now on LC.
LGTM |
LGTM |
@dylan-copeland and @psocratis, can you please take a quick look? |
I will need some to test it first, by tomorrow maybe? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jandrej !
HYPRE_Int *j_offd_hi = j_offd; | ||
#else | ||
HYPRE_Int *j_offd_hi = Memory<HYPRE_Int>(offd_cols); | ||
Memory<HYPRE_BigInt>(j_offd, offd_cols, true).Delete(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is j_offd
created and then deleted? Can this be simplified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a trick to delete a host pointer that was allocated via the memory manager (using the currently set host allocator). The respective allocation is done with something like HYPRE_BigInt *j_offd = Memory<HYPRE_BigInt>(size);
-- you can check above that j_offd
was allocated that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check that the right type is used everywhere in MFEM, but the changes that were made in this PR look correct, and I suppose if something is wrong it will show up when a hypre solve fails. It seems other examples also work (e.g. ex3p), so the CHANGELOG could state that (it would require some more testing to be sure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it's really hard to check all the places for the appropriate changes, this looks very good. Some examples that I ran with more than 2 billion dofs seem to work just fine.
which seems to be necessary for some versions of GnuTLS.
Merged in |
There are number of errors from tonight's autotest (due to older version of hypre?):
See |
Ah, yes, forgot about older versions. I'll fix it. |
versions of hypre.
Re-merged in |
@tzanio I started doing some large tests, to verify this branch for examples other than |
Thanks @dylan-copeland. I will merge as is. |
This PR should add support for hypre built with the option
--enable-mixedint
, e.g. allow local sizes to use 32bit integers and global sizes to use 64bit integers.I added an initial guess of changes and I hope that we get a group of contributors that go through a group of files and check for errors or add changes.
Right now the code branch does not compile without changes. What I did locally was commenting out the complex operator files. With that
ex1p
runs fine in serial and parallel.If you participate and want to compile individual files, I recommend using the makefile build system and specifying the file you are working on with
this way you only get the errors from the file you are looking at.
I'd especially like to see someone help with the complex stuff, since I'm not comfortable just churning through the files. @dylan-copeland @mlstowell @psocratis
TODO:
INSTALL
, document that mixed-int support requires hypre >= 2.20.0