File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
source/source_pw/module_stodft Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -60,17 +60,17 @@ void Stochastic_WF<T, Device>::clean_chiallorder()
6060 delete[] chiallorder;
6161 chiallorder = nullptr ;
6262}
63-
6463template <typename T, typename Device>
6564void Stochastic_WF<T, Device>::init_sto_orbitals(const int seed_in)
6665{
66+ const unsigned int rank_seed_offset = 10000 ;
6767 if (seed_in == 0 || seed_in == -1 )
6868 {
69- srand (( unsigned ) time (nullptr ) + GlobalV::MY_RANK * 10000 ); // GlobalV global variables are reserved
69+ srand (static_cast < unsigned int >( time (nullptr )) + GlobalV::MY_RANK * rank_seed_offset ); // GlobalV global variables are reserved
7070 }
7171 else
7272 {
73- srand (( unsigned ) std::abs (seed_in) + (GlobalV::MY_BNDGROUP * GlobalV::NPROC_IN_BNDGROUP + GlobalV::RANK_IN_BPGROUP) * 10000 );
73+ srand (static_cast < unsigned int >( std::abs (seed_in)) + (GlobalV::MY_BNDGROUP * GlobalV::NPROC_IN_BNDGROUP + GlobalV::RANK_IN_BPGROUP) * rank_seed_offset );
7474 }
7575
7676 this ->allocate_chi0 ();
You can’t perform that action at this time.
0 commit comments