Skip to content

Commit

Permalink
smurf: Fix bug that caused creation of shortmaps or bolomaps to segfault
Browse files Browse the repository at this point in the history
Since commit e93e768, smf_rebinmap1 has required a separate map for
each thread. The routines for writing short maps and bolo maps do not yet
support this, so ensure smf_rebinmap1 is called with no workforce. Some
day, when there is nothing more important to do, we could change this to
allow multi-threaded creation of short maps and bolo maps.
  • Loading branch information
David Berry committed Nov 29, 2013
1 parent 00b3113 commit 0e547fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion applications/smurf/libsmf/smf_write_bolomap.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
* Authors:
* EC: Ed Chapin (UBC)
* TIMJ: Tim Jenness (JAC, Hawaii)
* DSB: David Berry (JAC, Hawaii)
* {enter_new_authors_here}
* History:
Expand All @@ -71,6 +72,10 @@
* Don't write a different map for each chunk, instead combine them
* 2011-06-29 (EC):
* Remove ast from interface since res+ast sum now in smf_iteratemap
* 2013-11-29 (DSB):
* Ensure smf_rebinmap1 is not used in mult-threaded mode since it
* now assumes there is an input maps for every thread. Could change
* this some rainy day...
* {enter_further_changes_here}
* Copyright:
Expand Down Expand Up @@ -258,7 +263,7 @@ void smf_write_bolomap( ThrWorkForce *wf, smfArray *res, smfArray *lut,
about variance weighting because all samples from
same detector are about the same. */

smf_rebinmap1( wf, res->sdata[idx],
smf_rebinmap1( NULL, res->sdata[idx],
dat->noi ? dat->noi[0]->sdata[idx] : NULL,
lut_data, 0, 0, 0, NULL, 0,
SMF__Q_GOOD, varmapmethod,
Expand Down
7 changes: 6 additions & 1 deletion applications/smurf/libsmf/smf_write_shortmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
* Authors:
* EC: Ed Chapin (UBC)
* DSB: David Berry (JAC, Hawaii)
* {enter_new_authors_here}
* History:
Expand All @@ -81,6 +82,10 @@
* If shortmap=0, create map each time TCS_INDEX increments
* 2011-06-29 (EC):
* Remove ast from interface since res+ast sum now in smf_iteratemap
* 2013-11-29 (DSB):
* Ensure smf_rebinmap1 is not used in mult-threaded mode since it
* now assumes there is an input maps for every thread. Could change
* this some rainy day...
* {enter_further_changes_here}
* Copyright:
Expand Down Expand Up @@ -295,7 +300,7 @@ void smf_write_shortmap( ThrWorkForce *wf, int shortmap, smfArray *res,
rebinflag |= AST__REBINEND;
}

smf_rebinmap1( wf, res->sdata[idx],
smf_rebinmap1( NULL, res->sdata[idx],
dat->noi ? dat->noi[0]->sdata[idx] : NULL,
lut_data, shortstart, shortend, 1, NULL, 0,
SMF__Q_GOOD, varmapmethod,
Expand Down

0 comments on commit 0e547fa

Please sign in to comment.