Skip to content

Commit 7cd5bbd

Browse files
authored
multithread RemoveWeights (#217)
1 parent e77eb9b commit 7cd5bbd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

maps/src/maputils.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
#include <math.h>
66
#include <stdio.h>
77
#include <stdlib.h>
8+
#ifdef _OPENMP
9+
#include <omp.h>
10+
#endif
811
#include <G3Logging.h>
912
#include <G3Units.h>
1013

@@ -37,11 +40,17 @@ void RemoveWeights(G3SkyMap &T, G3SkyMap &Q, G3SkyMap &U, const G3SkyMapWeights
3740
T.ConvertToDense();
3841
Q.ConvertToDense();
3942
U.ConvertToDense();
43+
#ifdef _OPENMP
44+
#pragma omp parallel for schedule(static)
45+
#endif
4046
for (size_t pix = 0; pix < T.size(); pix++) {
4147
StokesVector v(T[pix], Q[pix], U[pix]);
4248
v /= W.at(pix);
4349
}
4450
} else {
51+
#ifdef _OPENMP
52+
#pragma omp parallel for schedule(static)
53+
#endif
4554
for (size_t pix = 0; pix < W.size(); pix++) {
4655
double t = T.at(pix);
4756
MuellerMatrix m = W.at(pix);

0 commit comments

Comments
 (0)