Roxiemem refactor: optimize fixed and variable rows

- clean up calls to roundup
- Introduced fixed size heaps that can be created on demand
- improve the test cases
  - Test the destructor is being called correctly
  - Add a variable size test
  - Add a simple speed test for the roundup function
- Support for multiple variable size heaps
- Slight optimization of roundup()

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem add new atomic operation

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem fix regression in fixed allocators

- If a rowallocator outlived the rowmanager the system could crash
  when the fixed heap tried to unregister itself.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem change where the row destruct bit is stored

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem normal heaps restricted to a single size

- Ensure that each variable size record bin is mapped to a unique
  allocator
- Move the chunkSize information into the heap - each heap (except for
  the huge heap) now only contains heaplets of a single size.
- Consistently use chunkCapacity for amount of space available to the
  user, and chunkSize for the size including any overhead.
- Prepare for packed row allocators.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem support for packed fixed size allocators

packed allocators have the following characteristics
- they are unique to the activityid
- the sizes are 4 byte aligned, not rounded up
- the overhead per row is 4 bytes instead of 8

Cleanup/improve code for memstats function

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem - improve bitmap processing code

- Clean up various items highlighted by previous code reviews
- Change activityIds to allocatorIds to make distinction clearer
- Use get_cycles_now instead of time, and avoid calling if not
  needed.
- Move the critical section in the bitmap code to reduce scope

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem Add heapHWM for large allocations, and test pages>1

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Initial work on roxiemem callbacks etc

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Add support for round robin at different priorities

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem Support for largemem shared memory

* Initial (untested) implementation of a callback to allow large memory
  to be shared between processes.

* Improve the row manager to allow callbacks to be called if out of
  global memory - improves the performance of stand alone roxie and
  thor when large hared memory is implements

* Improve roxie sort code so it doesn't spill small numbers of rows if
  it failed to reallocate the row array.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
roxiemem restore missing files

- Also rename get->query and link->get

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Mask the allocator id to remove checking flags

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Improve grammar of error text based on review comments

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
Merge pull request #1903 from wangkx/gh1729

Show queries suspended on a given cluster

Reviewed-By: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
gh-1930 sendEmail rejecting some valid server addresses

The code for validating email addresses is incorrectly assuming that
the rules for a valid server address and the rules for a valid email domain
are the same. There is no good reason to validate the email server address
beyond passing it to the socket layer to resolve.

The rules for validating the domain part of the email address are also a little
over-strict and/or out of date - I think we really should remove much of that
validation and leave it to the smtp server to do, but that can be left for a
future fix. For now, just add support for - in email domain names.

Fixes gh-1930.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #1936 from afishbeck/ecl_exceptions_display

gh1888 Fix ecl run error output

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Add support for unsigned integral constants

Allow U as a suffix to a number to inidicate it should be an unsigned number
E.g., 123U 0xFFFFU 0b010101110101U

Also fixed potential problem that windows code was also not adding
unsigned suffixes on generated literal constants.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
gh1884 Only change existing jobname if caller is explicit its an update

When #Workunit is used to set the jobname, we should ignore the
calculated jobname being set.. but if a command line user explicitly sets
a name, it should be used.

Fixes gh-1884

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
Merge pull request #1947 from afishbeck/ecl_jobname

gh1884 Only change existing jobname if caller is explicit its an update

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>