Commit Graph
243 Commits
Author SHA1 Message Date
Tzanio 6d2530775b Extended copyright to 2022 2022-02-25 10:24:50 -08:00
Will Pazner 14b48da4d2 Merge remote-tracking branch 'origin/master' into shadow-out-dev 2022-02-18 08:20:52 -08:00
Tom Stitt cbfb0a7ed2 use memcpyasync for d2d in the regular hipdevicememoryspace
add notes about reasons
2022-01-27 10:47:17 -08:00
Tom Stitt cf3173ab92 for the Umpire device space use HipMemcpyDtoDAsync instead of (sync) version to avoid unnecessary host blocking 2022-01-21 14:02:39 -08:00
Stowell, Mark L 63381b366a Renaming ostream variables from out to os 2022-01-18 15:06:46 -08:00
Stowell, Mark L f7c9bdab17 Renaming "out" and "err" local variables to avoid globals 2021-12-22 15:19:20 -08:00
Veselin Dobrev e9af593bd3 Update an MFEM_ASSERT for a special case that comes up when
using 'host-umpire' memory which is the default when MFEM is
built with Umpire.
2021-10-07 19:04:12 -07:00
Tom Stitt 0bd6208942 use QuickPool instead of DynamicPool; requires Umpire >=3 so bump the version in INSTALL 2021-10-07 16:44:48 -07:00
Tom Stitt 3db650c24f umpire 6 requires us to include the specifc strategy header we are using 2021-10-06 18:04:05 -07:00
Veselin Dobrev 2ae031628b Remove alias check from MemoryManager::EraseDevice.
Fix CMake build when both CUDA and OpenMP are enabled.
2021-07-29 14:36:37 -07:00
Tzanio 810ecc6a9f typo 2021-07-22 18:07:55 -07:00
Veselin Dobrev 3f40c5796f More bugfixes and tweaks for hypre+cuda support. 2021-07-22 08:57:25 -07:00
Veselin Dobrev ae1445e9ca Merge branch 'master' into hypre-cuda-dev
Resolved conflicts:
   general/mem_manager.cpp
2021-07-22 06:59:42 -07:00
Tzanio Kolev e654f4c607 Merge pull request #2203 from mfem/form-linear-system-tweak
Tweak FormLinearSystem methods
2021-07-21 08:27:28 -07:00
Tzanio cc9fda7d8f Merge branch 'master' into form-linear-system-tweak 2021-07-15 18:29:13 -07:00
Veselin Dobrev 15465cf610 More tweaks and updates for hypre built with cuda. 2021-07-03 22:24:57 -07:00
Veselin Dobrev 64aba43d18 More bugfixes and tweaks for hypre+cuda support. 2021-06-25 23:17:23 -07:00
Veselin Dobrev a9d4da4a9e A few fixes after the merge from 'master' 2021-06-22 15:52:32 -07:00
Veselin Dobrev bbf9842cda Merge branch 'master' into mem-dangling-aliases-fix
Resolved conflicts:
   general/mem_manager.cpp
2021-06-22 14:52:56 -07:00
Veselin Dobrev 136d166e88 Add CUDA/HIP tests for examples that support devices.
In class HypreParMatrix, use "HypreRead" instead of "HypreReadWrite"
at the end of constructors that use host input.

Add an internal debugging option that prints information from some
memory manager methods, see the define MFEM_TRACK_MEM_MANAGER in
general/mem_manager.cpp.
2021-06-21 18:34:16 -07:00
Veselin Dobrev e0a65be94b Fix serial build.
Fix some issues seen when running 'punit_tests'.
2021-06-18 12:33:56 -07:00
Veselin Dobrev 602c2c84e7 Work in progress.
With a non-CUDA hypre build, 'make test' should work fine.

With a CUDA hypre build:
  * Only some tests in 'make test' work.
  * 'ex1p' and 'ex2p' should work with "cpu" and "cuda" devices with
    any number of processors.
  * Most of the other examples and miniapps still need work.
2021-06-17 11:53:44 -07:00
Veselin Dobrev ad24e6f68e A few small tweaks. 2021-06-11 16:14:52 -07:00
Veselin Dobrev b460af2b69 In class Memory, add methods to explicitly access the host and
device memory types.

Add a function that checks if a MemoryType is contained in a
given MemoryClass.

Various small additions and tweaks in the hypre*.{h,c}pp files.
2021-06-10 12:08:07 -07:00
Veselin Dobrev 135964b3ba Revert some changes in general/mem_manager.cpp
Fix warnings in linalg/hypre.hpp

Simplify and fix a warning in GetMinElt in fem/restriction.cpp

Fix a warning in miniapps/navier/navier_tgv.cpp

Fix out-of-source build in miniapps/solvers/makefile

In makefile, do not modify the value of MFEM_HOST_CXX if it
is already defined, e.g. read from config.mk.
2021-06-08 09:45:43 -07:00
Veselin Dobrev fe60d34610 Merge branch 'master' into hypre-cuda-dev
Resolved conflicts:
   INSTALL
   linalg/hypre.cpp
   linalg/hypre_parcsr.cpp
2021-05-27 15:12:29 -07:00
Veselin Dobrev e79b2e23be In order to support the use of global objects (initialized
before the memory manager configuration) on device with the
"debug" device, tweak the memory manager configuration method
to update the duals of all host memory types (except MANAGED)
to be DEVICE_DEBUG.

Global objects returned by Geometries.GetGeomToPerfGeomJac no
longer need to be copied before they can be used on device
with the "debug" device.
2021-05-13 19:15:51 -07:00
Veselin Dobrev b7ab371c80 Tweak the impementation of Vector::NewMemoryAndSize to create
an alias when the 'own_mem' parameter is fasle.

Several simplifications/tweaks related to Vector::NewMemoryAndSize
and Vector::MakeRef in BlockVector, GridFunction, LinearForm, and
ParBlockNonlinearForm.

Add more MFEM_ASSERTs in MemoryManager::Delete_.

Remove MemoryManager::RegisterAliasBases().

In Memory<T>::MakeAlias, register the 'base' when the globally
configured device memory type (which can be a host type, e.g. when
running on host) is a device memory type. Always registering the
'base' creates errors in the unit tests:
   "alias already exists with different base/offset!"
which are probably due to dangling aliases. If we want to always
register the 'base', we need to address these errors.

Updated the unit test "MemoryManager/Scopes" to test for the new
behavior of Vector::NewMemoryAndSize.

Disable the unit test "MemoryManager" since it defined a Device
object which destroys the MemoryManager at the end of the test.
2021-05-12 13:47:11 -07:00
Veselin Dobrev e97f9051ce Apply reviewer suggestions by @YohannDudouit. 2021-04-30 20:25:52 -07:00
Veselin Dobrev 41bb2bdb94 Reset 'register_alias_bases' when the memory manager is
destroyed.
2021-04-28 15:25:35 -07:00
Veselin Dobrev bb5d5be92c Proposed solution for avoiding the error:
'Cannot register an alias!'

The proposed solution is to register the 'base' Memory inside
the call Memory<T>::MakeAlias unless the current device
configuration is not using a device.

Since device allocation is now done lazily, there will be no
unnecessary device allocations.
2021-04-28 13:40:17 -07:00
Veselin Dobrev 8ca6247b3e When FormLinearSystem methods define the true-dof versions of
X and B, use Vector's MakeRef instead of NewMemoryAndSize in the
case when the FE space prolongation is identity.

In MemoryManager::Insert, when re-inserting the same host pointer
allow the new pointer to have d_mt == MemoryType::DEFAULT in the
debug check.

In GridFunction::{MakeRef,MakeTRef} check for identity prolongation
with the method IsIdentityProlongation.
2021-04-27 12:36:49 -07:00
camierjs 2b2919b806 Merge master in tmopt 2021-03-28 12:51:39 -07:00
camierjs e10d5fb0f8 Remove VERIFY in UpdateDualMemoryType 2021-03-24 14:47:37 -07:00
camierjs 5345f9aa52 Add an UpdateDualMemoryType internal method used internally for SetDualMemoryType 2021-03-24 14:41:15 -07:00
Tom Stitt 34c007935c add hip host pinned memory
add hip support to umpire memory test
2021-03-19 17:39:24 -07:00
Veselin Dobrev a59f06e9e3 Replaced the methods Device::SetHostMemoryType() and
Device::SetDeviceMemoryType() with the method
Device::SetMemoryTypes() which can be called only before
Device configuration.

Added methods MemoryManager::GetDualMemoryType() and
MemoryManager::SetDualMemoryType() where the latter can be
called only before MemoryManager::Configure().

Updated the Memory/MemoryManager implementation to use the
dual memory types instead of the default memory types.

Various other tweaks and fixes in the Memory/MemoryManager
implementation.
2021-03-18 18:48:22 -07:00
Tom Stitt fb92b9e992 cleanup and minimize diff to master 2021-03-08 09:55:17 -08:00
Tom Stitt 5b377f6d2c Implement Memory::New(size, h_mt, d_mt), required updates in a number
of places
Remove GetDualMemoryType_
All umpire tests are passing but there are still some TODOs
2021-02-25 17:24:29 -08:00
Tom Stitt 22ec73e780 Revert device.cpp changes and remove automatic use of Umpire if
MFEM_USE_UMPIRE
Fix build; building with Umpire & CUDA now
2021-02-25 14:56:05 -08:00
Tom Stitt 40f3d0fd94 fix up some formatting 2021-02-25 14:29:47 -08:00
Tom Stitt a1fbbbc35e cleanup UmpireMemorySpaces, switch to names instead of ids since we had to pass a name anyways
update umpire test

make style

this is not yet ready to test but I'm adding changes incrementally
2021-02-25 14:16:21 -08:00
Tzanio 2064b3b891 Merge branch 'master' into feature/tomstitt/temp-mem-type 2021-02-05 13:08:10 -08:00
Dylan Copeland ce484c0133 Merge branch 'master' of github.com:mfem/mfem into hypre-cuda-dev 2021-01-26 12:48:11 -08:00
Adrien M. Bernede 04fb572359 Let's forget about 2020 2021-01-26 11:55:36 -08:00
Tom Stitt 06786f5540 Switch temporary memory handing so that Device allocators
can optionally define a AllocTemp method.
Use MemoryClass at ctor time for optional device memory type
targetting; add example to Vector.
Remove DeviceUmpireTempMemoryType
Remove UpdateDeviceType
Add cuda_umpire.cpp example, still a little bit of WIP
- move to tests later
2021-01-12 15:29:27 -08:00
Tom Stitt 88bf3467da grab changes from feature/apps/dev 2020-12-11 11:36:44 -08:00
Tom Stitt 56c3bda33e Merge remote-tracking branch 'origin/master' into feature/tomstitt/temp-mem-type
Switches to int id from string name for umpire allocator
2020-12-11 10:36:50 -08:00
camierjs 9f7720e69f Merge master in tmopt 2020-11-18 20:03:06 -08:00
Veselin Dobrev 1de94adf90 Fix for newer versions of Umpire. 2020-11-02 23:52:05 -08:00