1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663
|
Description: port to GNU C++ >= 8.1
This avoids a FTBFS
Forwarded: not-yet
Bug-Debian: https://bugs.debian.org/897846
Author: Pierre Saramito <pierre.saramito@imag.fr>
Last-Update: 2018-10-29
Index: rheolef-7.0/nfem/geo_element/hack_array.h
===================================================================
--- a/nfem/geo_element/hack_array.h
+++ b/nfem/geo_element/hack_array.h
@@ -173,8 +173,7 @@ public:
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
typedef distributed memory_type;
- typedef std::map <size_type, automatic_value_type, std::less<size_type>, heap_allocator<std::pair<size_type,automatic_value_type> > >
- scatter_map_type;
+ typedef std::map <size_type, automatic_value_type> scatter_map_type; // TODO: map<T,A> for heap_alloc
struct dis_reference {
@@ -275,13 +274,14 @@ protected:
// typedefs:
/** 1) stash: store data before assembly() communications:
*/
- typedef std::map <size_type, raw_type, std::less<size_type>, heap_allocator<std::pair<size_type,raw_type> > > stash_map_type;
+ typedef std::map <size_type, raw_type> stash_map_type; // TODO: map<T,A> for heap_alloc
/** 2) message: for communication during assembly_begin(), assembly_end()
*/
struct message_type {
- std::list<std::pair<size_type,mpi::request>,A> waits;
- std::vector<std::pair<size_type,raw_type>,A> data;
+ std::list<std::pair<size_type,mpi::request> > waits; // TODO: list<T,A> for heap_alloc
+ std::vector<std::pair<size_type,raw_type> > data; // TODO: vector<T,A> for heap_alloc
+ message_type() : waits(), data() {}
};
/** 3) scatter (get_entry): specialized versions for T=container and T=simple type
*/
Index: rheolef-7.0/nfem/plib/domain_indirect.h
===================================================================
--- a/nfem/plib/domain_indirect.h
+++ b/nfem/plib/domain_indirect.h
@@ -146,13 +164,15 @@ public:
void set_map_dimension (size_type map_dim) { base::set_map_dimension(map_dim); }
std::string name () const { return base::name(); }
size_type map_dimension () const { return base::map_dimension(); }
+ // bool is_broken() const { return base::is_broken(); }
+ // void set_broken(bool b) { base::set_broken(b); }
// i/o:
template<class U>
void build_from_data (
const geo_rep<U,sequential>& omega,
- disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >&
+ disarray<geo_element_auto<>,sequential>&
d_tmp,
std::vector<index_set>* ball);
@@ -341,7 +371,7 @@ public:
template <class U>
domain_indirect_basic (
- disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >&
+ disarray<geo_element_auto<>,sequential>&
d_tmp,
const geo_basic<U, sequential>& omega,
std::vector<index_set>* ball);
Index: rheolef-7.0/nfem/plib/domain_indirect_seq.cc
===================================================================
--- a/nfem/plib/domain_indirect_seq.cc
+++ b/nfem/plib/domain_indirect_seq.cc
@@ -163,11 +151,10 @@ domain_indirect_rep<sequential>::get (
// when using large 3d meshes with large boundary domains
// or with 3d regions defined as domains
//
- heap_allocator<size_type> alloc;
- geo_element_auto<heap_allocator<size_type> > elem_init (alloc);
- typedef disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >
+ geo_element_auto<> elem_init;
+ typedef disarray<geo_element_auto<>,sequential>
disarray_t;
- disarray_t d_tmp (n_side, elem_init, alloc);
+ disarray_t d_tmp (n_side, elem_init);
d_tmp.get_values (ips);
build_from_data (omega, d_tmp, ball);
return ips;
@@ -176,11 +163,11 @@ template<class U>
void
domain_indirect_rep<sequential>::build_from_data (
const geo_rep<U,sequential>& omega,
- disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >&
+ disarray<geo_element_auto<>,sequential>&
d_tmp,
std::vector<index_set>* ball)
{
- typedef disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >
+ typedef disarray<geo_element_auto<>,sequential>
disarray_t;
disarray<geo_element_indirect,sequential>::resize (d_tmp.size());
@@ -218,7 +205,7 @@ domain_indirect_rep<sequential>::build_f
}
template <class U>
domain_indirect_basic<sequential>::domain_indirect_basic (
- disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >&
+ disarray<geo_element_auto<>,sequential>&
d_tmp,
const geo_basic<U, sequential>& omega,
std::vector<index_set>* ball)
@@ -243,13 +230,13 @@ template
void
domain_indirect_rep<sequential>::build_from_data (
const geo_rep<Float,sequential>& omega,
- disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >&
+ disarray<geo_element_auto<>,sequential>&
d_tmp,
std::vector<index_set>* ball);
template
domain_indirect_basic<sequential>::domain_indirect_basic (
- disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >&
+ disarray<geo_element_auto<>,sequential>&
d_tmp,
const geo_basic<Float, sequential>& omega,
std::vector<index_set>* ball);
Index: rheolef-7.0/nfem/plib/geo.cc
===================================================================
--- a/nfem/plib/geo.cc
+++ b/nfem/plib/geo.cc
@@ -312,7 +317,7 @@ void \
geo_basic<T,M>::build_from_data ( \
const geo_header& hdr, \
const disarray<node_type, M>& node, \
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,M, heap_allocator<size_type> >, reference_element::max_variant>& tmp_geo_element, \
+ std::array<disarray<geo_element_auto<>,M>, reference_element::max_variant>& tmp_geo_element, \
bool do_upgrade) \
{ \
geo_rep<T,M>* ptr = dynamic_cast<geo_rep<T,M>*>(base::pointer()); \
Index: rheolef-7.0/nfem/plib/geo.h
===================================================================
--- a/nfem/plib/geo.h
+++ b/nfem/plib/geo.h
@@ -787,21 +790,21 @@ public:
void build_by_subdividing (const geo_basic<T,sequential>& omega, size_type k);
void build_from_data (
const geo_header& hdr,
- const disarray<node_type, sequential>& node,
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>&
+ const disarray<node_type, sequential>& node,
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>&
tmp_geo_element,
- bool do_upgrade);
+ bool do_upgrade);
// internal:
protected:
idiststream& get_standard (idiststream&, const geo_header&);
idiststream& get_upgrade (idiststream&, const geo_header&);
void build_connectivity (
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>& tmp_geo_element);
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>& tmp_geo_element);
void build_connectivity_sides (
size_type side_dim,
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>& tmp_geo_element);
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>& tmp_geo_element);
void set_element_side_index (size_type side_dim);
void domain_set_side_part1 (
const domain_indirect_rep<sequential>& indirect,
@@ -1160,9 +1165,9 @@ public:
void build_from_data (
const geo_header& hdr,
const disarray<node_type, sequential>& node,
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>&
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>&
tmp_geo_element,
- bool do_upgrade);
+ bool do_upgrade);
// extended accessors:
Index: rheolef-7.0/nfem/plib/geo_seq_get_bamg.cc
===================================================================
--- a/nfem/plib/geo_seq_get_bamg.cc
+++ b/nfem/plib/geo_seq_get_bamg.cc
@@ -31,10 +31,9 @@
using namespace std;
namespace rheolef {
-template<class A>
static
void
-bamg_load_element (std::istream& is, size_t variant, geo_element_auto<A>& K)
+bamg_load_element (std::istream& is, size_t variant, geo_element_auto<>& K)
{
K.reset (variant, 1);
for (size_t iloc = 0, nloc = K.size(); iloc < nloc; iloc++) {
@@ -42,13 +41,13 @@ bamg_load_element (std::istream& is, siz
K[iloc]--;
}
}
-template <class T, class A>
+template <class T>
static
void
build_domains (
size_t dom_dim,
- const disarray<geo_element_auto<A>, sequential, A>& elt,
- const disarray<size_t, sequential, A>& elt_bamg_dom_id,
+ const disarray<geo_element_auto<>, sequential>& elt,
+ const disarray<size_t, sequential>& elt_bamg_dom_id,
const std::vector<std::string>& dom_name,
const geo_basic<T,sequential>& omega,
vector<index_set>* ball)
@@ -56,17 +55,16 @@ build_domains (
using namespace std;
typedef typename geo_basic<T,sequential>::size_type size_type;
typedef pair<size_type,size_type> pair_t;
- typedef geo_element_auto<A> element_t;
- typedef disarray<element_t, sequential, A> e_array_t;
- typedef disarray<size_type, sequential, A> i_array_t;
- typedef map<size_type, pair_t, less<size_type>, A> map_t;
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t, sequential> e_array_t;
+ typedef disarray<size_type, sequential> i_array_t;
+ typedef map<size_type, pair_t, less<size_type> > map_t;
// -------------------------------------------------------------------
// 1) reduce the bamg domain id to [0:ndom[ by counting domain id
// -------------------------------------------------------------------
- A alloc = elt.get_allocator();
// map[bamg_id] will gives idom and the number of its elements
- map_t bamg_id2idom (less<size_type>(), alloc);
+ map_t bamg_id2idom; // TODO (less<size_type>());
size_type idom = 0;
for (size_type ie = 0, ne = elt_bamg_dom_id.size(); ie < ne; ie++) {
size_type bamg_id = elt_bamg_dom_id [ie];
@@ -94,15 +92,15 @@ build_domains (
// -------------------------------------------------------------------
// 3) create domain disarray: loop on elements
// -------------------------------------------------------------------
- element_t dummy_elt (reference_element::p, 0, alloc);
- vector<e_array_t, A> domain (ndom, e_array_t(0, dummy_elt, alloc), alloc);
- vector<size_type, A> counter (ndom, 0, alloc);
+ element_t dummy_elt (reference_element::p, 0);
+ vector<e_array_t> domain (ndom, e_array_t(0, dummy_elt));
+ vector<size_type> counter (ndom, 0);
for (size_type ie = 0, ne = elt_bamg_dom_id.size(); ie < ne; ie++) {
size_type bamg_dom_id = elt_bamg_dom_id [ie];
size_type idom = bamg_id2idom [bamg_dom_id].first;
if (domain[idom].size() == 0) {
size_type size = bamg_id2idom [bamg_dom_id].second;
- domain[idom] = e_array_t (size, dummy_elt, alloc);
+ domain[idom] = e_array_t (size, dummy_elt);
}
size_type dom_ie = counter[idom];
domain[idom][dom_ie] = elt[ie];
@@ -127,21 +125,20 @@ build_domains (
}
size_type ndom2 = omega.n_domain_indirect();
}
-template <class T, class A>
+template <class T>
static
void
build_vertex_domains (
- const disarray<size_t, sequential, A>& edg_bdr_bamg_dom_id,
- const disarray<size_t, sequential, A>& vert_bamg_dom_id,
+ const disarray<size_t, sequential>& edg_bdr_bamg_dom_id,
+ const disarray<size_t, sequential>& vert_bamg_dom_id,
const std::vector<std::string>& dom_name,
const geo_basic<T,sequential>& omega,
vector<index_set>* ball)
{
if (dom_name.size() == 0) return;
- typedef geo_element_auto<A> element_t;
- typedef disarray<element_t, sequential, A> v_array_t;
- A alloc = edg_bdr_bamg_dom_id.get_allocator();
- element_t dummy_elt (reference_element::p, 0, alloc);
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t, sequential> v_array_t;
+ element_t dummy_elt (reference_element::p, 0);
// -------------------------------------------------------------------
// 1) list all vertex domain id
// -------------------------------------------------------------------
@@ -173,7 +170,7 @@ build_vertex_domains (
for (size_t iv = 0, nv = vert_bamg_dom_id.size(); iv < nv; ++iv) {
if (vert_bamg_dom_id [iv] == id) dom_size++;
}
- v_array_t vert_list (dom_size, dummy_elt, alloc);
+ v_array_t vert_list (dom_size, dummy_elt);
for (size_t iv = 0, iv_dom = 0, nv = vert_bamg_dom_id.size(); iv < nv; ++iv) {
if (vert_bamg_dom_id [iv] != id) continue;
element_t& K = vert_list [iv_dom];
@@ -206,13 +203,11 @@ geo_get_bamg (idiststream& ips, geo_basi
// ------------------------------------------------------------------------
// 1) load data
// ------------------------------------------------------------------------
- typedef heap_allocator<size_type> alloc_t;
- typedef geo_element_auto<alloc_t> element_t;
+ typedef geo_element_auto<> element_t;
typedef disarray<node_type, sequential> n_array_t;
- typedef disarray<element_t, sequential, alloc_t> e_array_t;
- typedef disarray<size_type, sequential, alloc_t> i_array_t;
+ typedef disarray<element_t, sequential> e_array_t;
+ typedef disarray<size_type, sequential> i_array_t;
- alloc_t alloc;
n_array_t vertex;
i_array_t vert_bamg_dom_id;
i_array_t edg_bdr_bamg_dom_id;
@@ -238,7 +233,7 @@ geo_get_bamg (idiststream& ips, geo_basi
hdr.dis_size_by_dimension [0] = nnod;
hdr.dis_size_by_variant [0] = nnod;
vertex.resize (nnod);
- vert_bamg_dom_id = i_array_t (nnod, 0, alloc);
+ vert_bamg_dom_id = i_array_t (nnod, 0);
for (size_type inod = 0; inod < nnod; inod++) {
is >> vertex[inod][0] >> vertex[inod][1] >> vert_bamg_dom_id[inod];
}
@@ -253,9 +248,9 @@ geo_get_bamg (idiststream& ips, geo_basi
is >> nt;
hdr.dis_size_by_dimension [2] += nt;
hdr.dis_size_by_variant [reference_element::t] = nt;
- element_t init_tri (reference_element::t, hdr.order, alloc);
- tmp_geo_element [reference_element::t] = e_array_t (nt, init_tri, alloc);
- tri_bamg_dom_id = i_array_t (nt, 0, alloc);
+ element_t init_tri (reference_element::t, hdr.order);
+ tmp_geo_element [reference_element::t] = e_array_t (nt, init_tri);
+ tri_bamg_dom_id = i_array_t (nt, 0);
for (size_type it = 0; it < nt; it++) {
bamg_load_element (is, reference_element::t,
tmp_geo_element[reference_element::t][it]);
@@ -270,9 +265,9 @@ geo_get_bamg (idiststream& ips, geo_basi
is >> nq;
hdr.dis_size_by_dimension [2] += nq;
hdr.dis_size_by_variant [reference_element::q] = nq;
- element_t init_qua (reference_element::q, hdr.order, alloc);
- tmp_geo_element [reference_element::q] = e_array_t (nq, init_qua, alloc);
- qua_bamg_dom_id = i_array_t (nq, 0, alloc);
+ element_t init_qua (reference_element::q, hdr.order);
+ tmp_geo_element [reference_element::q] = e_array_t (nq, init_qua);
+ qua_bamg_dom_id = i_array_t (nq, 0);
for (size_type iq = 0; iq < nq; iq++) {
bamg_load_element (is, reference_element::q,
tmp_geo_element[reference_element::q][iq]);
@@ -286,9 +281,9 @@ geo_get_bamg (idiststream& ips, geo_basi
// ------------------------------------------------------------------------
size_type nedg;
is >> nedg;
- element_t init_edg (reference_element::e, hdr.order, alloc);
- edg_bdr = e_array_t (nedg, init_edg, alloc);
- edg_bdr_bamg_dom_id = i_array_t (nedg, 0, alloc);
+ element_t init_edg (reference_element::e, hdr.order);
+ edg_bdr = e_array_t (nedg, init_edg);
+ edg_bdr_bamg_dom_id = i_array_t (nedg, 0);
for (size_type iedg = 0; iedg < nedg; iedg++) {
element_t& K = edg_bdr[iedg];
K.reset (reference_element::e, hdr.order);
Index: rheolef-7.0/nfem/plib/geo_seq_get_vtk.cc
===================================================================
--- a/nfem/plib/geo_seq_get_vtk.cc
+++ b/nfem/plib/geo_seq_get_vtk.cc
@@ -86,9 +86,8 @@ geo_get_vtk (idiststream& ips, geo_basic
// load the connectivity
size_type ne, ntot;
is >> ne >> ntot;
- typedef heap_allocator<size_type> alloc_t;
- typedef geo_element_auto<alloc_t> element_t;
- typedef disarray<element_t,sequential,alloc_t> disarray_t;
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t,sequential> disarray_t;
disarray_t elt (ne);
for (size_type ie = 0; ie < ne; ie++) {
size_type nloc;
@@ -106,13 +105,12 @@ geo_get_vtk (idiststream& ips, geo_basic
// ------------------------------------------------------------------------
// 2) split elements by variants
// ------------------------------------------------------------------------
- alloc_t alloc;
std::array<disarray_t, reference_element::max_variant> tmp_geo_element;
if (hdr.map_dimension > 0) {
for (size_type variant = reference_element::first_variant_by_dimension(hdr.map_dimension);
variant < reference_element:: last_variant_by_dimension(hdr.map_dimension); variant++) {
geo_element_auto<> init_val (variant, hdr.order);
- tmp_geo_element [variant] = disarray_t (hdr.dis_size_by_variant [variant], init_val, alloc);
+ tmp_geo_element [variant] = disarray_t (hdr.dis_size_by_variant [variant], init_val);
}
std::array<size_type, 4> counter;
counter.fill(0);
Index: rheolef-7.0/nfem/plib/geo_seq_upgrade.cc
===================================================================
--- a/nfem/plib/geo_seq_upgrade.cc
+++ b/nfem/plib/geo_seq_upgrade.cc
@@ -36,10 +36,10 @@ namespace rheolef {
template <class T>
void
geo_rep<T,sequential>::build_connectivity(
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>& tmp_geo_element)
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>& tmp_geo_element)
{
- typedef geo_element_auto<heap_allocator<size_type> > element_t;
- typedef disarray<element_t,sequential,heap_allocator<size_type> > disarray_t;
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t,sequential> disarray_t;
typedef typename disarray_t::const_iterator const_iterator_by_variant_tmp;
size_type map_dim = geo_base_rep<T,sequential>::_map_dimension;
if (map_dim <= 1) return;
@@ -50,10 +50,10 @@ template <class T>
void
geo_rep<T,sequential>::build_connectivity_sides (
size_type side_dim,
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>& tmp_geo_element)
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>& tmp_geo_element)
{
- typedef geo_element_auto<heap_allocator<size_type> > element_t;
- typedef disarray<element_t,sequential,heap_allocator<size_type> > disarray_t;
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t,sequential> disarray_t;
typedef typename disarray_t::const_iterator const_iterator_by_variant_tmp;
if (side_dim == 0) return;
// ------------------------------------------------------------------------
@@ -204,15 +204,14 @@ geo_rep<T,sequential>::get_upgrade (
// ------------------------------------------------------------------------
// 2) get elements
// ------------------------------------------------------------------------
- typedef geo_element_auto<heap_allocator<size_type> > element_t;
- typedef disarray<element_t, sequential, heap_allocator<size_type> > disarray_t;
- heap_allocator<size_type> alloc;
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t, sequential> disarray_t;
std::array<disarray_t, reference_element::max_variant> tmp_geo_element;
if (hdr.map_dimension > 0) {
for (size_type variant = reference_element::first_variant_by_dimension(hdr.map_dimension);
variant < reference_element:: last_variant_by_dimension(hdr.map_dimension); variant++) {
- geo_element_auto<heap_allocator<size_type> > init_val (variant, hdr.order, alloc);
- tmp_geo_element [variant] = disarray_t (hdr.dis_size_by_variant [variant], init_val, alloc);
+ geo_element_auto<> init_val (variant, hdr.order);
+ tmp_geo_element [variant] = disarray_t (hdr.dis_size_by_variant [variant], init_val);
tmp_geo_element [variant].get_values (ips);
check_macro (ips.good(), "bad input stream for geo.");
}
@@ -237,13 +236,13 @@ void
geo_rep<T,sequential>::build_from_data (
const geo_header& hdr,
const disarray<node_type, sequential>& node,
- std::array<disarray<geo_element_auto<heap_allocator<size_type> >,sequential, heap_allocator<size_type> >, reference_element::max_variant>&
+ std::array<disarray<geo_element_auto<>,sequential>, reference_element::max_variant>&
tmp_geo_element,
bool do_upgrade)
{
using namespace std;
- typedef geo_element_auto<heap_allocator<size_type> > element_t;
- typedef disarray<element_t, sequential, heap_allocator<size_type> > disarray_t;
+ typedef geo_element_auto<> element_t;
+ typedef disarray<element_t, sequential> disarray_t;
typedef typename disarray_t::const_iterator const_iterator_by_variant_tmp;
typedef typename disarray_t::iterator iterator_by_variant_tmp;
// ------------------------------------------------------------------------
Index: rheolef-7.0/skit/plib2/disarray.h
===================================================================
--- a/skit/plib2/disarray.h
+++ b/skit/plib2/disarray.h
@@ -55,12 +55,12 @@ namespace rheolef {
template <class T, class M, class A> class disarray_rep {};
template <class T, class A>
-class disarray_rep<T,sequential,A> : public std::vector<T,A> {
+class disarray_rep<T,sequential,A> : public std::vector<T> { // TODO: vector<T,A> for heap_alloc
public:
typedef T value_type;
typedef A allocator_type;
typedef typename A::difference_type difference_type;
- typedef std::vector<T,A> base;
+ typedef std::vector<T> base; // TODO: vector<T,A> for heap_alloc
typedef typename base::size_type size_type;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
@@ -140,8 +140,7 @@ public:
typedef typename base::const_iterator const_iterator;
typedef distributor::communicator_type communicator_type;
typedef distributed memory_type;
- typedef std::map <size_type, T, std::less<size_type>, heap_allocator<std::pair<size_type,T> > >
- scatter_map_type;
+ typedef std::map <size_type, T> scatter_map_type; // TODO: map<T,A> for heap_alloc
struct dis_reference {
dis_reference (disarray_rep<T,distributed,A>& x, size_type dis_i)
@@ -257,12 +256,12 @@ protected:
template<class U>
struct stash_traits<U,std::false_type> {
typedef U mapped_type;
- typedef std::map <size_type, U, std::less<size_type>, heap_allocator<std::pair<size_type,U> > > map_type;
+ typedef std::map <size_type, U> map_type; // TODO: map<T,A> for heap_alloc
};
template<class U>
struct stash_traits<U,std::true_type> {
typedef typename remove_const_in_pair<typename U::value_type>::type mapped_type;
- typedef std::multimap <size_type, mapped_type, std::less<size_type>, heap_allocator<std::pair<size_type,mapped_type> > > map_type;
+ typedef std::multimap <size_type, mapped_type> map_type; // TODO: map<T,A> for heap_alloc
};
typedef typename is_container_of_mpi_datatype<T>::type is_container;
typedef typename stash_traits<T,is_container>::mapped_type stash_value;
@@ -271,8 +270,9 @@ protected:
/** 2) message: for communication during assembly_begin(), assembly_end()
*/
struct message_type {
- std::list<std::pair<size_type,mpi::request>,A> waits;
- std::vector<std::pair<size_type,stash_value>,A> data;
+ std::list<std::pair<size_type,mpi::request> > waits; // TODO: list<T,A> for heap_alloc
+ std::vector<std::pair<size_type,stash_value> > data; // TODO: vector<T,A> for heap_alloc
+ message_type() : waits(), data() {}
};
/** 3) scatter (get_entry): specialized versions for T=container and T=simple type
*/
@@ -375,9 +375,10 @@ template <class T, class M = rheo_defaul
class disarray {
public:
typedef M memory_type;
- typedef typename std::vector<T,A>::size_type size_type;
- typedef typename std::vector<T,A>::iterator iterator;
- typedef typename std::vector<T,A>::const_iterator const_iterator;
+ typedef disarray_rep<T,sequential,A> rep;
+ typedef typename rep::base::size_type size_type;
+ typedef typename rep::base::iterator iterator;
+ typedef typename rep::base::const_iterator const_iterator;
};
//<verbatim:
template <class T, class A>
Index: rheolef-7.0/skit/plib2/disarray_mpi.icc
===================================================================
--- a/skit/plib2/disarray_mpi.icc
+++ b/skit/plib2/disarray_mpi.icc
@@ -417,7 +417,7 @@ disarray_rep<T,distributed,A>::append_di
typedef typename T::value_type S; // S is supposed to be MPI-simple, i.e. with fixed size
// 0) declare the local context
- typedef scatter_message<std::vector<T,A>, true> message_type;
+ typedef scatter_message<std::vector<T>, true> message_type; // TODO: vector<T,A> for heap_alloc
message_type from;
message_type to;
@@ -476,7 +476,7 @@ disarray_rep<T,distributed,A>::append_di
to.multi_init();
// 8) begin multi-valued scatter
- std::vector<T,A> multi_buffer (ext_idx.size());
+ std::vector<T> multi_buffer (ext_idx.size()); // TODO: vector<T,A> for heap_alloc
distributor::tag_type multi_tag = distributor::get_new_tag();
mpi_scatter_begin (
begin().operator->(),
Index: rheolef-7.0/skit/plib2/disarray_seq.icc
===================================================================
--- a/skit/plib2/disarray_seq.icc
+++ b/skit/plib2/disarray_seq.icc
@@ -26,25 +26,25 @@ namespace rheolef {
// ----------------------------------------------------------------------------
template <class T, class A>
disarray_rep<T,sequential,A>::disarray_rep (const A& alloc)
- : std::vector<T,A>(alloc),
+ : base(alloc),
_ownership ()
{
}
template <class T, class A>
disarray_rep<T,sequential,A>::disarray_rep (size_type loc_size1, const T& init_val, const A& alloc)
- : std::vector<T,A>(loc_size1, init_val, alloc),
+ : base(loc_size1, init_val, alloc),
_ownership (distributor (distributor::decide, communicator(), loc_size1))
{
}
template <class T, class A>
disarray_rep<T,sequential,A>::disarray_rep (const distributor& ownership, const T& init_val, const A& alloc)
- : std::vector<T,A>(ownership.size(),init_val,alloc),
+ : base(ownership.size(),init_val), // TODO: add alloc extra-arg for heap_allocator
_ownership(ownership)
{
}
template <class T, class A>
disarray_rep<T,sequential,A>::disarray_rep (const disarray_rep<T,sequential,A>& x)
- : std::vector<T,A>(x.size()),
+ : base(x.size()),
_ownership(x._ownership)
{
std::copy (x.begin(), x.end(), begin());
@@ -55,7 +55,7 @@ disarray_rep<T,sequential,A>::resize (co
{
// note: also called by disarray_rep<T,distributed,A>, so should works in distributed mode
_ownership = ownership;
- std::vector<T,A>::resize (_ownership.size(), init_val);
+ base::resize (_ownership.size(), init_val);
std::fill (begin(), end(), init_val);
}
template <class T, class A>
@@ -64,7 +64,7 @@ disarray_rep<T,sequential,A>::resize (si
{
// note: also called by disarray_rep<T,distributed,A>, so should works in distributed mode
_ownership.resize (distributor::decide, _ownership.comm(), loc_size1);
- std::vector<T,A>::resize (_ownership.size(), init_val);
+ base::resize (_ownership.size(), init_val);
std::fill (begin(), end(), init_val);
}
template <class T, class A>
Index: rheolef-7.0/skit/plib2/pair_set.h
===================================================================
--- a/skit/plib2/pair_set.h
+++ b/skit/plib2/pair_set.h
@@ -54,13 +54,18 @@ SYNOPSIS:
as @code{disarray<pair_set>} (@pxref{disarray class}).
TODO:
template <T,A> with A=std::allocator or heap_allocator
+ difficulty: get heap_allocator<T> or std::allocator<T> and then requires
+ heap_allocator<pair<size_t,T>> or std::allocator<>pair<size_t,T>>
+ for std::map
+
AUTHOR: Pierre.Saramito@imag.fr
DATE: date: 19 may 2012
End:
*/
//<verbatim:
template<class T, class A = std::allocator<std::pair<std::size_t,T> > >
-class pair_set: public std::map<std::size_t, T, std::less<std::size_t>, A> {
+class pair_set: public std::map<std::size_t, T, std::less<std::size_t> > {
+ // TODO: use A extra-arg for std::map for heap_allocator
public:
// typedefs:
@@ -69,9 +74,12 @@ public:
typedef std::pair<size_type,T> pair_type;
typedef std::pair<const size_type,T> const_pair_type;
typedef pair_type value_type;
- typedef A allocator_type;
- typedef std::map<size_type, T, std::less<size_type>, allocator_type>
+ typedef std::map<size_type, T, std::less<size_type> > // TODO: use allocator_type for heap_allocator
base;
+#ifdef TODO
+ typedef typename base::allocator_type allocator_type;
+#endif // TODO
+ typedef A allocator_type;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
@@ -141,7 +149,7 @@ struct is_container_of_mpi_datatype<pair
template <class T, class A>
inline
pair_set<T,A>::pair_set (const A& alloc)
- : base (std::less<size_type>(), alloc)
+ : base (std::less<size_type>()) // TODO: use alloc extra-arg for base=std::map for heap_allocator
{
}
template <class T, class A>
@@ -178,7 +186,7 @@ pair_set<T,A>::serialize (Archive& ar, c
// -------------------------------------------------------------------
template <class T, class A>
pair_set<T,A>::pair_set (const pair_set& a, const A& alloc)
- : base(std::less<size_type>(), a.get_allocator())
+ : base(std::less<size_type>()) // TODO: use a.get_allocator() extra-arg for base=std::map for heap_allocator
{
for (const_iterator iter = a.base::begin(), last = a.base::end(); iter != last; iter++) {
base::insert (*iter);
|