upc

UPC Runtime error: out-of-range size for UPC_SHARED_HEAP_SIZE


I tried running a code xcorupc_alaska compiled on Berkeley UPC

upcrun -n 3 -shared-heap=18GB xcorupc_alaska inputpgas0.txt

Total memory on my computer is 64 GB and I want to allot 18 GB to 3 CPUs (it is a quad-core processor), so it should be doable (usage 18x3=54 GB). However I get this error.

UPC Runtime error: out-of-range size for UPC_SHARED_HEAP_SIZE: 18 GB
NOTICE: Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace. 
UPC Runtime error: out-of-range size for UPC_SHARED_HEAP_SIZE: 18 GB
NOTICE: Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace. 
UPC Runtime error: out-of-range size for UPC_SHARED_HEAP_SIZE: 18 GB
NOTICE: Before reporting bugs, run with GASNET_BACKTRACE=1 in the environment to generate a backtrace.

Any idea on what is causing this error and how to fix it ? Thanks for your help.


EDIT: Even for 64 bit system, default maximum shared memory per thread is 16 GB. According to information in INSTALL.TXT, I recompiled with the flag --with-sptr-packed-bits=20,9,35. This limits the maximum number of possible threads to 2^9, but allows 2^16=32 GB maximum shared memory per thread. This solved my problem.


Solution

  • The most common cause for this error is that your build of Berkeley UPC is configured for targeting 32-bit application executables, which can't reliably handle more than about 2GB of shared heap per process. You can confirm this by checking the "Architecture" line in the output of this command:

    upcrun -i xcorupc_alaska (or swap in the name of any BUPC executable)

    Given your hardware configuration I'd highly recommend rebuilding Berkeley UPC for the LP64 ABI, assuming your OS supports it (most modern OSs do).

    The details for doing this depend on your translator and compiler. Assuming you are using the default online Berkeley UPC translator and a gcc-like compiler suite, you probably want a configure line something like:

    $(srcdir)/configure CC='gcc -m64' CXX='g++ -m64' MPI_CC='mpicc -m64'

    make sure to run this in a fresh build directory to ensure you start from a clean slate. Then build and install as usual (details in $(srcdir)/INSTALL.TXT).