本文整理汇总了C++中Communicator::primaryNode方法的典型用法代码示例。如果您正苦于以下问题:C++ Communicator::primaryNode方法的具体用法?C++ Communicator::primaryNode怎么用?C++ Communicator::primaryNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Communicator
的用法示例。
在下文中一共展示了Communicator::primaryNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
//.........这里部分代码省略.........
double ev=0.0;
while(reader>>idummy && reader>>ev) iev++;
CCIO::cout<<"Found "<< iev <<" eigenvalues in "<< Eval_filename<<"\n";
for(int eid=0; eid<std::min(Nev,iev); ++eid){
double eval;
Field evec(FF.size());
if(Eigen::pickUpFromFile<Format::Format_F>(eval,evec,eid,eig_pred,
Eval_filename,Emod_filename)) continue;
CCIO::cout<< "Eigenvalue: "<< eval<<"\n";
CCIO::cout<< "Norm: "<< evec.norm()<<"\n";
std::ofstream outf, outc;
double ipr=0.0; //inverse participation ratio (2nd moment)
double ipr_q4=0.0; //inverse participation ratio (4th moment)
double ipr_q6=0.0; //inverse participation ratio (6th moment)
int max_loc[4];
double max= 0.0;
int min_loc[4];
double min = 0.0;
for(int t=0; t<Nt; ++t){
std::stringstream ss;
ss<< fname<< "_"<< eid<< "_norm_t"<< t;
std::stringstream sc;
sc<< fname<< "_"<< eid<< "_chirality_t"<< t;
if(comm->primaryNode()){
outf.open(ss.str().c_str());
outc.open(sc.str().c_str());
}
outf<<"x y z norm\n";
outc<<"x y z chi_norm\n";
for(int x=0; x<Nx; ++x){
for(int y=0; y<Ny; ++y){
for(int z=0; z<Nz; ++z){
int site = SiteIndex::instance()->site(x,y,z,t);
int site0 = SiteIndex::instance()->site(x,y,z,0);
//Local norm;
double site_norm = 0.0;
SUNmat PL = mat(PL_field,site0);
double pl_re = SUNmatUtils::ReTr(PL);
double pl_im = SUNmatUtils::ImTr(PL);
//std::valarray<double> site_Array(EigM.evecs_[eid][FF.islice(site)]);
std::valarray<double> site_Array(evec[FF.islice(site)]);
//std::cout << "spinor\n";
//print_va(site_Array);
// DIRAC representation
std::valarray<double> spinor_up(24);
std::valarray<double> spinor_dn(24);
std::valarray<double> chiral(24);
std::valarray<double> chiral_left(24);
std::valarray<double> chiral_right(24);