Commit Graph
53 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
Tzanio 41cf43c88c Minor 2019-05-22 03:44:49 -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 2020335b50 Renaming + free functions in mfem namespace 2019-04-09 18:17:00 -07:00
camierjs 94c5397c7d Remove the memory manager singleton 2019-04-09 17:12:20 -07:00
Tzanio c86cb78a7b Removed printfs, updated version.cpp 2019-04-05 16:41:43 -07:00
Veselin Dobrev cbb4984234 Remove the void* version of Delete() from the memory manager
(just use a typecast when the pointer is void*).
2019-04-04 14:57:02 -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
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 f41a0e90a9 Makefile cross-compiler, examples 1, 1p, 6, 6p and Laghos on GPU+MPI 2019-03-15 18:28:35 -07:00
camierjs b05edb2737 Cleanup: Array, Vector 2019-03-06 11:58:36 -08:00
camierjs dd1705d846 Cleanup FEM kernels 2019-02-28 16:00:16 -08:00
camierjs eb68f79ee2 MM sanitized 2019-02-28 12:47:09 -08:00
camierjs fa4df4b8b3 MFEM_USE_MM, EnsureNodes and MM logic 2018-12-20 16:53:25 -08:00
Veselin Dobrev f9694c3c2b Simplified data structures in class ParMesh
In class ParMesh:

* Introduced internal struct's Vert3 and Vert4 holding 3 and 4
  integers, respectively.

* Replaced 'shared_faces' with two separate arrays 'shared_trias'
  and 'shared_quads' with types Array<Vert3> and Array<Vert4>,
  respectively.

* Removed the arrays 'stria_lface', 'squad_lface', 'stria_sface',
  'squad_sface', and 'sface_stype'.

* Restore the array 'sface_lface' used previously. Shared face
  indices are shred triangle / quad indices offset by 0 / "number
  of shared triangles", respectively.

* Made the two RefineGroups methods protected.

* Added two new protected methods: UniformRefineGroups2D and
  UniformRefineGroups3D. These two methods simplify the
  implementations of almost all uniform-refinement methods in
  the class.

* Fixed a bug in ReorderTetMesh that was causing ex8p to fail with
  fichera-mixed.mesh.

* Updated the implementations of all ParMesh methods as necessary
  due to the above changes.

In class Triangle, add a static method MarkEdge that works on a
given array of 3 indices.

In class Array, add a method CopyTo - implemented using std::copy.
2018-09-16 14:30:09 -07:00
Veselin Dobrev d87ade3197 Add a new version of Array<T>::Append() with input from 'const T *'
plus a size.
2018-03-03 18:28:15 -08:00
Tzanio e47cf10881 Merge branch 'master' into mixednonlin-dev
Conflicts:
	CHANGELOG
	fem/pnonlinearform.cpp
2018-01-25 08:30:03 -08:00
Jakub Cerveny 7edfd962e2 Merge branch 'master' into pmatrix-dev 2018-01-19 16:14:47 +01:00
Tzanio 347fbbc04f Restoring some changes that got lost in 7e6b0be6b 2018-01-16 20:44:03 -08:00
Tzanio 3c45d0d1be Fixed a bug 2018-01-16 13:11:26 -08:00
Veselin Dobrev 46fc0d7ac9 Merge branch 'master' into pmatrix-dev 2018-01-09 22:58:34 -08:00
Tzanio 88f84bee59 Merge branch 'master' into varnurbs-dev 2018-01-04 15:11:15 -08:00
Tzanio Kolev 90a31dd3b9 Merge pull request #320 from IdoAkkerman/2darray_save_load_dev
Adding Load/Save and GetRow to array2d [2darray_save_load_dev]
2018-01-04 12:13:35 -08:00
Veselin Dobrev ba733d86b5 When saving/loading Array2D, write/read the number of rows and columns
instead of their product.

A few small tweaks.
2017-12-25 13:15:20 -08:00
Veselin Dobrev 3e29cd2594 In class Array2D, add method DeleteAll; add minimal doxygen doc. 2017-11-27 19:43:07 -08:00
Veselin Dobrev 224851268e Restore backward compatibility for reading and writing NURBS meshes and
solutions. Restore the NURBS meshes in the data directory to use their
original format.

Add a new FiniteElementSpace format for writing variable-order spaces,
currently implemented for NURBS spaces only. Move the reading of FE
space input in a new method: FiniteElementSpace::Load. Add new default
constructor for FiniteElementSpace that should be used with the Load
method.

Add a bunch of const qualifiers in NURBSExtension and NURBSPatchMap.

Extended the method Mesh::DegreeElevate to make it easier to work with
variable-order NURBS meshes.

In class Array, add copy constructors and copy assignment operators.

Add a number of FIXME comments.
2017-11-21 14:35:05 -08:00
Jakub Červený 5169393918 Merge branch 'master' into pmatrix-dev 2017-11-17 15:27:41 +01:00
Tzanio 2a55d1bd5d Minor 2017-10-19 13:18:38 -07:00
Ido Akkerman 02cd049021 Adding Load/Save and GetRow to array2d 2017-10-13 11:29:36 +02:00
Jakub Cerveny 658616e066 Improved algorithmic complexity of ParNCMesh::AdjustMeshIds. 2017-10-06 15:22:48 -07:00
Jakub Cerveny dfdbd9f0ee Resolved the message encoding problem. Ex1p on quads now passes the random refinement test. 2017-10-06 13:29:10 -07:00
Veselin Dobrev 27ffe35369 Merged general/globalcomm.[ch]pp and general/globalostream.[ch]pp into
general/globals.[ch].

Renamed class WrappedOStream to OutStream and use a different
implementation in order to support the case when the OutStream is passed
as a parameter of type std::ostream.

In class MPI_Session, added an MPI_Comm parameter to both constructors,
with a default value of MPI_COMM_WORLD.

Hide the global variable MFEM_COMM_WORLD and allow access (read and
write) with global functions: GetGlobalMPI_Comm() and
SetGlobalMPI_Comm() - in the future, we may want to perform some tasks
when changing the "global" MPI communicator.

In mfem_error(), use GetGlobalMPI_Comm() instead of MPI_COMM_WORLD.

Minor formatting changes and #include reordering.
2017-09-29 15:52:51 -07:00
Aaron Fisher aa040f3e64 Made everything work with the new mfem::out and mfem::err output. 2017-09-27 15:42:37 -07:00
Aaron Fisher 9a4f78ec65 Changed the global ostream to something that looks more like cout/cerr. Updated the code in the general folder to use the new global ostream as an example. Added a global MPIComm to replace MPI_COMM_WORLD. 2017-09-22 14:34:50 -07:00
gelever 05e40795a0 Fix const correctness of print 2017-08-01 11:12:40 -07:00
Veselin Dobrev cb810a3be2 Merge branch 'master' into ncmesh-mem-opt-dev 2017-03-13 15:51:38 -07:00
Jakub Cerveny be657cd890 Added proper destruction of NCMesh. Fixed destructor of BlockArray. 2017-03-13 15:29:00 +01:00
Veselin Dobrev f7c14eaf57 Various small changes in the BlockArray, HashTable, and NCMesh classes.
In class BlockArray:
* Move the capability to delete elements into the derived class HashTable.
* Rename the methods New() to Append().
* Rename 'Iterator' -> 'iterator' and 'ConstIterator' -> 'const_iterator' and
  updated implementation.
* Add methods begin(), cbegin(), end(), cend().
* In the destructor, call the destructors for all entries.

In class HashTable:
* Add methods: Size(), NumIds(), NumFreeIds(); rename Exists() -> IdExists().
* Overload the inherited iterators to skip unused/free elements.
* Add methods: begin(), cbegin(), end(), cend().

In class NCMesh:
* Add support for deleting entries stored in the 'elements' BlockArray.
* The unused/free entries of 'elements' are marked by setting the data member
  'parent' to -2.
* Add method NCMesh::PrintStats().
2017-03-09 17:34:20 -08:00
Stowell, Mark L 2c46e02692 Adding Print method to Array2D 2017-02-26 16:37:05 -08:00
Veselin Dobrev 3f1b03c952 Added sub-class ConstIterator to class BlockArray.
Fix DenseTensor::MemoryUsage().
2017-02-24 20:17:13 -08:00
Veselin Dobrev 63e733c011 Added some FIXME comments with suggestions/questions. 2017-02-24 12:20:00 -08:00
Jakub Cerveny eca90726ff NCMesh memory optimizations developed internally at LLNL.
Based on commits by Jakub Cerveny:

    Reverted inline-quad.mesh

    make style

    Testing code in ex1 and ex9p

    Mesh vertices are not calculated by NCMesh when Nodes != NULL.

    Optimized NCMesh::element_vertex, the table is now empty for conforming
    meshes.

    WIP reducing size of NCMesh element-vertex table.

    Optimization in NCMesh::FaceSplitType, fewer hash table lookups.

    Fixed ParNCMesh::CalcFaceOrientations

    Fixed face neighbor vertices.

    Fixed Element::parent after loading NCMesh.

    Fixed derefinement.

    Fixed NeighborExpand (needed by Rebalance).

    More ParNCMesh fixes.

    Fixed neighbor calculation.

    WIP more fixes in ParNCMesh.

    WIP fixing ParNCMesh for new NCMesh structs

    NCMesh loading works again.

    Removed NCMesh::GetMidEdgeNodeSimple

    Fixed face management (creation/deletion), broken earlier by new structs.

    Removed NCMesh::Vertex, NCMesh::Edge. We are down to ~290 bytes / element in uniform mesh.

    Removed NCMesh::Vertex::pos, fixed some bugs.

    WIP removing NCMesh::Vertex::pos

    Fixed bug introduced by data structure changes.

    Removed member NCMesh::Edge::attribute

    Finished converting NCMesh to new data structures.

    WIP changing the NCMesh data structures, everything is a bit of a mess.

    BlockArray is now a base of HashTable

    WIP: modified HashTable methods for the new pointer-less data, improved
    BlockArray.

    WIP updating HashTable for a new underlying storage (BlockArray)

    Added class BlockArray, a generic block allocator/array.

    Updated memory usage calculations in NCMesh.
2017-02-13 18:41:40 -08:00
Tzanio 1569425857 Version 3.3 2017-01-28 22:05:47 -08:00
Jakub Cerveny 125ff226e4 Version 3.2 2016-06-30 10:37:30 -07:00
Tzanio dbae60fe32 Version 3.1 2016-02-16 15:45:48 -08:00
Tzanio Kolev 9d7774a03e Version 3.0 2015-01-26 15:07:34 -08:00
Tzanio Kolev fa169e4b92 Version 2.0 2011-11-18 11:39:53 -08:00