Let's say $n$ is the number of integers and $t$ is their sum and we want to find all the combinations of number $t$, such that there are $n$ components. See https://en.wikipedia.org/wiki/Composition_(combinatorics)
This is implemented in R under Partition library.
library(partitions)
# In this example, we impose condition
# that each rows must sum up to 2 in total
# And each row has 5 columns
t <- 2
n <- 5
#The above two parameters are predefined.
t(as.matrix(compositions(t, n)))
[,1] [,2] [,3] [,4] [,5]
[1,] 2 0 0 0 0
[2,] 1 1 0 0 0
[3,] 0 2 0 0 0
[4,] 1 0 1 0 0
[5,] 0 1 1 0 0
[6,] 0 0 2 0 0
[7,] 1 0 0 1 0
[8,] 0 1 0 1 0
[9,] 0 0 1 1 0
[10,] 0 0 0 2 0
[11,] 1 0 0 0 1
[12,] 0 1 0 0 1
[13,] 0 0 1 0 1
[14,] 0 0 0 1 1
[15,] 0 0 0 0 2
How ever, if $n,t>1000$ it becomes too slow to save all the compositions. I would like to only get $m$ compositions, such that they are picked randomly from all possible compositions. We assume that all compositions have the same probability of being picked i.e. they are uniformly distributed.
There are (many different) ways to enumerate the compositions (you can, for example, use the correspondence given with binary representations of numbers described in the Wikipedia link you give), so you can write a function translating between the index of a composition and the composition itself. Then you can simply select $m$ numbers at random (from an appropriate range) and retrieve the corresponding compositions.