Threaded and MPI C++ header libraries for efficient multithreaded IO and messaging