Geometrical effect on spin current in magnetic nanostructures