3 #ifndef DISTNTF_DISTNTFANLSBPP_HPP_ 4 #define DISTNTF_DISTNTFANLSBPP_HPP_ 11 #define ONE_THREAD_MATRIX_SIZE 2000 22 MAT update(
const int mode) {
23 MAT othermat(this->m_local_ncp_factors_t.factor(mode));
24 if (m_nls_sizes[mode] > 0) {
25 unsigned int numThreads =
27 #pragma omp parallel for schedule(dynamic) 28 for (
UINT i = 0; i < numThreads; i++) {
31 if (spanEnd > this->ncp_local_mttkrp_t[mode].n_cols - 1) {
32 spanEnd = this->ncp_local_mttkrp_t[mode].n_cols - 1;
36 if (spanStart <= spanEnd) {
37 if (spanStart == spanEnd) {
40 (
VEC)this->ncp_local_mttkrp_t[mode].col(spanStart),
true);
44 (
MAT)this->ncp_local_mttkrp_t[mode].cols(spanStart, spanEnd),
48 INFO <<
"Scheduling " << worh <<
" start=" << spanStart
49 <<
", end=" << spanEnd <<
", tid=" << omp_get_thread_num()
56 INFO <<
"completed " << worh <<
" start=" << spanStart
57 <<
", end=" << spanEnd <<
", tid=" << omp_get_thread_num()
58 <<
" cpu=" << sched_getcpu() <<
" time taken=" << t2
59 <<
" num_iterations()=" << numIter << std::endl;
61 if (spanStart == spanEnd) {
63 othermat.col(i) = solVec;
79 const UVEC &i_global_dims,
const UVEC &i_local_dims,
80 const UVEC &i_nls_sizes,
const UVEC &i_nls_idxs,
82 :
DistAUNTF(i_tensor, i_k, i_algo, i_global_dims, i_local_dims,
83 i_nls_sizes, i_nls_idxs, i_mpicomm) {}
88 #endif // DISTNTF_DISTNTFANLSBPP_HPP_ MATTYPE getSolutionMatrix()
Data is stored such that the unfolding is column major.
#define ONE_THREAD_MATRIX_SIZE
DistNTFANLSBPP(const Tensor &i_tensor, const int i_k, algotype i_algo, const UVEC &i_global_dims, const UVEC &i_local_dims, const UVEC &i_nls_sizes, const UVEC &i_nls_idxs, const NTFMPICommunicator &i_mpicomm)
VECTYPE getSolutionVector()
ncp_factors contains the factors of the ncp every ith factor is of size n_i * k number of factors is ...