1
1

For the love of all that is holy, do not put 1MB arrays on the stack.

This was causing JVMs to run out of stack space, and all manner of
badness ensued.

Instead, use the heap -- that's what it's there for.

cmr=v1.7.5:reviewer=rhc:subject=make coll/ml use the heap for large debug array

This commit was SVN r31073.
Этот коммит содержится в:
Jeff Squyres 2014-03-14 20:39:39 +00:00
родитель ce5274652f
Коммит 036db91f3d

Просмотреть файл

@ -2440,12 +2440,14 @@ static int mca_coll_ml_fill_in_route_tab(mca_coll_ml_topology_t *topo, ompi_comm
#if OPAL_ENABLE_DEBUG
#define COLL_ML_ROUTE_BUFF_SIZE (1024*1024)
{
/* Only bother creating the string if we're actually going to
print it out (i.e., if the verbose level is >= 10) */
if (mca_coll_ml_component.verbose >= 10) {
int ii, jj;
char buff[COLL_ML_ROUTE_BUFF_SIZE];
char *output = buff;
char *buff, *output;
memset(buff, 0, COLL_ML_ROUTE_BUFF_SIZE);
output = buff = calloc(1, COLL_ML_ROUTE_BUFF_SIZE);
assert(NULL != output);
sprintf(output, "ranks: ");
@ -2499,7 +2501,8 @@ static int mca_coll_ml_fill_in_route_tab(mca_coll_ml_topology_t *topo, ompi_comm
}
ML_VERBOSE(10, ("\nThe table is:\n============\n%s\n", buff));
}
free(buff);
} while(0);
#endif
for (level = 0; level < topo->n_levels; ++level) {