diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-08-04 00:25:49 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-08-04 00:25:49 -0400 |
commit | 9166952a1e2571bf5656345d7f8f1d1246e033d7 (patch) | |
tree | 81715eab307797c498c1a1f56671f480e3b14eaf /Carpet/CarpetLib/src/gdata.cc | |
parent | dbe1636f5ed6ec4859719ff08f731735e123c59e (diff) |
CarpetLib: Store registered gh, dh, th, gf, data etc. via sets, not via lists
Use set instead of list to store registered gh, dh, th, gf, data.
Do not store an iterator as handle for de-registering.
This corrects some memory corruption with the Intel compiler; the previous code may have been illegal.
Diffstat (limited to 'Carpet/CarpetLib/src/gdata.cc')
-rw-r--r-- | Carpet/CarpetLib/src/gdata.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc index ecc8c4ba8..2226a5b07 100644 --- a/Carpet/CarpetLib/src/gdata.cc +++ b/Carpet/CarpetLib/src/gdata.cc @@ -79,7 +79,7 @@ template MPI_Datatype mpi_datatype (slab<int,dim> const&); -list<gdata*> gdata::allgdata; +set<gdata*> gdata::allgdata; @@ -96,7 +96,7 @@ gdata::gdata (const int varindex_, { DECLARE_CCTK_PARAMETERS; - allgdatai = allgdata.insert(allgdata.end(), this); + allgdata.insert(this); if (barriers) { dist::barrier (dist::comm(), 783988953, "CarpetLib::gdata::gdata"); @@ -108,7 +108,7 @@ gdata::~gdata () { DECLARE_CCTK_PARAMETERS; - allgdata.erase(allgdatai); + allgdata.erase(this); if (barriers) { dist::barrier (dist::comm(), 109687805, "CarpetLib::gdata::~gdata"); @@ -463,7 +463,7 @@ gdata:: allmemory () { size_t mem = memoryof(allgdata); - for (list<gdata*>::const_iterator + for (set<gdata*>::const_iterator gdatai = allgdata.begin(); gdatai != allgdata.end(); ++ gdatai) { mem += memoryof(**gdatai); |