Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 9bc64e27 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Defensive programming for single image collect.

In DEBUG compile mode, sets the values in the destination image to known
(and probably wrong) numbers to ensure that all the values get set
properly (as opposed to just left over in the buffer).
parent 7ab7118e
......@@ -16,6 +16,7 @@
#include <IceTDevStrategySelect.h>
#include <stdlib.h>
#include <string.h>
#define FULL_IMAGE_DATA 20
......@@ -475,6 +476,21 @@ void icetSingleImageCollect(const IceTSparseImage input_image,
icetCommGather(&piece_offset, 1, ICET_SIZE_TYPE, offsets, dest);
icetCommGather(&piece_size, 1, ICET_SIZE_TYPE, sizes, dest);
#ifdef DEBUG
if (rank == dest) {
IceTVoid *data;
IceTSizeType size;
if (icetImageGetColorFormat(result_image) != ICET_IMAGE_COLOR_NONE) {
data = icetImageGetColorVoid(result_image, &size);
memset(data, 0xCD, icetImageGetNumPixels(result_image)*size);
if (icetImageGetDepthFormat(result_image) != ICET_IMAGE_DEPTH_NONE) {
data = icetImageGetDepthVoid(result_image, &size);
memset(data, 0xCD, icetImageGetNumPixels(result_image)*size);
if (piece_size > 0) {
/* Decompress data into appropriate offset of result image. */
icetDecompressSubImage(input_image, piece_offset, result_image);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment