diff --git a/docs/hamiltonianobservable.rst b/docs/hamiltonianobservable.rst index 768afb084a..cbb225b348 100644 --- a/docs/hamiltonianobservable.rst +++ b/docs/hamiltonianobservable.rst @@ -1682,7 +1682,7 @@ Additional information: :caption: Example ``sposet`` initialization for density matrix use. Occupied and virtual orbital sets are created separately, then joined (``basis="spo_u spo_uv"``). :name: Listing 39 - + @@ -1692,7 +1692,7 @@ Additional information: :caption: Example ``sposet`` initialization for density matrix use. Density matrix orbital basis created separately (``basis="dm_basis"``). :name: Listing 40 - + diff --git a/docs/intro_wavefunction.rst b/docs/intro_wavefunction.rst index 0ad59dde43..b9a59a3950 100644 --- a/docs/intro_wavefunction.rst +++ b/docs/intro_wavefunction.rst @@ -124,7 +124,7 @@ determinants. :caption: Deprecated input style. :name: spo.singledet.old.xml - + @@ -142,7 +142,7 @@ After updating the input style. :name: spo.singledet.xml - + @@ -221,7 +221,7 @@ The input xml block for the spline SPOs is given in :ref:`spline.spo.xml`. A lis :name: spline.spo.xml @@ -297,9 +297,15 @@ Additional information: calculations. Use with caution! - twistnum - If positive, it is the index. We recommend not taking - this way since the indexing might show some uncertainty. If negative, - the super twist is referred by ``twist``. + We recommend not using it in the input because the ordering of orbitals + depends on how they are being stored in the h5 file. ``twistnum`` gets + ignored if ``twist`` exists in the input. If positive, it is the index. + If negative, the super twist is referred by ``twist``. This input + parameter is kept only for keeping old input files working. + +- twist + The twist angle. If neither ``twist`` nor ``twistnum`` is provided, + Take Gamma point, (0, 0, 0). - save_coefs If yes, dump the real-space B-spline coefficient @@ -637,7 +643,7 @@ To enable hybrid orbital representation, the input XML needs to see the tag ``hy :name: Listing 6 ... diff --git a/src/QMCWaveFunctions/BsplineFactory/BsplineReaderBase.cpp b/src/QMCWaveFunctions/BsplineFactory/BsplineReaderBase.cpp index ba90abf66c..aa7f807779 100644 --- a/src/QMCWaveFunctions/BsplineFactory/BsplineReaderBase.cpp +++ b/src/QMCWaveFunctions/BsplineFactory/BsplineReaderBase.cpp @@ -126,7 +126,7 @@ std::unique_ptr BsplineReaderBase::create_spline_set(int spin, xmlNodePt BandInfoGroup vals; vals.TwistIndex = fullband[0].TwistIndex; vals.GroupID = 0; - vals.myName = make_bandgroup_name(mybuilder->getName(), spin, mybuilder->TwistNum, mybuilder->TileMatrix, 0, ns); + vals.myName = make_bandgroup_name(mybuilder->getName(), spin, mybuilder->twist_num_, mybuilder->TileMatrix, 0, ns); vals.selectBands(fullband, 0, ns, false); return create_spline_set(spin, vals); @@ -151,7 +151,7 @@ std::unique_ptr BsplineReaderBase::create_spline_set(int spin, xmlNodePt BandInfoGroup vals; vals.TwistIndex = fullband[0].TwistIndex; vals.GroupID = 0; - vals.myName = make_bandgroup_name(mybuilder->getName(), spin, mybuilder->TwistNum, mybuilder->TileMatrix, + vals.myName = make_bandgroup_name(mybuilder->getName(), spin, mybuilder->twist_num_, mybuilder->TileMatrix, input_info.min_index(), input_info.max_index()); vals.selectBands(fullband, spo2band[spin][input_info.min_index()], input_info.max_index() - input_info.min_index(), false); @@ -193,7 +193,7 @@ void BsplineReaderBase::initialize_spo2band(int spin, if (comm->rank()) return; - std::string aname = make_bandinfo_filename(mybuilder->getName(), spin, mybuilder->TwistNum, mybuilder->TileMatrix, + std::string aname = make_bandinfo_filename(mybuilder->getName(), spin, mybuilder->twist_num_, mybuilder->TileMatrix, comm->getGroupID()); aname += ".bandinfo.dat"; diff --git a/src/QMCWaveFunctions/EinsplineSetBuilder.h b/src/QMCWaveFunctions/EinsplineSetBuilder.h index 8b4fbc4489..bbd8616f13 100644 --- a/src/QMCWaveFunctions/EinsplineSetBuilder.h +++ b/src/QMCWaveFunctions/EinsplineSetBuilder.h @@ -151,11 +151,6 @@ class EinsplineSetBuilder : public SPOSetBuilder */ std::unique_ptr createSPOSetFromXML(xmlNodePtr cur) override; - /** a specific but clean code path in createSPOSetFromXML, for PBC, double, ESHDF - * @param cur the current xml node - */ - void set_metadata(int numOrbs, int TwistNum_inp, bool skipChecks = false); - /** initialize with the existing SPOSet */ std::unique_ptr createSPOSet(xmlNodePtr cur, SPOSetInputInfo& input_info) override; @@ -218,9 +213,8 @@ class EinsplineSetBuilder : public SPOSetBuilder ///////////////////////////// // Twist angle information // ///////////////////////////// - // This stores which "true" twist number I am using - int TwistNum; - TinyVector givenTwist; + // The "true" twist number after analyzing twistnum, twist XML input and h5 + int twist_num_; std::vector> TwistAngles; // integer index of sym operation from the irreducible brillion zone std::vector TwistSymmetry; @@ -244,8 +238,6 @@ class EinsplineSetBuilder : public SPOSetBuilder inline bool TwistPair(PosType a, PosType b); // This maps a 3-integer twist index into the twist number in the file std::map, int, Int3less> TwistMap; - //void AnalyzeTwists(); - void AnalyzeTwists2(); void TileIons(); void OccupyBands(int spin, int sortBands, int numOrbs, bool skipChecks = false); void OccupyBands_ESHDF(int spin, int sortBands, int numOrbs); @@ -306,12 +298,32 @@ class EinsplineSetBuilder : public SPOSetBuilder int particle_hole_pairs; bool makeRotations; +protected: /** broadcast SortBands * @param N number of state * @param root true if it is the i/o node * @return true, if core is found */ bool bcastSortBands(int splin, int N, bool root); + + /** a specific but clean code path in createSPOSetFromXML, for PBC, double, ESHDF + * @param cur the current xml node + */ + void set_metadata(int numOrbs, + int twist_num_inp, + const TinyVector& twist_inp, + bool skipChecks = false); + + /** analyze twists of orbitals in h5 and determinine twist_num_ + * @param twist_num_inp twistnum XML input + * @param twist_inp twst XML input + */ + void AnalyzeTwists2(const int twist_num_inp, const TinyVector& twist_inp); + + /// twistnum_inp == -9999 to indicate no given input after parsing XML + static constexpr int TWISTNUM_NO_INPUT = -9999; + /// twist_inp[i] <= -9999 to indicate no given input after parsing XML + static constexpr double TWIST_NO_INPUT = -9999; }; } // namespace qmcplusplus diff --git a/src/QMCWaveFunctions/EinsplineSetBuilderCommon.cpp b/src/QMCWaveFunctions/EinsplineSetBuilderCommon.cpp index 9e01584573..10093168cf 100644 --- a/src/QMCWaveFunctions/EinsplineSetBuilderCommon.cpp +++ b/src/QMCWaveFunctions/EinsplineSetBuilderCommon.cpp @@ -24,6 +24,7 @@ #include "QMCWaveFunctions/EinsplineSetBuilder.h" #include "OhmmsData/AttributeSet.h" #include "Message/CommOperators.h" +#include #include "QMCWaveFunctions/BsplineFactory/BsplineReaderBase.h" #include "Particle/DistanceTable.h" @@ -48,7 +49,7 @@ EinsplineSetBuilder::EinsplineSetBuilder(ParticleSet& p, const PtclPoolType& pse NumCoreStates(0), MeshFactor(1.0), MeshSize(0, 0, 0), - TwistNum(0), + twist_num_(-1), TileFactor(1, 1, 1), NumMuffinTins(0), LastSpinSet(-1), @@ -398,101 +399,139 @@ bool EinsplineSetBuilder::TwistPair(PosType a, PosType b) return pair; } -void EinsplineSetBuilder::AnalyzeTwists2() +void EinsplineSetBuilder::AnalyzeTwists2(const int twist_num_inp, const TinyVector& twist_inp) { Tensor S; for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) S(i, j) = (double)TileMatrix(i, j); std::vector superFracs; - // This holds to which supercell kpoint each primitive k-point belongs - std::vector superIndex; - int numPrimTwists = TwistAngles.size(); - for (int ki = 0; ki < numPrimTwists; ki++) - { - PosType primTwist = TwistAngles[ki]; - PosType superTwist = dot(S, primTwist); - PosType kp = PrimCell.k_cart(primTwist); - PosType ks = SuperCell.k_cart(superTwist); - if (dot(ks - kp, ks - kp) > 1.0e-6) + std::vector> superSets; + { // build super twists + // This holds to which supercell kpoint each primitive k-point belongs + std::vector superIndex; + const int numPrimTwists = TwistAngles.size(); + for (int ki = 0; ki < numPrimTwists; ki++) { - app_error() << "Primitive and super k-points do not agree. Error in coding.\n"; - APP_ABORT("EinsplineSetBuilder::AnalyzeTwists2"); + PosType primTwist = TwistAngles[ki]; + PosType superTwist = dot(S, primTwist); + PosType kp = PrimCell.k_cart(primTwist); + PosType ks = SuperCell.k_cart(superTwist); + if (dot(ks - kp, ks - kp) > 1.0e-6) + { + app_error() << "Primitive and super k-points do not agree. Error in coding.\n"; + APP_ABORT("EinsplineSetBuilder::AnalyzeTwists2"); + } + PosType frac = FracPart(superTwist); + bool found = false; + for (int j = 0; j < superFracs.size(); j++) + { + PosType diff = frac - superFracs[j]; + if (dot(diff, diff) < 1.0e-6) + { + found = true; + superIndex.push_back(j); + } + } + if (!found) + { + superIndex.push_back(superFracs.size()); + superFracs.push_back(frac); + } } - PosType frac = FracPart(superTwist); - bool found = false; - for (int j = 0; j < superFracs.size(); j++) + const int numSuperTwists = superFracs.size(); + app_log() << "Found " << numSuperTwists << " distinct supercell twists.\n"; + // For each supercell twist, create a list of primitive twists which + // belong to it. + superSets.resize(numSuperTwists); + for (int ki = 0; ki < numPrimTwists; ki++) + superSets[superIndex[ki]].push_back(ki); + app_log() << "number of things" << std::endl; + app_log() << TwistSymmetry.size() << std::endl; + app_log() << TwistWeight.size() << std::endl; + // for (int ki=0; kirank() == 0) { - PosType diff = frac - superFracs[j]; - if (dot(diff, diff) < 1.0e-6) + int n_tot_irred(0); + for (int si = 0; si < numSuperTwists; si++) { - found = true; - superIndex.push_back(j); + char buf[1000]; + snprintf(buf, 1000, "Super twist #%d: [ %9.5f %9.5f %9.5f ]\n", si, superFracs[si][0], superFracs[si][1], + superFracs[si][2]); + app_log() << buf; + app_log().flush(); } } - if (!found) + } + const int numSuperTwists = superFracs.size(); + + { // determine twist_num_ + std::function find_twist = [&](const TinyVector& twist) { + int twist_num = -1; + PosType gtFrac = FracPart(twist); + float eps = 1e-5; + for (int si = 0; si < numSuperTwists; si++) + { + PosType locDiff = gtFrac - superFracs[si]; + if (dot(locDiff, locDiff) < eps) + twist_num = si; + } + + if (twist_num < 0) + { + char buf[1000]; + snprintf(buf, 1000, + "AnalyzeTwists2. Input twist [ %9.5f %9.5f %9.5f] not found in the list of super twists above.\n", + twist[0], twist[1], twist[2]); + throw UniformCommunicateError(buf); + } + return twist_num; + }; + + if (twist_inp[0] > TWIST_NO_INPUT || twist_inp[1] > TWIST_NO_INPUT || twist_inp[2] > TWIST_NO_INPUT) { - superIndex.push_back(superFracs.size()); - superFracs.push_back(frac); + if (twist_num_inp != TWISTNUM_NO_INPUT) + app_warning() << "twist attribute exists. twistnum attribute ignored. " + "To prevent this message, remove twistnum from input." + << std::endl; + + twist_num_ = find_twist(twist_inp); } - } - int numSuperTwists = superFracs.size(); - app_log() << "Found " << numSuperTwists << " distinct supercell twists.\n"; - // For each supercell twist, create a list of primitive twists which - // belong to it. - std::vector> superSets; - superSets.resize(numSuperTwists); - for (int ki = 0; ki < numPrimTwists; ki++) - superSets[superIndex[ki]].push_back(ki); - app_log() << "number of things" << std::endl; - app_log() << TwistSymmetry.size() << std::endl; - app_log() << TwistWeight.size() << std::endl; - // for (int ki=0; kirank() == 0) - { - int n_tot_irred(0); - for (int si = 0; si < numSuperTwists; si++) + else if (twist_num_inp != TWISTNUM_NO_INPUT) { - char buf[1000]; - snprintf(buf, 1000, "Super twist #%d: [ %9.5f %9.5f %9.5f ]\n", si, superFracs[si][0], superFracs[si][1], - superFracs[si][2]); - app_log() << buf; - app_log().flush(); - // fprintf (stderr, " Using k-points: "); - // for (int i=0; i= numSuperTwists) + { + std::ostringstream msg; + msg << "AnalyzeTwists2. twistnum input value " << twist_num_inp << " is outside the acceptable range [0, " + << numSuperTwists << ")." << std::endl; + throw UniformCommunicateError(msg.str()); + } + twist_num_ = twist_num_inp; } - // fprintf (stderr, "Number in irredicible twist grid: %d \n", n_tot_irred); - } - if (TwistNum < 0) - { - PosType gtFrac = FracPart(givenTwist); - float eps = 1e-5; - for (int si = 0; si < numSuperTwists; si++) + else { - PosType locDiff = gtFrac - superFracs[si]; - if (dot(locDiff, locDiff) < eps) - TwistNum = si; + app_log() << "twist attribte does't exist. Set Gamma point." << std::endl; + twist_num_ = find_twist({0, 0, 0}); } - } - // Check supertwist for this node - if (!myComm->rank()) - { + + assert(twist_num_ >= 0 && twist_num_ < numSuperTwists); + char buf[1000]; - snprintf(buf, 1000, " Using supercell twist %d: [ %9.5f %9.5f %9.5f]\n", TwistNum, superFracs[TwistNum][0], - superFracs[TwistNum][1], superFracs[TwistNum][2]); - app_log() << buf; - app_log().flush(); + snprintf(buf, 1000, " Using supercell twist %d: [ %9.5f %9.5f %9.5f]", twist_num_, superFracs[twist_num_][0], + superFracs[twist_num_][1], superFracs[twist_num_][2]); + app_log() << buf << std::endl; } - TargetPtcl.setTwist(superFracs[TwistNum]); + + TargetPtcl.setTwist(superFracs[twist_num_]); #ifndef QMC_COMPLEX // Check to see if supercell twist is okay to use with real wave // functions for (int dim = 0; dim < OHMMS_DIM; dim++) { - double t = 2.0 * superFracs[TwistNum][dim]; + double t = 2.0 * superFracs[twist_num_][dim]; if (std::abs(t - round(t)) > MatchingTol * 100) { app_error() << "Cannot use this super twist with real wavefunctions.\n" @@ -503,7 +542,7 @@ void EinsplineSetBuilder::AnalyzeTwists2() #endif // Now check to see that each supercell twist has the right twists // to tile the primitive cell orbitals. - int numTwistsNeeded = std::abs(det(TileMatrix)); + const int numTwistsNeeded = std::abs(det(TileMatrix)); for (int si = 0; si < numSuperTwists; si++) { // First make sure we have enough points @@ -513,7 +552,7 @@ void EinsplineSetBuilder::AnalyzeTwists2() snprintf(buf, 1000, "Super twist %d should own %d k-points, but owns %d.\n", si, numTwistsNeeded, static_cast(superSets[si].size())); app_error() << buf; - if (si == TwistNum) + if (si == twist_num_) { APP_ABORT("EinsplineSetBuilder::AnalyzeTwists2"); } @@ -541,17 +580,11 @@ void EinsplineSetBuilder::AnalyzeTwists2() } } app_log().flush(); - if (TwistNum >= superSets.size()) - { - app_error() << "Trying to use supercell twist " << TwistNum << " when only " << superSets.size() << " sets exist.\n" - << "Please select a twist number between 0 and " << superSets.size() - 1 << ".\n"; - APP_ABORT_TRACE(__FILE__, __LINE__, "Invalid TwistNum"); - } // Finally, record which k-points to include on this group of - // processors, which have been assigned supercell twist TwistNum + // processors, which have been assigned supercell twist twist_num_ IncludeTwists.clear(); - for (int i = 0; i < superSets[TwistNum].size(); i++) - IncludeTwists.push_back(superSets[TwistNum][i]); + for (int i = 0; i < superSets[twist_num_].size(); i++) + IncludeTwists.push_back(superSets[twist_num_][i]); // Now, find out which twists are distinct DistinctTwists.clear(); #ifndef QMC_COMPLEX diff --git a/src/QMCWaveFunctions/EinsplineSetBuilder_createSPOs.cpp b/src/QMCWaveFunctions/EinsplineSetBuilder_createSPOs.cpp index f684e681da..6eba44aac6 100644 --- a/src/QMCWaveFunctions/EinsplineSetBuilder_createSPOs.cpp +++ b/src/QMCWaveFunctions/EinsplineSetBuilder_createSPOs.cpp @@ -38,7 +38,10 @@ namespace qmcplusplus { -void EinsplineSetBuilder::set_metadata(int numOrbs, int TwistNum_inp, bool skipChecks) +void EinsplineSetBuilder::set_metadata(int numOrbs, + int twist_num_inp, + const TinyVector& twist_inp, + bool skipChecks) { // 1. set a lot of internal parameters in the EinsplineSetBuilder class // e.g. TileMatrix, use_real_splines_, DistinctTwists, MakeTwoCopies. @@ -99,8 +102,7 @@ void EinsplineSetBuilder::set_metadata(int numOrbs, int TwistNum_inp, bool skipC AtomicOrbitals[iat].Lattice.set(Lattice); // Now, analyze the k-point mesh to figure out the what k-points are needed - TwistNum = TwistNum_inp; - AnalyzeTwists2(); + AnalyzeTwists2(twist_num_inp, twist_inp); } std::unique_ptr EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur) @@ -108,9 +110,10 @@ std::unique_ptr EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur) //use 2 bohr as the default when truncated orbitals are used based on the extend of the ions int numOrbs = 0; int sortBands(1); - int spinSet = 0; - int TwistNum_inp = 0; - bool skipChecks = false; + int spinSet = 0; + bool skipChecks = false; + int twist_num_inp = TWISTNUM_NO_INPUT; + TinyVector twist_inp(TWIST_NO_INPUT); std::string sourceName; std::string spo_prec("double"); @@ -133,8 +136,8 @@ std::unique_ptr EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur) a.add(TileFactor, "tile"); a.add(sortBands, "sort"); a.add(TileMatrix, "tilematrix"); - a.add(TwistNum_inp, "twistnum"); - a.add(givenTwist, "twist"); + a.add(twist_num_inp, "twistnum"); + a.add(twist_inp, "twist"); a.add(sourceName, "source"); a.add(MeshFactor, "meshfactor"); a.add(hybrid_rep, "hybridrep"); @@ -248,7 +251,7 @@ std::unique_ptr EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur) // set the internal parameters if (spinSet == 0) - set_metadata(numOrbs, TwistNum_inp, skipChecks); + set_metadata(numOrbs, twist_num_inp, twist_inp, skipChecks); //if (use_complex_orb == "yes") use_real_splines_ = false; // override given user input // look for , would be a lot easier with xpath, but I cannot get it to work diff --git a/src/QMCWaveFunctions/EinsplineSpinorSetBuilder.cpp b/src/QMCWaveFunctions/EinsplineSpinorSetBuilder.cpp index 882ab550cd..5ef2ba5d9d 100644 --- a/src/QMCWaveFunctions/EinsplineSpinorSetBuilder.cpp +++ b/src/QMCWaveFunctions/EinsplineSpinorSetBuilder.cpp @@ -32,9 +32,10 @@ std::unique_ptr EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt { int numOrbs = 0; int sortBands(1); - int spinSet = 0; - int spinSet2 = 1; - int TwistNum_inp = 0; + int spinSet = 0; + int spinSet2 = 1; + int twist_num_inp = TWISTNUM_NO_INPUT; + TinyVector twist_inp(TWIST_NO_INPUT); //There have to be two "spin states"... one for the up channel and one for the down channel. // We force this for spinors and manually resize states and FullBands. @@ -56,8 +57,8 @@ std::unique_ptr EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt a.add(TileFactor, "tile"); a.add(sortBands, "sort"); a.add(TileMatrix, "tilematrix"); - a.add(TwistNum_inp, "twistnum"); - a.add(givenTwist, "twist"); + a.add(twist_num_inp, "twistnum"); + a.add(twist_inp, "twist"); a.add(sourceName, "source"); a.add(MeshFactor, "meshfactor"); a.add(hybrid_rep, "hybridrep"); @@ -144,7 +145,7 @@ std::unique_ptr EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt //than Einspline on what the data means... bool skipChecks = true; - set_metadata(numOrbs, TwistNum_inp, skipChecks); + set_metadata(numOrbs, twist_num_inp, twist_inp, skipChecks); ////////////////////////////////// // Create the OrbitalSet object @@ -159,7 +160,8 @@ std::unique_ptr EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt // safeguard for a removed feature if (truncate == "yes") - myComm->barrier_and_abort("The 'truncate' feature of spline SPO has been removed. Please use hybrid orbital representation."); + myComm->barrier_and_abort( + "The 'truncate' feature of spline SPO has been removed. Please use hybrid orbital representation."); std::string useGPU("no"); #if !defined(QMC_COMPLEX) @@ -192,12 +194,12 @@ std::unique_ptr EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt MixedSplineReader->setRotate(false); //Make the up spin set. - HasCoreOrbs = bcastSortBands(spinSet, NumDistinctOrbitals, myComm->rank() == 0); + HasCoreOrbs = bcastSortBands(spinSet, NumDistinctOrbitals, myComm->rank() == 0); auto bspline_zd_u = MixedSplineReader->create_spline_set(spinSet, spo_cur); //Make the down spin set. OccupyBands(spinSet2, sortBands, numOrbs, skipChecks); - HasCoreOrbs = bcastSortBands(spinSet2, NumDistinctOrbitals, myComm->rank() == 0); + HasCoreOrbs = bcastSortBands(spinSet2, NumDistinctOrbitals, myComm->rank() == 0); auto bspline_zd_d = MixedSplineReader->create_spline_set(spinSet2, spo_cur); //register with spin set and we're off to the races. diff --git a/src/QMCWaveFunctions/SPOSetBuilder.cpp b/src/QMCWaveFunctions/SPOSetBuilder.cpp index 5cc8bcf3d9..6f2392eaa6 100644 --- a/src/QMCWaveFunctions/SPOSetBuilder.cpp +++ b/src/QMCWaveFunctions/SPOSetBuilder.cpp @@ -14,6 +14,7 @@ #include "SPOSetBuilder.h" #include "OhmmsData/AttributeSet.h" +#include #if !defined(QMC_COMPLEX) #include "QMCWaveFunctions/RotatedSPOs.h" @@ -72,10 +73,18 @@ SPOSet* SPOSetBuilder::createSPOSet(xmlNodePtr cur) // process general sposet construction requests // and preserve legacy interface std::unique_ptr sposet; - if (legacy && input_info.legacy_request) - sposet = createSPOSetFromXML(cur); - else - sposet = createSPOSet(cur, input_info); + + try + { + if (legacy && input_info.legacy_request) + sposet = createSPOSetFromXML(cur); + else + sposet = createSPOSet(cur, input_info); + } + catch (const UniformCommunicateError& ue) + { + myComm->barrier_and_abort(ue.what()); + } if (!sposet) myComm->barrier_and_abort("SPOSetBuilder::createSPOSet sposet creation failed"); @@ -88,8 +97,8 @@ SPOSet* SPOSetBuilder::createSPOSet(xmlNodePtr cur) #else // create sposet with rotation auto& sposet_ref = *sposet; - auto rot_spo = std::make_unique(std::move(sposet)); - xmlNodePtr tcur = cur->xmlChildrenNode; + auto rot_spo = std::make_unique(std::move(sposet)); + xmlNodePtr tcur = cur->xmlChildrenNode; while (tcur != NULL) { std::string cname((const char*)(tcur->name));