@@ -491,11 +491,7 @@ R2C<T,D,C>::R2C (Box const& domain, Info const& info)
491
491
#if (AMREX_SPACEDIM == 3)
492
492
if (m_info.domain_strategy == DomainStrategy::automatic) {
493
493
if (m_info.twod_mode ) {
494
- if (m_real_domain.length (2 ) < nprocs) {
495
- m_info.domain_strategy = DomainStrategy::pencil;
496
- } else {
497
- m_info.domain_strategy = DomainStrategy::slab;
498
- }
494
+ m_info.domain_strategy = DomainStrategy::slab;
499
495
} else {
500
496
int shortside = m_real_domain.shortside ();
501
497
if (shortside < m_info.pencil_threshold *nprocs) {
@@ -505,19 +501,20 @@ R2C<T,D,C>::R2C (Box const& domain, Info const& info)
505
501
}
506
502
}
507
503
}
508
- if (m_info.domain_strategy == DomainStrategy::slab && (m_real_domain.length (1 ) > 1 )) {
509
- if (m_info.twod_mode && m_real_domain.length (2 ) == 1 ) {
510
- m_slab_decomp = false ;
511
- } else {
512
- m_slab_decomp = true ;
513
- }
504
+
505
+ if (m_info.twod_mode ) {
506
+ m_slab_decomp = true ;
507
+ } else if (m_info.domain_strategy == DomainStrategy::slab && (m_real_domain.length (1 ) > 1 )) {
508
+ m_slab_decomp = true ;
514
509
}
510
+
515
511
#endif
516
512
517
513
auto const ncomp = m_info.batch_size ;
518
514
519
515
auto bax = amrex::decompose (m_real_domain, nprocs,
520
- {AMREX_D_DECL (false ,!m_slab_decomp,true )}, true );
516
+ {AMREX_D_DECL (false ,!m_slab_decomp,m_real_domain.length (2 )>1 )}, true );
517
+
521
518
DistributionMapping dmx = detail::make_iota_distromap (bax.size ());
522
519
m_rx.define (bax, dmx, ncomp, 0 , MFInfo ().SetAlloc (false ));
523
520
@@ -540,13 +537,8 @@ R2C<T,D,C>::R2C (Box const& domain, Info const& info)
540
537
//
541
538
542
539
#if (AMREX_SPACEDIM >= 2)
543
- #if (AMREX_SPACEDIM == 2)
544
- bool batch_on_y = false ;
545
- #else
546
- bool batch_on_y = m_info.twod_mode && (m_real_domain.length (2 ) == 1 );
547
- #endif
548
540
DistributionMapping cdmy;
549
- if ((m_real_domain.length (1 ) > 1 ) && !m_slab_decomp && !batch_on_y )
541
+ if ((m_real_domain.length (1 ) > 1 ) && !m_slab_decomp)
550
542
{
551
543
auto cbay = amrex::decompose (m_spectral_domain_y, nprocs,
552
544
{AMREX_D_DECL (false ,true ,true )}, true );
0 commit comments