Commit Graph
108 Commits
Author SHA1 Message Date
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 798ded1f55 Merge branch 'master' into memory-dev 2019-05-22 23:53:04 -07:00
Veselin Dobrev 534bf51466 Addressing some of the PR feedback. 2019-05-21 02:19:05 -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
Tzanio 5b00c3d0e6 Merge branch 'master' into stefanozampini/small-improvements
Conflicts:
	fem/bilininteg.hpp
2019-05-15 11:38:18 -07:00
Veselin Dobrev 5b5769dea3 In class SparseMatrix:
* Add methods BuildTranspose() and ResetTranspose() that control
  the use of the internal transpose matrix, At.
* The method AddMultTranspose() will always use At, if it is built.
  If At is not build and the Device is enabled, an error will be
  generated pointing to BuildTranspose().
* Introduce separate non-const and const versions of the methods
  GetI(), GetJ(), and GetData().
* Made the method ActualWidth() const.
* Some edits in the documentation, the code formatting, and the
  error messages.

In the method BilinearForm::FormLinearSystem(), call the method
SparseMatrix::BuildTranspose() for the nonconforming prolongation
matrix, when necessary.
2019-04-23 17:48:40 -07:00
Tzanio dbaa40a116 Renamed tA to At 2019-04-19 12:31:58 -07:00
camierjs 06ee78f67c Switch to use Device::IsEnable 2019-04-19 10:59:01 -07:00
camierjs be8eac8997 Keep legacy AddMultTranspose code for non-accelerated runs 2019-04-19 10:16:02 -07:00
camierjs 890579e228 Cleanup and add a self-transposed sparse matrix that is used 2019-04-19 09:48:15 -07:00
camierjs ceb8bb1417 Remove AtomicAdd from sparsemat AddMultTranspose 2019-04-18 18:21:06 -07:00
Stefano Zampini 6c129fc80d rename SparseMatrix::Chop -> SparseMatrix::Threshold 2019-04-10 11:33:03 +03: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
camierjs 94c5397c7d Remove the memory manager singleton 2019-04-09 17:12:20 -07:00
camierjs 471eba4d2d Move Device::Tracking to mm::Enable/Disable
Swap lasts +=1 for ++
2019-04-09 11:42:12 -07:00
Tzanio e0c45fb9d4 Reserve okina name for future kernel interface 2019-04-08 23:39:10 -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
Jean-Sylvain Camier bcf4761318 Simplify the use of mm::ptr 2019-04-04 20:24:31 -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 a920632877 Merge branch 'okina' into okina-free-malloc 2019-04-04 11:52:53 -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
camierjs 4af052d69b Revert to __CUDA_ARCH__ and warning fix 2019-04-03 16:32:39 -07:00
Will Pazner 4292eb80bc Replace new and delete with malloc and free in mm
This matches the names of the functions in mm:: and also more closely
matches their use in the rest of mfem.

Also removed the template parameter for mm::free since it is not needed.

It is possible in the future to add equivalents of new and delete to the
mm class (with different names since those are keywords) in case it is
desirable to call the constructor and destructor.
2019-04-03 16:14:13 -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
camierjs f41a0e90a9 Makefile cross-compiler, examples 1, 1p, 6, 6p and Laghos on GPU+MPI 2019-03-15 18:28:35 -07:00
Stefano Zampini 3ed3353645 SparseMatrix: added Chop method to remove zeros from CSR of the matrix 2019-03-14 21:17:40 +03:00
camierjs 3ae0d68d50 Remove unused mm calls and linalg/kernels/sparsemat 2019-03-06 13:39:44 -08:00
camierjs 9c55239a01 linalg/device nullptr fix and CUDA N==0 return 2019-03-06 10:15:03 -08:00
camierjs e4efdf5228 Remove unneeded GPU barrier for Laghos 2019-03-05 12:40:36 -08:00
camierjs 64cf91cf21 - config rename convention
- ex1, ex6 switch back to host
- mm filtering
- dot device ptr call
2019-03-05 12:20:26 -08:00
camierjs 3940c55fc3 Cleanup 2019-03-05 09:07:04 -08:00
camierjs 8751ac6944 Remove GET_PTR* macros 2019-02-20 12:37:32 -08:00
camierjs 94e7606e46 Unit tests + CPU examples through MM and Laghos 2019-02-08 17:25:01 -08:00
camierjs af29bcdfba Cleanup 2019-02-08 16:43:40 -08:00
camierjs 9b3fc4d585 new/delete through mm_*, to work with LD_PRELOAD and stack 2019-02-07 19:59:33 -08:00
camierjs d1c153f8cc mm_(malloc|free) 2019-02-07 17:25:28 -08:00
camierjs 70b149dac1 WIP unit tests through the MM 2019-02-06 21:18:20 -08:00
camierjs 570eda5cf6 Bring back the MFEM_GPU_CANNOT_PASS in linalg 2019-02-01 15:15:40 -08:00
camierjs 5e0feb05b7 make style 2019-01-31 17:07:01 -08:00
camierjs e66baf8019 Remove GPU guards 2019-01-31 14:24:25 -08:00