Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
JPScore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
JuPedSim
JPScore
Commits
092793d2
Commit
092793d2
authored
Aug 22, 2016
by
f.mack
Browse files
Options
Downloads
Patches
Plain Diff
Named some omp critical sections
parent
bfeb364f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
routing/FloorfieldViaFM.cpp
+7
-7
7 additions, 7 deletions
routing/FloorfieldViaFM.cpp
routing/ffRouter.cpp
+1
-1
1 addition, 1 deletion
routing/ffRouter.cpp
with
8 additions
and
8 deletions
routing/FloorfieldViaFM.cpp
+
7
−
7
View file @
092793d2
...
...
@@ -291,7 +291,7 @@ void FloorfieldViaFM::getDirectionToUID(int destID, const long int key, Point& d
//if (ped->GetFinalDestination() == -1) /*go to closest exit*/ destID != -1;
// @todo f.mack: remove
//*
#pragma omp critical
#pragma omp critical
(delete_map)
if
(
Pedestrian
::
GetGlobalTime
()
==
10
&&
!
maps_deleted
)
{
//#pragma omp critical
neggradmap
.
clear
();
...
...
@@ -332,7 +332,7 @@ void FloorfieldViaFM::getDirectionToUID(int destID, const long int key, Point& d
if
(
localneggradptr
==
nullptr
)
{
//@todo: ar.graf : check here if other thread has started calc of same ff
//Log->Write("###### key %d wants to calculate new Floorfield to destID %d", key, destID);
bool
isBeingCalculated
;
#pragma omp critical
#pragma omp critical
(isBeingCalculated)
{
if
(
!
(
isBeingCalculated
=
floorfieldsBeingCalculated
.
count
(
destID
)
>
0
))
{
floorfieldsBeingCalculated
.
insert
(
destID
);
...
...
@@ -351,13 +351,13 @@ void FloorfieldViaFM::getDirectionToUID(int destID, const long int key, Point& d
//create floorfield (remove mapentry with nullptr, allocate memory, add mapentry, create ff)
localcostptr
=
new
double
[
grid
->
GetnPoints
()];
localneggradptr
=
new
Point
[
grid
->
GetnPoints
()];
#pragma omp critical
#pragma omp critical
(neggradmap)
neggradmap
.
erase
(
destID
);
#pragma omp critical
#pragma omp critical
(neggradmap)
neggradmap
.
emplace
(
destID
,
localneggradptr
);
#pragma omp critical
#pragma omp critical
(costmap)
costmap
.
erase
(
destID
);
#pragma omp critical
#pragma omp critical
(costmap)
costmap
.
emplace
(
destID
,
localcostptr
);
...
...
@@ -375,7 +375,7 @@ void FloorfieldViaFM::getDirectionToUID(int destID, const long int key, Point& d
//Log->Write("Starting FF for UID %d", destID);
//std::cerr << "\rW\tO\tR\tK\tI\tN\tG";
calculateFloorfield
(
localline
,
localcostptr
,
localneggradptr
);
#pragma omp critical
#pragma omp critical
(isBeingCalculated)
{
if
(
floorfieldsBeingCalculated
.
count
(
destID
)
!=
1
)
{
Log
->
Write
(
"ERROR: FloorfieldViaFM::getDirectionToUID: key %d was calculating FF for destID %d, but it was removed from floorfieldsBeingCalculated meanwhile"
,
key
,
destID
);
...
...
This diff is collapsed.
Click to expand it.
routing/ffRouter.cpp
+
1
−
1
View file @
092793d2
...
...
@@ -175,7 +175,7 @@ bool FFRouter::Init(Building* building)
ptrToNew
=
new
LocalFloorfieldViaFM
((
*
pairRoomIt
).
second
.
get
(),
building
,
0.125
,
0.125
,
0.0
,
false
);
//for (long int i = 0; i < ptrToNew)
Log
->
Write
(
"INFO:
\t
Adding distances in Room %d to matrix"
,
(
*
pairRoomIt
).
first
);
#pragma omp critical
#pragma omp critical
(_locffviafm)
_locffviafm
.
insert
(
std
::
make_pair
((
*
pairRoomIt
).
first
,
ptrToNew
));
}
#pragma omp single nowait
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment