Moved most of main.cpp to MPIPTM or SerialPTM