Made a global num_mgmtcores variable