Skip to content

Commit 2037709

Browse files
committed
more openmp support
1 parent 9b46e84 commit 2037709

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

maps/src/maputils.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ py::tuple GetRaDecMap(const G3SkyMap &m)
169169
ra->ConvertToDense();
170170
dec->ConvertToDense();
171171

172+
#ifdef _OPENMP
173+
#pragma omp parallel for schedule(static)
174+
#endif
172175
for (size_t i = 0; i < m.size(); i++) {
173176
std::vector<double> radec = m.PixelToAngle(i);
174177
(*ra)[i] = radec[0];
@@ -203,6 +206,9 @@ G3SkyMapMaskPtr GetRaDecMask(const G3SkyMap &m, double ra_left, double ra_right,
203206
ra_left = wrap_ra(ra_left);
204207
ra_right = wrap_ra(ra_right);
205208

209+
#ifdef _OPENMP
210+
#pragma omp parallel for schedule(static)
211+
#endif
206212
for (size_t i = 0; i < m.size(); i++) {
207213
std::vector<double> radec = m.PixelToAngle(i);
208214
double ra = wrap_ra(radec[0]);
@@ -228,7 +234,9 @@ G3SkyMapMaskPtr GetGalacticPlaneMask(const G3SkyMap &m, double lat)
228234

229235
if (m.coord_ref == MapCoordReference::Equatorial) {
230236
auto q_rot = get_fk5_j2000_to_gal_quat();
231-
237+
#ifdef _OPENMP
238+
#pragma omp parallel for schedule(static)
239+
#endif
232240
for (size_t i = 0; i < m.size(); i++) {
233241
// compute just latitude part of each coordinate
234242
auto q = q_rot * m.PixelToQuat(i);
@@ -238,6 +246,9 @@ G3SkyMapMaskPtr GetGalacticPlaneMask(const G3SkyMap &m, double lat)
238246
(*mask)[i] = true;
239247
}
240248
} else if (m.coord_ref == MapCoordReference::Galactic) {
249+
#ifdef _OPENMP
250+
#pragma omp parallel for schedule(static)
251+
#endif
241252
for (size_t i = 0; i < m.size(); i++) {
242253
auto q = m.PixelToQuat(i);
243254
if (fabs(q.d()) <= slat)

0 commit comments

Comments
 (0)