Modeling of fast switching processes in nanoscale spin valves