Hi,
Since you mention mmap, I assume you're asking about Linux, so I'll provide the Linux-specific answer:
Yes, the PMDK libraries support huge pages, but mostly by trying to make things align so that the OS can choose to use them. Since persistent memory is allocated by the file system, whether or not the allocations are aligned and large enough for huge pages depends on the specific allocator. When using mmap() to create the mapping, the application doesn't need to provide any special flags for huge pages, the OS will use them if possible.
Your best bet to get large pages is to start with a clean file system and allocate the space using posix_fallocate() (the PMDK libraries do this if you use them to create the file). Then, mmap() is likely to use 2MB pages when possible (1GB mappings are not yet used because there are far fewer TLB entries for 1GB entries in current processors -- in the future, this may change).
You can use Device DAX instead of a file system and you will be sure to get large pages because now there's no file system allocator in the mix, but using Device DAX means you give up the ability to manage your pmem like files (names, permissions, mv, cp, etc).
-andy