Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
1490099d
Commit
1490099d
authored
Jan 31, 2014
by
Carl Poirier
Committed by
Maciej Suminski
Jan 31, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parallelized the RN_DATA::Recalculate() function.
parent
a10d918c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
5 deletions
+32
-5
CMakeLists.txt
CMakeLists.txt
+7
-0
CMakeLists.txt
pcbnew/CMakeLists.txt
+2
-0
ratsnest_data.cpp
pcbnew/ratsnest_data.cpp
+23
-5
No files found.
CMakeLists.txt
View file @
1490099d
...
...
@@ -125,6 +125,13 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fvisibility-inlines-hidden"
)
endif
()
find_package
(
OpenMP QUIET
)
if
(
OPENMP_FOUND
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
OpenMP_C_FLAGS
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
OpenMP_CXX_FLAGS
}
"
)
add_definitions
(
-DUSE_OPENMP
)
endif
()
if
(
MINGW
)
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
...
...
pcbnew/CMakeLists.txt
View file @
1490099d
set
(
MAKE_LINK_MAPS false
)
set
(
CMAKE_CXX_FLAGS
"-fopenmp"
)
add_definitions
(
-DPCBNEW
)
add_subdirectory
(
router
)
...
...
pcbnew/ratsnest_data.cpp
View file @
1490099d
...
...
@@ -27,6 +27,10 @@
* @brief Class that computes missing connections on a PCB.
*/
#ifdef USE_OPENMP
#include <omp.h>
#endif
/* USE_OPENMP */
#include <ratsnest_data.h>
#include <class_board.h>
...
...
@@ -829,12 +833,25 @@ void RN_DATA::Recalculate( int aNet )
{
if
(
aNet
<
0
)
// Recompute everything
{
unsigned
int
tid
,
i
,
chunk
,
netCount
;
netCount
=
m_board
->
GetNetCount
();
chunk
=
1
;
#ifdef USE_OPENMP
#pragma omp parallel shared(chunk, netCount) private(i, tid)
{
tid
=
omp_get_thread_num
();
#pragma omp for schedule(guided, chunk)
#else
/* USE_OPENMP */
{
#endif
// Start with net number 1, as 0 stand for not connected
for
(
unsigned
int
i
=
1
;
i
<
m_board
->
GetNetCount
()
;
++
i
)
for
(
i
=
1
;
i
<
netCount
;
++
i
)
{
if
(
m_nets
[
i
].
IsDirty
()
)
updateNet
(
i
);
}
}
/* end of parallel section */
}
else
if
(
aNet
>
0
)
// Recompute only specific net
{
...
...
@@ -848,3 +865,4 @@ void RN_DATA::ClearSimple()
BOOST_FOREACH
(
RN_NET
&
net
,
m_nets
)
net
.
ClearSimple
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment