Skip to content

Commit 8c0f1bc

Browse files
author
dyzheng
committed
Fix: compiling error without MPI
1 parent 1f16da1 commit 8c0f1bc

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

source/source_lcao/module_hcontainer/read_hcontainer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ void Read_HContainer<T>::read()
4848
//
4949
hamilt::HContainer<T> hcontainer_serial(&pv_serial);
5050

51+
#ifdef __MPI
5152
if(GlobalV::MY_RANK == 0)
5253
{
54+
#endif
5355
ModuleIO::csrFileReader<T> csr(this->_filename);
5456
int step = csr.getStep();
5557
int matrix_dimension = csr.getMatrixDimension();
@@ -110,6 +112,7 @@ void Read_HContainer<T>::read()
110112
value);
111113
}
112114
}
115+
#ifdef __MPI
113116
}
114117
// thirdly, distribute hcontainer_serial to parallel hcontainer
115118
// send <IJR>s from serial_rank to all ranks
@@ -151,6 +154,12 @@ void Read_HContainer<T>::read()
151154
}
152155
// gather values from serial_rank to Parallels
153156
transferSerial2Parallels(hcontainer_serial, this->_hcontainer, 0);
157+
#else
158+
std::vector<int> para_ijrs = hcontainer_serial.get_ijr_info();
159+
this->_hcontainer->insert_ijrs(&para_ijrs);
160+
this->_hcontainer->allocate();
161+
this->_hcontainer->add(hcontainer_serial);
162+
#endif
154163

155164
}
156165

0 commit comments

Comments
 (0)