A method is presented to measure lattice and grain boundary diffusion coefficients using secondary ion mass spectroscopy and 2-dimensional diffusion simulations. SIMS is used to measure concentration profiles of implanted species before and after annealing. The as-implanted concentration profile is used as the initial condition for 2-dimensional diffusion simulations using the finite element method. The geometry of the simulation is based on the microstructure of the sample observed by transmission electron microscopy. Both lattice and grain boundary diffusion are simulated. The final 2-dimensional concentration distribution is projected on the depth axis to obtain a simulated depth profile. The diffusion coefficients are adjusted to fit the profiles measured after annealing. We find that this method allows to determine simultaneously and independently the lattice and grain boundary diffusion coefficients from the same profiles. This method is used to measure the diffusion coefficients of As in polycrystalline Ni2Si thin films. The simulations are found to fit the measured profiles with accuracy. The coefficients are measured between 550 and 700°C. An activation energy ratio Qgb/Qv is found greater than one. This result is corroborated by existing data in silicides and is compared to results in other materials for discussion.