Stellar mass spectrum within massive collapsing clumps I. Influence of the initial conditions