ydmao/Metis — pull request #5 by ms705 (2013-08-16 16:00:37+00:00)
Title: Fix under-flow bug in defsplitter

The default splitter implementation suffers from a bug that causes it to go into an infinite memory allocation loop (eventually running out of memory) when running on very small test inputs. This occurs if the total input size is less than (def_nsplits_per_core * num_cores) bytes (e.g. 128 bytes for an 8-core system with the default value of 16 for def_nsplits_per_core). As a result of ma->length being zero, the pre-split loop in application.cc (line 224) would never terminate.

Steps to reproduce bug: run the `wc` example application on a very small file.

The fix makes sure that each ma->length is at least one character wide, and thus avoids the infinite ballooning of memory.