Large-Scale First-Principles Calculations of Magnetic Nanoparticles