我在使用服务器上运行我的代码,2个CUP16G的内存在运行计算填充矩阵的时候一直Julia运行不了会奔溃,我找了好多方法都解决不了问题,请求大家的帮助
@time begin
n_snp = UInt(size(SNP_matrix, 1))
n_ind = UInt(size(SNP_matrix, 2))
result = Matrix{Int}(undef, 15509062, 300)
@threads for i in 1:n_snp
@simd for j in 1:n_ind
@inbounds result[i,j] =SNP_matrix[i,j] == 0x03 ? 0x02 : (SNP_matrix[i,j]== 0x02 ? 0x01 : (SNP_matrix[i,j] == 0x00 ? 0x00 : missing))
end
end
v = sum(SNP_matrix, dims = 2)
@views p = vec((v-result) ./ (2*n_ind))
@time @views SNP_matrix = SNP_matrix[findall(x -> x != 1, p),:] #选取p值不为1的数值
@time @views p = p[findall(x -> x != 1, p)]
end