Skip to content

Commit e2878b1

Browse files
author
Kenneth Moreland
committed
Added ICET_MAX_IMAGE_SPLIT state and environment variable.
Does not do anything yet.
1 parent 9b6039e commit e2878b1

File tree

5 files changed

+31
-3
lines changed

5 files changed

+31
-3
lines changed

CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ OPTION(ICET_USE_MPI "Build MPI communication layer for IceT." ON)
4040
# Option to set the preferred K value to use in the radix-k algorithm
4141
SET(initial_magic_k 8)
4242
IF ("${CMAKE_SYSTEM_NAME}" MATCHES "^BlueGene")
43-
SET(initial_magic_k 32)
43+
SET(initial_magic_k 16)
4444
ENDIF ("${CMAKE_SYSTEM_NAME}" MATCHES "^BlueGene")
4545
IF ("$ENV{ICET_MAGIC_K}" GREATER 1)
4646
SET(initial_magic_k $ENV{ICET_MAGIC_K})
@@ -52,6 +52,15 @@ IF (NOT ${ICET_MAGIC_K} GREATER 1)
5252
MESSAGE(SEND_ERROR "ICET_MAGIC_K must be set to a number greater than 1.")
5353
ENDIF (NOT ${ICET_MAGIC_K} GREATER 1)
5454

55+
# Option to set the preferred number of ways to break up an image.
56+
SET(initial_max_image_split 2048)
57+
IF ("$ENV{ICET_MAX_IMAGE_SPLIT}" GREATER 0)
58+
SET(initial_max_image_split $ENV{ICET_MAX_IMAGE_SPLIT})
59+
ENDIF ("$ENV{ICET_MAX_IMAGE_SPLIT}" GREATER 0)
60+
SET(ICET_MAX_IMAGE_SPLIT ${initial_max_image_split} CACHE STRING
61+
"Sets the preferred number of times an image may be split. Some image compositing algorithms prefer to partition the images such that each process gets a piece. Too many partitions, though, and you end up spending more time collecting them than you save balancing the compositing."
62+
)
63+
5564
# Configure MPE support
5665
IF (ICET_USE_MPI)
5766
OPTION(ICET_USE_MPE "Use MPE to trace MPI communications. This is helpful for developers trying to measure the performance of parallel compositing algorithms." OFF)

Changes.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ICET_INTERLACE_IMAGES
5858

5959
icetSparseImageInterlace
6060

61-
ICET_MAGIC_K environment variable
61+
ICET_MAGIC_K environment variable, cmake variable, state variable
6262

6363
ICET_COLLECT_TIME: The fraction of ICET_COMPOSITE_TIME spent in collecting
6464
image fragments to display process.
@@ -94,3 +94,5 @@ processes contain all pixels in the image (ICET_VALID_PIXELS_OFFSET is 0
9494
and ICET_VALID_PIXELS_NUM is the number of pixels in the image), and all
9595
other processes have no pixel data. Strategies taking advantage of turning
9696
off ICET_COLLECT_IMAGES should set this.
97+
98+
ICET_MAX_IMAGE_SPLIT environment variable, cmake variable, state variable

src/ice-t/state.c

+15
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,21 @@ void icetStateSetDefaults(void)
170170
icetStateSetInteger(ICET_MAGIC_K, ICET_MAGIC_K_DEFAULT);
171171
}
172172

173+
if (getenv("ICET_MAX_IMAGE_SPLIT") != NULL) {
174+
IceTInt max_image_split = atoi(getenv("ICET_MAX_IMAGE_SPLIT"));
175+
if (max_image_split > 0) {
176+
icetStateSetInteger(ICET_MAX_IMAGE_SPLIT, max_image_split);
177+
} else {
178+
icetRaiseError("Environment variable ICET_MAX_IMAGE_SPLIT must be"
179+
" set to an integer greater than 0.",
180+
ICET_INVALID_VALUE);
181+
icetStateSetInteger(ICET_MAX_IMAGE_SPLIT,
182+
ICET_MAX_IMAGE_SPLIT_DEFAULT);
183+
}
184+
} else {
185+
icetStateSetInteger(ICET_MAX_IMAGE_SPLIT, ICET_MAX_IMAGE_SPLIT_DEFAULT);
186+
}
187+
173188
icetStateSetPointer(ICET_DRAW_FUNCTION, NULL);
174189
icetStateSetPointer(ICET_RENDER_LAYER_DESTRUCTOR, NULL);
175190

src/include/IceT.h

+1
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ ICET_EXPORT void icetDiagnostics(IceTBitField mask);
281281
#define ICET_FRAME_COUNT (ICET_STATE_ENGINE_START | (IceTEnum)0x002E)
282282

283283
#define ICET_MAGIC_K (ICET_STATE_ENGINE_START | (IceTEnum)0x0040)
284+
#define ICET_MAX_IMAGE_SPLIT (ICET_STATE_ENGINE_START | (IceTEnum)0x0041)
284285

285286
#define ICET_DRAW_FUNCTION (ICET_STATE_ENGINE_START | (IceTEnum)0x0060)
286287
#define ICET_RENDER_LAYER_DESTRUCTOR (ICET_STATE_ENGINE_START|(IceTEnum)0x0061)

src/include/IceTConfig.h.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ typedef IceTInt64 IceTPointerArithmetic;
123123
#error "Unexpected pointer size."
124124
#endif
125125

126-
#define ICET_MAGIC_K_DEFAULT @ICET_MAGIC_K@
126+
#define ICET_MAGIC_K_DEFAULT @ICET_MAGIC_K@
127+
#define ICET_MAX_IMAGE_SPLIT_DEFAULT @ICET_MAX_IMAGE_SPLIT@
127128

128129
#cmakedefine ICET_USE_MPE
129130

0 commit comments

Comments
 (0)