pcbnew: standardize itemlist/zonelist connectivity
The itemlist and zonelist in connectivity can both contain many items, so both use the same OpenMP routine. However, we can only clear the dirty flag when we conduct a full search, including zones. Otherwise we missing connections to zones when propogating changed items that are then marked as not dirty. Fixes: lp:1777993 * https://bugs.launchpad.net/kicad/+bug/1777993
This commit is contained in:
parent
f634b75652
commit
cf04d341ec
|
@ -345,8 +345,12 @@ void CN_CONNECTIVITY_ALGO::searchConnections( bool aIncludeZones )
|
|||
|
||||
if( m_itemList.IsDirty() )
|
||||
{
|
||||
for( auto item : m_itemList )
|
||||
#ifdef USE_OPENMP
|
||||
#pragma omp parallel for schedule(dynamic)
|
||||
#endif
|
||||
for( int i = 0; i < m_itemList.Size(); i++ )
|
||||
{
|
||||
auto item = m_itemList[i];
|
||||
if( item->Dirty() )
|
||||
{
|
||||
CN_VISITOR visitor( item, &cnListLock );
|
||||
|
@ -370,20 +374,7 @@ void CN_CONNECTIVITY_ALGO::searchConnections( bool aIncludeZones )
|
|||
}
|
||||
|
||||
#ifdef USE_OPENMP
|
||||
// launch at least two threads, one to compute, second to update UI
|
||||
#pragma omp parallel num_threads( std::max( omp_get_num_procs(), 2 ) )
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_OPENMP
|
||||
#pragma omp master
|
||||
if (m_progressReporter)
|
||||
{
|
||||
m_progressReporter->KeepRefreshing( true );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPENMP
|
||||
#pragma omp for schedule(dynamic)
|
||||
#pragma omp parallel for schedule(dynamic)
|
||||
#endif
|
||||
for(int i = 0; i < m_zoneList.Size(); i++ )
|
||||
{
|
||||
|
@ -396,18 +387,12 @@ void CN_CONNECTIVITY_ALGO::searchConnections( bool aIncludeZones )
|
|||
m_itemList.FindNearby( item, visitor );
|
||||
m_zoneList.FindNearby( item, visitor );
|
||||
}
|
||||
|
||||
if (m_progressReporter)
|
||||
{
|
||||
m_progressReporter->AdvanceProgress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_zoneList.ClearDirtyFlags();
|
||||
m_itemList.ClearDirtyFlags();
|
||||
}
|
||||
|
||||
m_itemList.ClearDirtyFlags();
|
||||
|
||||
#ifdef CONNECTIVITY_DEBUG
|
||||
printf("Search end\n");
|
||||
|
|
Loading…
Reference in New Issue