Commit Graph
184 Commits
Author SHA1 Message Date
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
Veselin Dobrev a36f51db5b Update the methods:
* Vector::Sum() and
 * ParGridFunction::ExchangeFaceNbrData()

to work when the data is not on the host when called.
2019-06-18 19:12:50 -07: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
camierjs 689fb17113 Vector::operator* tries 2019-05-28 21:07:04 -07:00
Tzanio 2c1d07c127 Merge branch 'memory-dev' of github.com:mfem/mfem into memory-dev 2019-05-24 15:41:51 -07:00
Tzanio 342fb5058f Renamed MFEM_FORALL_IF -> MFEM_FORALL_SWITCH 2019-05-24 15:41:47 -07:00
camierjs c78de477bf Remove !MFEM_USE_SUBVECTOR_KERNELS code sections 2019-05-24 15:33:08 -07:00
Tzanio 0401024513 Minor. 2019-05-24 15:32: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
Veselin Dobrev 534bf51466 Addressing some of the PR feedback. 2019-05-21 02:19:05 -07:00
Veselin Dobrev f8d1f5d557 Make sure GridFunction::MakeRef marks itself and its base vector
for execution on the mfem::Device.

Refine the logic in Vector::operator=.

Update the comment for Memory::SyncWith.
2019-05-18 00:40:43 -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
Veselin Dobrev 10b3988449 Reworked the macro MFEM_CUDA_CHECK:
* It always performs the error check, no just in debug mode.
* All 'cuda*' runtime calls are now wrapped with this macro.
2019-04-22 15:17:04 -07:00
camierjs 3e34d4b99a Cleanup, style and remove all CUdevice, CUcontext & CUstream 2019-04-19 11:00:23 -07:00
camierjs d3a1685cb6 Remove CU driver calls 2019-04-17 17:36:43 -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
camierjs 2020335b50 Renaming + free functions in mfem namespace 2019-04-09 18:17:00 -07:00
Tzanio a49cd5df97 Merge branch 'okina-device-tweaks' into okina-rename
Conflicts:
        fem/bilinearform_ext.cpp
        fem/bilininteg_ext.cpp
        general/cuda.cpp
2019-04-09 18:08:44 -07:00
Veselin Dobrev ce2c543339 Update calls to Device::IsEnabled() and Device::IsDisabled() with
appropriate calls to Device::Allows().
2019-04-09 17:51:19 -07:00
camierjs 94c5397c7d Remove the memory manager singleton 2019-04-09 17:12:20 -07:00
Tzanio 8d43da7938 Loop styling 2019-04-09 12:17:38 -07:00
camierjs 471eba4d2d Move Device::Tracking to mm::Enable/Disable
Swap lasts +=1 for ++
2019-04-09 11:42:12 -07:00
Veselin Dobrev 600f5ec4bd Some additional simplifications and tweaks in headers.
Add MFEM_CUDA_CHECK_{DRV,RT} macros.
2019-04-09 00:37:58 -07:00
Tzanio e0c45fb9d4 Reserve okina name for future kernel interface 2019-04-08 23:39:10 -07:00
Veselin Dobrev 55f0a7ec66 Updates to the mfem::Device class. 2019-04-08 16:48:56 -07:00
Tzanio eaa4a1e98d Simplified MFEM_FORALL. Fixed doxyge errors. 2019-04-08 11:55:00 -07:00
Johann Dahm 2d8a2d250b Fix "legacy" OpenMP support 2019-04-05 17:14:36 -07:00
Johann Dahm e357792bf0 Merge branch 'okina' into openmp-warning-dev 2019-04-05 16:18:14 -06:00
Johann Dahm a2614ad20f MFEM_USE_OPENMP -> MFEM_USE_LEGACY_OPENMP 2019-04-04 20:26:38 -07:00
Johann Dahm 8409f6e819 Revert "Renamed the old OpenMP support option to MFEM_LEGACY_USE_OPENP, so"
This reverts commit 575f351419.
2019-04-04 20:25:45 -07:00
Tzanio 575f351419 Renamed the old OpenMP support option to MFEM_LEGACY_USE_OPENP, so
MFEM_LEGACY_OPENMP can be used for OpenMP support in the Okina kernels.
2019-04-04 19:50:46 -07:00
Will Pazner a5ecb742a0 Revert to using new and delete
Also rename mm::malloc to mm::New and mm::free to mm::Delete.
2019-04-04 13:44:10 -07:00
camierjs 8a4ae9a556 Rework include hierarchy not to present cuda/occa internal headers
Separate dvector3 from dtensor because it is used in coefficient.hpp
2019-04-04 11:45:46 -07:00
dmed256 2f45b3978c Feedback updates 2019-04-02 13:59:10 -07:00
Tzanio 214ec1d0fe Edits, style, removed DumpMode() 2019-03-25 14:53:30 -07:00
camierjs a03364e473 MFEM_GPU_CANNOT_PASS cleanup and simplify cuda header 2019-03-25 12:55:19 -07:00
Tzanio 614c78b65e Renamed the config class to Device, and simplified its use in the examples. 2019-03-22 14:15:27 -07:00
Tzanio bb7c142ce0 Renamed linalg/device.hpp to linalg/dtensor.hpp.
Some edits in the examples.
2019-03-22 12:15:14 -07:00
Tzanio b589caf151 Replaced __NVCC__ -> MFEM_USE_CUDA and __OCCA__ -> MFEM_USE_OCCA 2019-03-21 17:23:27 -07:00
camierjs 4a61377ddc Cleanup 2019-03-20 10:18:50 -07:00
camierjs 27c42047ed make style 2019-03-11 18:51:30 -07:00
camierjs 5ec82bdfd2 Deleted linalg/kernels/vector.?pp 2019-03-06 18:14:33 -08:00
camierjs 96b5389c07 Make style 2019-03-06 11:58:57 -08:00