@@ -974,7 +974,7 @@ void SAR_Calculation::AssignUsedSAR(double* vx_sar, unsigned int start[3], unsig
974974 return ;
975975}
976976
977- bool SAR_Calculation::CalcAvgStep1SAR (unsigned int t_id, ArrayLib::ArrayIJK<bool > &Vx_Valid, ArrayLib::ArrayIJK<bool > &Vx_Used)
977+ bool SAR_Calculation::CalcAvgStep1SAR (ArrayLib::ArrayIJK<bool > &Vx_Valid, ArrayLib::ArrayIJK<bool > &Vx_Used)
978978{
979979 unsigned int pos[3 ];
980980
@@ -1005,11 +1005,6 @@ bool SAR_Calculation::CalcAvgStep1SAR(unsigned int t_id, ArrayLib::ArrayIJK<bool
10051005 size_t todo = Vx_Valid.size ();
10061006 size_t prog_N = max (1 ,(int )(todo/100 ));
10071007 double * vx_sar = new double [m_SAR.size ()];
1008- if ((m_progress) && (t_id==0 ))
1009- {
1010- std::lock_guard<std::mutex> lock (m_resultMutex);
1011- std::cout << " Step-1: " ;
1012- }
10131008
10141009 unsigned int i=0 ;
10151010 size_t prog_cnt;
@@ -1094,7 +1089,7 @@ bool SAR_Calculation::CalcAvgStep1SAR(unsigned int t_id, ArrayLib::ArrayIJK<bool
10941089 return true ;
10951090}
10961091
1097- bool SAR_Calculation::CalcAvgStep2SAR (unsigned int t_id, ArrayLib::ArrayIJK<bool > &Vx_Valid, ArrayLib::ArrayIJK<bool > &Vx_Used)
1092+ bool SAR_Calculation::CalcAvgStep2SAR (ArrayLib::ArrayIJK<bool > &Vx_Valid, ArrayLib::ArrayIJK<bool > &Vx_Used)
10981093{
10991094 unsigned int pos[3 ];
11001095
@@ -1114,19 +1109,11 @@ bool SAR_Calculation::CalcAvgStep2SAR(unsigned int t_id, ArrayLib::ArrayIJK<bool
11141109 size_t loc = 0 ;
11151110 size_t out_loc = 0 ;
11161111 size_t todo = Vx_Valid.size () - m_Valid - m_Used - m_AirVoxel;
1117- if ((t_id==0 ) && (m_DebugLevel>0 ))
1118- cout << todo << " voxel todo in step 2." << endl;
11191112 size_t prog_N = max (1 ,(int )(todo/100 ));
11201113
11211114 ArrayLib::ArrayIJK<float > dummy_SAR;
11221115 // count all used and unused etc. + special handling of unused voxels!!
11231116 loc = 0 ;
1124- if ((m_progress) && (t_id==0 ))
1125- {
1126- std::lock_guard<std::mutex> lock (m_resultMutex);
1127- std::cout << " Step-2: " ;
1128- }
1129-
11301117 size_t unused=0 ;
11311118 size_t prog_cnt = 0 ;
11321119
@@ -1264,7 +1251,7 @@ bool SAR_Calculation::CalcAveragedSAR(unsigned int numThreads)
12641251 m_nextStepChunk = 0 ;
12651252 std::vector<std::future<bool >> futures;
12661253 for (unsigned int t = 0 ; t < numThreads; ++t) {
1267- futures.push_back (std::async (std::launch::async, [this , t, &Vx_Valid, &Vx_Used]() {return this ->CalcAvgStep1SAR (t, Vx_Valid, Vx_Used);}));
1254+ futures.push_back (std::async (std::launch::async, [this , &Vx_Valid, &Vx_Used]() {return this ->CalcAvgStep1SAR (Vx_Valid, Vx_Used);}));
12681255 }
12691256
12701257 bool successStep=true ;
@@ -1297,13 +1284,15 @@ bool SAR_Calculation::CalcAveragedSAR(unsigned int numThreads)
12971284 cerr << " Number of invalid cubes (case 1): " << m_step1_case1 << endl;
12981285 cerr << " Number of invalid cubes (case 2): " << m_step1_case2 << endl;
12991286 cerr << " Number of invalid cubes (failed to converge): " << m_step1_no_conv << endl;
1287+ size_t todo = Vx_Valid.size () - m_Valid - m_Used - m_AirVoxel;
1288+ cout << " Step-2: " << todo << " voxel todo." << endl;
13001289 }
13011290
13021291 m_nextStepChunk = 0 ;
13031292 t_start = std::chrono::high_resolution_clock::now ();
13041293 m_progressCounter = 0 ;
13051294 for (unsigned int t = 0 ; t < numThreads; ++t) {
1306- futures.push_back (std::async (std::launch::async, [this , t, &Vx_Valid, &Vx_Used]() {return this ->CalcAvgStep2SAR (t, Vx_Valid, Vx_Used);}));
1295+ futures.push_back (std::async (std::launch::async, [this , &Vx_Valid, &Vx_Used]() {return this ->CalcAvgStep2SAR (Vx_Valid, Vx_Used);}));
13071296 }
13081297
13091298 for (auto & f : futures)
0 commit comments