Commit Graph
161 Commits
Author SHA1 Message Date
camierjs a92d9e10c7 ex1, ex6 mmu test fix 2019-07-12 17:09:45 +02:00
camierjs d4d526e9ca illegal memory access with m_type for host 2019-07-12 16:07:24 +02:00
camierjs 339febddbc Registration & results 2019-07-12 11:47:17 +02:00
camierjs bd8d6c090b Illegal memory access caught 2019-07-11 11:41:43 +02:00
camierjs d133d6c115 WIP on ex1 with debug device 2019-07-09 17:09:38 +02:00
camierjs 2479490ed0 Introduce memory controllers 2019-07-08 17:11:13 +02:00
camierjs 0bb24e7fce Cleanup 2019-07-08 14:41:37 +02:00
camierjs ec429a89fe Merge branch 'master' into okina-mmu 2019-07-08 11:51:22 +02:00
Veselin Dobrev 6e457ec497 Fix a few issues related to using the classes SparseMatrix,
HypreParVector, HypreParMatrix, and HypreSmoother with GPU backends.

Add 2 versions of a new method: Vector::MakeRef -- one that takes
a Vector and an offset and another that takes a Vector, an offset
and a new size.

Add some simple debugging tools:
 * Add a new output "trace" stream: mfem::trc. By default, the output
   of mfem::trc goes to std::cout; the new function mfem::OpenTraceFile()
   can be used to redirect the output of mfem::trc to a file called
   'mfem-trace-<pid>' where <pid> is the process id. Note that this
   function can be called from a debugger.
 * In class Vector, add a new method Vector::PrintTrace() that prints a
   Vector to the mfem::trc stream -- this method can be called from a
   debugger, unlike Vector::Print with mfem::trc as argument (at least
   in gdb this did not work).
 * In class Memory<T>, add 2 new methods: PrintFlags() and
   CompareHostAndDevice() which are explicitly instantiated for T=int
   and T=double, so that they can be called inside a debugger for
   these two types.
2019-06-17 18:55:17 -07:00
Tzanio 32d7e036e7 Renamed
MemoryType GetSuitableMemoryType(MemoryClass mc);

to

  MemoryType GetMemoryType(MemoryClass mc);
2019-05-24 15:54:24 -07:00
camierjs bd08fa9592 Merge branch 'memory-dev' of github.com:mfem/mfem into memory-dev 2019-05-24 14:21:12 -07:00
camierjs 283264ade4 {Read,Write,ReadWrite}Access => {Read,Write,ReadWrite}
Add shortcut for Host{Read,Write,ReadWrite}
2019-05-24 14:08:45 -07:00
Tzanio e36d1ea8fd Several change to (hopefully) simplify the interface:
* The parameter of Vector::UseDevice(bool) no longer has a default value. All
  the calls to UseDevice() in operator.cpp bilinearform_ext.cpp gridfunc.?pp and
  linearform.?pp have been replaced with UseDevice(true).

* Added shortcuts for the device flags of the Memory objects inside the Vector
  and Array classes:

    bool Array::UseDevice()
    bool Vector::UseDevice()

* The internal device flag in Memory::FlagMask is now called USE_DEVICE (it was
  previously called EXEC_FLAG). The accessor function for this flag have been
  renamed:

    bool Memory::GetExecFlag()     -> bool Memory::UseDevice()
    void Memory::SetExecFlag(bool) -> void Memory::UseDevice(bool)

* Further renamed:

    Memory::SyncWith         -> Memory::Sync
    Memory::SyncAliasToBase  -> Memory::SyncAlias
    Memory::SyncAliasToBase_ -> Memory::SyncAlias_

* Replaced FIXME with TODO in general/mem_manager.cpp
2019-05-24 14:01:15 -07:00
Veselin Dobrev b69fd1e038 Some tweaks and additions to the MemoryManager class.
Modify the Device class to require the creation of an object in
order to use backends other then Backend::CPU. At destriction,
this object will call the Destroy() method of the MemoryManager to
deallocate any remaining registered device pointers.

In class Device, remove the method Disable() and make the method
Enable() private.

Use a global Array<double> as the buffer used by the cuda functions
for minimum and dot product.
2019-05-23 23:21:27 -07:00
Tzanio 41cf43c88c Minor 2019-05-22 03:44:49 -07:00
Tzanio 3d88be85bc Removed MFEM_USE_MM -- it is no longer necessary 2019-05-21 19:18:50 -07:00
Veselin Dobrev 534bf51466 Addressing some of the PR feedback. 2019-05-21 02:19:05 -07:00
Veselin Dobrev e332d2713f Address some FIXME comments. 2019-05-18 16:29:06 -07:00
Veselin Dobrev 31f2ce99cc Some small tweaks and additions related to the classes Memory and
MemoryManager.
2019-05-17 16:26:20 -07:00
Veselin Dobrev 40378a046b Introduce a new Memory class for handling host + device allocations
and transfers.

The Memory class is now used by some MFEM classes (like Array and
Vector) which can be used on the Device. Such classes now provide
methods to access the underlying Memory object, e.g. GetMemory.

Updated ex1/ex1p and ex6/ex6p to not need to enable/disable the
Device at specific points -- the Device is now enabled just at the
start. Also, the same examples can now run on Device (e.g. -d cuda)
without the partial assembly option (-pa) -- full assembly will
be still done on CPU but the sparse matrix action and vector
operations will be done using the Device.

Reverted changes in class DenseMatrix related to using the Device.
At this point, DenseMatrix operations are only used for small matrices
and using the Device in this case is not a good option.
2019-05-16 14:53:39 -07:00
camierjs f97a7fabc4 Merge branch 'okina-mmu' of github.com:mfem/mfem into okina-mmu 2019-05-01 16:59:46 -07:00
camierjs a9aded14f6 Combine h_ptr and d_ptr and add a UvmCopyMemorySpace 2019-05-01 16:58:48 -07:00
Tzanio 803bb73fea small edits 2019-05-01 15:48:29 -07:00
Tzanio e79e761939 make style 2019-05-01 15:42:02 -07:00
camierjs 9ab63790fb Re-enable push for aliases 2019-05-01 13:58:32 -07:00
camierjs 389d090bf0 Fix Pull 'on_host' logic
Remove vector push
Remove a couple of Device::Enable/Disable
2019-05-01 11:02:10 -07:00
camierjs fbafd0b59d Cleanup & style 2019-04-30 18:42:12 -07:00
Tzanio c41bf2ace5 Small edits 2019-04-30 11:43:24 -07:00
camierjs 74f6cbb15e Cleanup & style 2019-04-29 18:16:12 -07:00
camierjs 9d1b450844 Umpire + MemorySpace features: STD, CUDA, UNIFIED, ALIGNED & PROTECTED 2019-04-29 15:37:40 -07:00
camierjs 88f8d39a0a MFEM_CUDA_CHECK fix 2019-04-24 14:27:26 -07:00
camierjs 1561b3801a Fix MFEM_USE_CUDA guards 2019-04-24 13:17:19 -07:00
camierjs b02e77063f Add CUDA_UVM backend 2019-04-24 13:08:21 -07:00
camierjs 50c7215a13 Remove warnings 2019-04-23 18:40:33 -07:00
camierjs 2343ab9c71 Memory spaces modes: DEFAULT/NONE, DEFAULT/CUDA, ALIGNED/CUDA, PROTECTED/CUDA, PROTECTED/DEBUG 2019-04-23 18:35:44 -07:00
camierjs 3e34d4b99a Cleanup, style and remove all CUdevice, CUcontext & CUstream 2019-04-19 11:00:23 -07:00
camierjs 0f69bf366a Memory manager cleanup 2019-04-18 09:58:04 -07:00
camierjs 15c8ba7ba1 WIN32 guards and rename MemoryController to MemorySpace 2019-04-18 09:50:54 -07:00
camierjs 2108c1d3eb WIN32 ifdefs 2019-04-16 18:56:25 -07:00
camierjs 64cad6cee5 Add a 'debug' device to test the code path
Add different memory controllers: default, protected and CUDA
2019-04-12 18:05:52 -07:00
camierjs 0f092466b9 Merge branch 'master' into okina-mmu 2019-04-12 11:55:47 -07:00
camierjs 2a554ee768 Memory manager maps erase fix 2019-04-11 17:11:23 -07:00
camierjs eb32fdff5f Move the 'destroyed' bool to an 'exists' section to allow pre-mm objects to be allocated. 2019-04-10 17:06:22 -07:00
Jean-Sylvain Camier 8fd837e6ab Move 'destroyed' as a member of MemoryManager 2019-04-10 08:26:22 -07:00
camierjs e3df31e956 Initialize enabled = true in the MemoryManager and local variables renaming 2019-04-09 20:18:26 -07:00
Tzanio a28a779df1 Merge branch 'okina' into okina-mm-object
Conflicts:
        fem/bilininteg_ext.cpp
        general/mem_manager.cpp
	general/mem_manager.hpp
	general/occa.cpp
2019-04-09 19:19:45 -07:00
Tzanio Kolev a65c4c40d4 Merge pull request #848 from mfem/okina-rename
Okina rename [okina-rename]
2019-04-09 18:41:53 -07:00
Tzanio Kolev 030ac61fd9 Merge pull request #845 from mfem/okina-device-tweaks
Some tweaks to the mfem::Device class [okina-device-tweaks]
2019-04-09 18:37:58 -07:00
Tzanio 50b7e4cc69 Documentation 2019-04-09 18:31:38 -07:00
camierjs 2020335b50 Renaming + free functions in mfem namespace 2019-04-09 18:17:00 -07:00