Commit Graph
254 Commits
Author SHA1 Message Date
David Dement 314a32af2e Fixes comilation errors when compiling with gcc-13 on Fedora 38
When compiling with gcc-13, types such as uint64_t are not defined.
It is likely that <cstdint> is included implicitly with older compiler
versions.
2023-04-27 10:33:51 -04:00
Veselin Dobrev 1f4cc7c9ae In MemoryManager::Register_, check for alias after checking for
nullptr -- it is okay to try to register an alias to nullptr.
2023-04-12 23:39:43 -07:00
Veselin Dobrev fc0602cf16 In the memory manager, when creating an alias memory to nullptr,
do not set the flag OWNS_INTERNAL of the alias.
2023-04-10 20:20:08 -07:00
Tzanio Kolev 96e00dc815 Updated COPYRIGHT to 2010-2023 2023-03-11 16:58:18 -08:00
Veselin Dobrev 119451df1a Rename NO_ERROR_ to No_Error and REGISTERED_ to Registered 2023-03-06 16:26:45 -08:00
Cyrus Harrison 06beca6d83 changes to enums to avoid windows macro conflicts 2023-02-21 10:59:20 -08:00
William S. Moses 973b42c57a Simplify 2022-12-16 17:19:02 -05:00
William S. Moses 0f75a95372 Modifiy Delete_ to not return a value 2022-12-15 18:06:16 -05:00
Will Pazner 24825a5d26 Replace sprintf with snprintf 2022-11-05 13:38:42 -07:00
Veselin Dobrev 215d037a5a Fix a bug:
#elif MFEM_USE_HIP  -->  #elif defined(MFEM_USE_HIP)
2022-10-21 16:50:22 -07:00
Tzanio Kolev 19e40fa95f Typos 2022-10-21 15:00:47 -07:00
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