- Timestamp:
- May 24, 2008, 12:47:21 PM (17 years ago)
- Children:
- ccd028
- Parents:
- cd028d
- Location:
- pcp/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/data.h
rcd028d rd6f7f3 53 53 OutAllP //!< not used 54 54 }; 55 56 //! enumerating whether to parse source coefficients from file 57 enum ParseSrcDensities { DoNotParse, 58 DoReadAllSrcDensities, 59 DoReadOccupiedSrcDensities, 60 DoReadAndMinimise 61 }; 62 55 63 //! enumerating usage status 56 64 enum UseType { NotInUse, //!< is not in use … … 222 230 unsigned int alarm; //!< set alarm after alarm seconds 223 231 int proc[PROCDIM]; //!< process per gamma point, process per wave fct 224 int ReadSrcFiles; //!< 0 - don't, 1 - read old source file containing previous calculations232 enum ParseSrcDensities ReadSrcFiles; //!< whether to parse source coefficients from file or use minimisation 225 233 int WriteSrcFiles; //!< 0 - don't, 1 - write source file on exit with so far made calculations 226 234 int AddNFactor; //!< ugly hack to fix read srcpsi -
pcp/src/init.c
rcd028d rd6f7f3 1984 1984 InitPsis(P); 1985 1985 InitDensity(P); 1986 if (P->Call.ReadSrcFiles ) {1986 if (P->Call.ReadSrcFiles != DoNotParse) { 1987 1987 if (ReadSrcIons(P)) { 1988 1988 if (P->Call.out[NormalOut]) fprintf(stderr,"(%i) Ionic structure read successfully.\n", P->Par.me); -
pcp/src/opt.c
rcd028d rd6f7f3 59 59 Call->proc[PEPsi] = 0; 60 60 Call->proc[PEGamma] = 0; 61 Call->ReadSrcFiles = 0;61 Call->ReadSrcFiles = DoNotParse; 62 62 Call->WriteSrcFiles = 0; 63 63 Call->AddNFactor = 1; -
pcp/src/output.c
rcd028d rd6f7f3 626 626 // and optional items ... 627 627 if (ParseForParameter(0,SrcPsiDoc,"Epsilon",0,2,1,row_double,&Eps[0],1,optional)) 628 if (( P->Call.ReadSrcFiles == 1) && ((Eps[1] < R->RelEpsKineticEnergy) || (Eps[0] < R->RelEpsTotalEnergy))) {628 if (((P->Call.ReadSrcFiles == DoReadAllSrcDensities) || (P->Call.ReadSrcFiles == DoReadOccupiedSrcDensities)) && ((Eps[1] < R->RelEpsKineticEnergy) || (Eps[0] < R->RelEpsTotalEnergy))) { 629 629 //fprintf(stderr,"(%i) Eps %lg %lg\tRelEps %lg %lg\n", P->Par.me, Eps[0], Eps[1], R->RelEpsTotalEnergy, R->RelEpsKineticEnergy); 630 630 fprintf(stderr,"(%i) NOTE: Doing minimization after source file parsing due to smaller specified epsilon stop conditions.\n",P->Par.me); 631 P->Call.ReadSrcFiles = 2; // do minimisation even after loading631 P->Call.ReadSrcFiles = DoReadAndMinimise; // do minimisation even after loading 632 632 } 633 633 if (readnr != 7) { // check number of items read -
pcp/src/perturbed.c
rcd028d rd6f7f3 121 121 122 122 if(P->Call.out[MinOut]) fprintf(stderr, "(%i) Re-initializing perturbed psi array for type %s ", P->Par.me, R->MinimisationName[type]); 123 if ( P->Call.ReadSrcFiles&& (flag = ReadSrcPsiDensity(P,type,1, R->LevS->LevelNo))) {// in flag store whether stored Psis are readible or not123 if ((P->Call.ReadSrcFiles == DoReadAllSrcDensities) && (flag = ReadSrcPsiDensity(P,type,1, R->LevS->LevelNo))) {// in flag store whether stored Psis are readible or not 124 124 SpeedMeasure(P, InitSimTime, StartTimeDo); 125 125 if(P->Call.out[MinOut]) fprintf(stderr,"from source file of recent calculation\n"); … … 136 136 SpeedMeasure(P, InitSimTime, StopTimeDo); 137 137 } 138 if ((P->Call.ReadSrcFiles != 1) || (!flag)) { // read and don't minimise only if SrcPsi were parsable!138 if ((P->Call.ReadSrcFiles != DoReadAllSrcDensities) || (!flag)) { // read and don't minimise only if SrcPsi were parsable! 139 139 SpeedMeasure(P, InitSimTime, StartTimeDo); 140 140 ResetGramSchTagType(P, Psi, type, NotOrthogonal); // perturbed now shall be orthonormalized 141 if ((P->Call.ReadSrcFiles != 2) || (!flag)) {141 if ((P->Call.ReadSrcFiles != DoReadAndMinimise) || (!flag)) { 142 142 if (R->LevSNo == Lat->MaxLevel-1) { // is it the starting level? (see InitRunLevel()) 143 143 if(P->Call.out[MinOut]) fprintf(stderr, "randomly.\n"); … … 4173 4173 UpdateActualPsiNo(P, type); // step on to next perturbed one 4174 4174 fprintf(stderr, "(%i) Re-initializing perturbed psi array for type %s ", P->Par.me, R->MinimisationName[type]); 4175 if ( P->Call.ReadSrcFiles&& ReadSrcPsiDensity(P,type,1, R->LevSNo)) {4175 if ((P->Call.ReadSrcFiles == DoReadAllSrcDensities) && ReadSrcPsiDensity(P,type,1, R->LevSNo)) { 4176 4176 SpeedMeasure(P, InitSimTime, StartTimeDo); 4177 4177 fprintf(stderr,"from source file of recent calculation\n"); … … 4188 4188 SpeedMeasure(P, InitSimTime, StopTimeDo); 4189 4189 } 4190 if (P->Call.ReadSrcFiles != 1) {4190 if (P->Call.ReadSrcFiles != DoReadAllSrcDensities) { 4191 4191 SpeedMeasure(P, InitSimTime, StartTimeDo); 4192 4192 ResetGramSchTagType(P, Psi, type, NotOrthogonal); // perturbed now shall be orthonormalized 4193 if (P->Call.ReadSrcFiles != 2) {4193 if (P->Call.ReadSrcFiles != DoReadAndMinimise) { 4194 4194 if (R->LevSNo == Lat->MaxLevel-1) { // is it the starting level? (see InitRunLevel()) 4195 4195 fprintf(stderr, "randomly.\n"); -
pcp/src/run.c
rcd028d rd6f7f3 745 745 ResetBrent(P,Psi); 746 746 *Stop = 0; 747 if (P->Call.ReadSrcFiles ) {747 if (P->Call.ReadSrcFiles != DoNotParse) { 748 748 if (!ReadSrcPsiDensity(P,Occupied,1, R->LevSNo)) { // if file for level exists and desired, read from file 749 P->Call.ReadSrcFiles = 0; // -r was bogus, remove it, have to start anew749 P->Call.ReadSrcFiles = DoNotParse; // -r was bogus, remove it, have to start anew 750 750 if(P->Call.out[MinOut]) fprintf(stderr,"(%i) Re-initializing, files are missing/corrupted...\n", P->Par.me); 751 751 InitPsisValue(P, Psi->TypeStartIndex[Occupied], Psi->TypeStartIndex[Occupied+1]); // initialize perturbed array for this run … … 776 776 EnergyOutput(P,0); 777 777 } 778 if ( P->Call.ReadSrcFiles != 1) { // otherwise minimise oneself778 if ((P->Call.ReadSrcFiles != DoReadAllSrcDensities) && (P->Call.ReadSrcFiles != DoReadOccupiedSrcDensities)) { // otherwise minimise oneself 779 779 if(P->Call.out[LeaderOut]) fprintf(stderr,"(%i)Beginning minimisation of type %s ...\n", P->Par.me, R->MinimisationName[Occupied]); 780 780 while (*Stop != 1) { // loop testing condition over all Psis … … 967 967 R->OldActualLocalPsiNo = R->ActualLocalPsiNo; // reset, otherwise OldActualLocalPsiNo still points to occupied wave function 968 968 UpdateGramSchOldActualPsiNo(P,Psi); 969 if ( P->Call.ReadSrcFiles&& ReadSrcPsiDensity(P,UnOccupied,1, R->LevSNo)) {969 if ((P->Call.ReadSrcFiles == DoReadAllSrcDensities) && ReadSrcPsiDensity(P,UnOccupied,1, R->LevSNo)) { 970 970 SpeedMeasure(P, InitSimTime, StartTimeDo); 971 971 if(P->Call.out[MinOut]) fprintf(stderr, "(%i) Re-initializing %s psi array from source file of recent calculation\n", P->Par.me, R->MinimisationName[R->CurrentMin]); 972 972 ReadSrcPsiDensity(P, UnOccupied, 0, R->LevSNo); 973 if (P->Call.ReadSrcFiles != 2) {973 if (P->Call.ReadSrcFiles < DoReadAndMinimise) { 974 974 ResetGramSchTagType(P, Psi, UnOccupied, IsOrthonormal); // loaded values are orthonormal 975 975 SpeedMeasure(P, DensityTime, StartTimeDo); … … 987 987 SpeedMeasure(P, InitSimTime, StopTimeDo); 988 988 } 989 if (P->Call.ReadSrcFiles != 1) {989 if (P->Call.ReadSrcFiles != DoReadAllSrcDensities) { 990 990 SpeedMeasure(P, InitSimTime, StartTimeDo); 991 991 ResetGramSchTagType(P, Psi, UnOccupied, NotOrthogonal); … … 1086 1086 MinimiseOccupied(P, &Stop, &SuperStop); 1087 1087 if (!I->StructOpt) { 1088 if (( P->Call.ReadSrcFiles != 1) || (!ParseWannierFile(P))) { // only localize and store if they have just been minimised (hence don't come solely from file), otherwise read stored values from file (if possible)1088 if (((P->Call.ReadSrcFiles != DoReadAllSrcDensities) || (P->Call.ReadSrcFiles != DoReadOccupiedSrcDensities)) || (!ParseWannierFile(P))) { // only localize and store if they have just been minimised (hence don't come solely from file), otherwise read stored values from file (if possible) 1089 1089 SpeedMeasure(P, WannierTime, StartTimeDo); 1090 1090 ComputeMLWF(P); // localization of orbitals
Note:
See TracChangeset
for help on using the changeset viewer.