A parallel simulated annealing algorithm for the design of magnetic structures