- Timestamp:
- Jun 7, 2008, 1:13:29 PM (17 years ago)
- Children:
- 02bc3c
- Parents:
- a97897
- Location:
- pcp/src
- Files:
-
- 45 edited
-
data.h (modified) (2 diffs)
-
defs.h (modified) (1 diff)
-
density.c (modified) (3 diffs)
-
density.h (modified) (1 diff)
-
energy.c (modified) (1 diff)
-
energy.h (modified) (1 diff)
-
errors.c (modified) (1 diff)
-
errors.h (modified) (1 diff)
-
excor.c (modified) (1 diff)
-
excor.h (modified) (1 diff)
-
grad.c (modified) (1 diff)
-
grad.h (modified) (1 diff)
-
gramsch.c (modified) (4 diffs)
-
gramsch.h (modified) (2 diffs)
-
helpers.c (modified) (3 diffs)
-
helpers.h (modified) (1 diff)
-
init.c (modified) (7 diffs)
-
init.h (modified) (2 diffs)
-
ions.c (modified) (3 diffs)
-
ions.h (modified) (1 diff)
-
mergesort2.c (modified) (1 diff)
-
mergesort2.h (modified) (1 diff)
-
myfft.c (modified) (2 diffs)
-
myfft.h (modified) (1 diff)
-
mymath.c (modified) (6 diffs)
-
mymath.h (modified) (3 diffs)
-
opt.c (modified) (1 diff)
-
opt.h (modified) (1 diff)
-
output.c (modified) (12 diffs)
-
output.h (modified) (1 diff)
-
parsetest.c (modified) (1 diff)
-
pcp.c (modified) (1 diff)
-
pcp.h (modified) (1 diff)
-
pdbformat.c (modified) (1 diff)
-
pdbformat.h (modified) (1 diff)
-
perturbed.c (modified) (6 diffs)
-
perturbed.h (modified) (2 diffs)
-
pseudo.c (modified) (2 diffs)
-
pseudo.h (modified) (1 diff)
-
riemann.c (modified) (2 diffs)
-
riemann.h (modified) (1 diff)
-
run.c (modified) (1 diff)
-
run.h (modified) (1 diff)
-
wannier.c (modified) (5 diffs)
-
wannier.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pcp/src/data.h
ra97897 r79290f 17 17 $Id: data.h,v 1.102 2007-02-09 09:13:48 foo Exp $ 18 18 */ 19 #include "mpi.h" 20 21 // use double precision fft when we have it 19 22 20 #ifdef HAVE_CONFIG_H 23 21 #include <config.h> 24 22 #endif 25 23 24 #include "mpi.h" 25 26 // use double precision fft when we have it 26 27 #ifdef HAVE_DFFTW_H 27 28 #include "dfftw.h" … … 149 150 }; 150 151 152 // Specifying the cast type to be read of a parameter, see ParseForParameter() 153 enum value_type { string_type, double_type, int_type, row_int, row_double, grid, lower_trigrid, upper_trigrid}; 154 155 // Specifting whether a value in the parameter file must be specified or is optional 156 enum necessity { optional, //!< parameter is optional, if not given sensible value is chosen 157 critical //!< parameter must be given or programme won't initiate 158 }; 159 151 160 152 161 #define perturbations 6 -
pcp/src/defs.h
ra97897 r79290f 16 16 $Id: defs.h,v 1.13 2007-03-29 13:35:22 foo Exp $ 17 17 */ 18 19 #ifdef HAVE_CONFIG_H 20 #include <config.h> 21 #endif 18 22 19 23 #include <float.h> -
pcp/src/density.c
ra97897 r79290f 27 27 */ 28 28 29 #ifdef HAVE_CONFIG_H 30 #include <config.h> 31 #endif 32 29 33 #include <stdlib.h> 30 34 #include <stdio.h> … … 50 54 void LockDensityArray(struct Density *Dens, enum UseType DensityType, enum complex re_im) { 51 55 enum UseType *marker; 52 if (DensityType >=0 && DensityType< MaxDensityTypes) {56 if (DensityType < MaxDensityTypes) { 53 57 if (re_im == real) 54 58 marker = &Dens->LockArray[DensityType]; … … 74 78 void UnLockDensityArray(struct Density *Dens, enum UseType DensityType, enum complex re_im) { 75 79 enum UseType *marker; 76 if (DensityType >=0 && DensityType< MaxDensityTypes) {80 if (DensityType < MaxDensityTypes) { 77 81 if (re_im == real) 78 82 marker = &Dens->LockArray[DensityType]; -
pcp/src/density.h
ra97897 r79290f 13 13 $Id: density.h,v 1.14 2006/10/16 11:09:05 foo Exp $ 14 14 */ 15 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 15 19 16 20 void InitDensity(struct Problem *const P); -
pcp/src/energy.c
ra97897 r79290f 24 24 $Id: energy.c,v 1.68 2007/02/09 09:13:48 foo Exp $ 25 25 */ 26 27 #ifdef HAVE_CONFIG_H 28 #include <config.h> 29 #endif 26 30 27 31 #include <stdlib.h> -
pcp/src/energy.h
ra97897 r79290f 13 13 $Id: energy.h,v 1.11 2007/02/05 13:49:56 foo Exp $ 14 14 */ 15 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 15 20 void CalculatePsiEnergy(struct Problem *P, const int p, const int UseInitTime); 16 21 void CalculateDensityEnergy(struct Problem *P, const int UseInitTime); -
pcp/src/errors.c
ra97897 r79290f 12 12 * 13 13 */ 14 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 14 18 15 19 #include<stdlib.h> -
pcp/src/errors.h
ra97897 r79290f 15 15 $Id: errors.h,v 1.7 2006/03/30 22:19:52 foo Exp $ 16 16 */ 17 18 #ifdef HAVE_CONFIG_H 19 #include <config.h> 20 #endif 17 21 18 22 // taken out of TREMOLO -
pcp/src/excor.c
ra97897 r79290f 27 27 $Id: excor.c,v 1.47 2007-03-29 13:37:25 foo Exp $ 28 28 */ 29 30 #ifdef HAVE_CONFIG_H 31 #include <config.h> 32 #endif 29 33 30 34 #include <stdlib.h> -
pcp/src/excor.h
ra97897 r79290f 16 16 $Id: excor.h,v 1.14 2006/05/23 14:22:05 foo Exp $ 17 17 */ 18 19 #ifdef HAVE_CONFIG_H 20 #include <config.h> 21 #endif 18 22 19 23 //! exchange and correlation energy for the polarised or unpolarised one. -
pcp/src/grad.c
ra97897 r79290f 30 30 $Id: grad.c,v 1.90 2007-03-29 13:38:04 foo Exp $ 31 31 */ 32 33 #ifdef HAVE_CONFIG_H 34 #include <config.h> 35 #endif 32 36 33 37 #include <stdlib.h> -
pcp/src/grad.h
ra97897 r79290f 19 19 20 20 21 // use double precision fft when we have it22 21 #ifdef HAVE_CONFIG_H 23 22 #include <config.h> 24 23 #endif 25 24 25 // use double precision fft when we have it 26 26 #ifdef HAVE_DFFTW_H 27 27 #include "dfftw.h" -
pcp/src/gramsch.c
ra97897 r79290f 14 14 */ 15 15 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 16 20 #include <stdlib.h> 17 21 #include <stdio.h> … … 20 24 21 25 // use double precision fft when we have it 22 #ifdef HAVE_CONFIG_H23 #include <config.h>24 #endif25 26 26 #ifdef HAVE_DFFTW_H 27 27 #include "dfftw.h" … … 723 723 * \param Type2test basically current minimisation type, see RunStruct#CurrentMin 724 724 */ 725 void TestGramSch(struct Problem *P, struct LatticeLevel *Lev, struct Psis *Psi, intType2test) {725 void TestGramSch(struct Problem *P, struct LatticeLevel *Lev, struct Psis *Psi, enum PsiTypeTag Type2test) { 726 726 double LocalSP=0.0,PsiSP; 727 727 int i,j,k,s,RecvSource; … … 872 872 } while ((NotOk != 0) && (iter < max_GramSch_iter)); 873 873 if (P->Call.out[StepLeaderOut]) { // final check if there have been any un-orthogonal pairs 874 if (Type2test != -1) {874 if (Type2test <= Extra) { 875 875 if (NotOk == 0) { 876 876 fprintf(stderr,"(%i)TestGramSchm on %s: Ok !\n",P->Par.my_color_comm_ST, P->R.MinimisationName[Type2test]); -
pcp/src/gramsch.h
ra97897 r79290f 15 15 */ 16 16 17 #ifdef HAVE_CONFIG_H 18 #include <config.h> 19 #endif 20 17 21 MPI_Datatype MPI_OnePsiElement; //!< OnePsiElement defined for the MPI structure to exchange between processes 18 22 … … 30 34 void ResetGramSch(const struct Problem *P, struct Psis *Psi); 31 35 void ResetGramSchTagType(const struct Problem *P, struct Psis *Psi, enum PsiTypeTag type, enum PsiGramSchStatusType ToDo); 32 void TestGramSch(struct Problem *P, struct LatticeLevel *Lev, struct Psis *Psi, intType2test);36 void TestGramSch(struct Problem *P, struct LatticeLevel *Lev, struct Psis *Psi, enum PsiTypeTag Type2test); 33 37 void TestForOrth(struct Problem *P, struct LatticeLevel *Lev, fftw_complex *psi); 34 38 -
pcp/src/helpers.c
ra97897 r79290f 25 25 */ 26 26 27 #ifdef HAVE_CONFIG_H 28 #include <config.h> 29 #endif 30 27 31 #include <stdlib.h> 28 32 #include <stdio.h> … … 62 66 void* Malloc(size_t size, const char* output) 63 67 { 64 void* dummy = malloc(size);68 void* dummy = (void *) malloc(size); 65 69 if (!dummy) 66 70 Error(MallocError, output); … … 74 78 */ 75 79 char* MallocString(size_t size, const char* output) { 76 int i;80 size_t i; 77 81 char *buffer; 78 buffer = Malloc(sizeof(char) * (size+1), output); // alloc82 buffer = (char *) Malloc(sizeof(char) * (size+1), output); // alloc 79 83 for (i=0;i<size;i++) // reset 80 84 buffer[i] = i % 2 == 0 ? 'p': 'c'; -
pcp/src/helpers.h
ra97897 r79290f 14 14 $Id: helpers.h,v 1.9 2007/02/09 09:13:48 foo Exp $ 15 15 */ 16 17 #ifdef HAVE_CONFIG_H 18 #include <config.h> 19 #endif 16 20 17 21 #include<stddef.h> /* fuer size_t */ -
pcp/src/init.c
ra97897 r79290f 22 22 */ 23 23 24 #ifdef HAVE_CONFIG_H 25 #include <config.h> 26 #endif 27 24 28 #include <stdlib.h> 25 29 #include <stdio.h> … … 28 32 29 33 // use double precision fft when we have it 30 #ifdef HAVE_CONFIG_H31 #include <config.h>32 #endif33 34 34 #ifdef HAVE_DFFTW_H 35 35 #include "dfftw.h" … … 1305 1305 * \sa ReadMainParameterFile Calling routine 1306 1306 */ 1307 int ParseForParameter(int verbose, FILE *file, const char *const name, int sequential, int const xth, int const yth, enum value_type type, void *value, int repetition, enum necessity critical) {1307 int ParseForParameter(int verbose, FILE *file, const char *const name, int sequential, int const xth, int const yth, enum value_type type, void *value, int repetition, enum necessity BreaksOrNot) { 1308 1308 int i,j; // loop variables 1309 1309 int me, length, maxlength = -1; … … 1326 1326 fgets(dummy1, 256, file); // Read the whole line 1327 1327 if (feof(file)) { 1328 if (( critical) && (found == 0)) {1328 if ((BreaksOrNot) && (found == 0)) { 1329 1329 Free(free_dummy, "ParseForParameter: free_dummy"); 1330 1330 Error(InitReading, name); … … 1369 1369 } else dummy = dummy1; 1370 1370 // ... and check if it is the keyword! 1371 if ((name == NULL) || ((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0) && ( dummy-dummy1== strlen(name)))) {1371 if ((name == NULL) || ((dummy-dummy1 >= 3) && (strncmp(dummy1, name, strlen(name)) == 0) && ((size_t)(dummy-dummy1) == strlen(name)))) { 1372 1372 found++; // found the parameter! 1373 1373 //fprintf(stderr,"(%i) found %s at line %i\n",me, name, line); … … 1381 1381 fgets(dummy1, 256, file); // Read the whole line, skip commentary and empty ones 1382 1382 if (feof(file)) { 1383 if (( critical) && (found == 0)) {1383 if ((BreaksOrNot) && (found == 0)) { 1384 1384 Free(free_dummy, "ParseForParameter: free_dummy"); 1385 1385 Error(InitReading, name); … … 1435 1435 dummy = strchr(dummy1, '\n'); // ... at line end then 1436 1436 if ((i < xth-1) && (type < 4)) { // check if xth value or not yet 1437 if ( critical) {1437 if (BreaksOrNot) { 1438 1438 if (verbose) fprintf(stderr,"(%i)Error: EoL or comment at %i and still missing %i value(s) for parameter %s\n", me, line, yth-j, name); 1439 1439 Free(free_dummy, "ParseForParameter: free_dummy"); -
pcp/src/init.h
ra97897 r79290f 17 17 */ 18 18 19 // Specifting whether a value in the parameter file must be specified or is optional 20 enum necessity { optional, //!< parameter is optional, if not given sensible value is chosen 21 critical //!< parameter must be given or programme won't initiate 22 }; 23 24 // Specifying the cast type to be read of a parameter, see ParseForParameter() 25 enum value_type { string_type, double_type, int_type, row_int, row_double, grid, lower_trigrid, upper_trigrid}; 19 #ifdef HAVE_CONFIG_H 20 #include <config.h> 21 #endif 26 22 27 23 /* Bereite mainname vor: loescht von filename von rechts nach links bis zu erstem "/" oder ganz */ … … 37 33 void InitPsisValue(struct Problem *const P, int start, int end); 38 34 39 /** Calculate the value \a x to the power of \a n.40 * \param x value41 * \param n power42 * \return \f$x^n\f$43 */44 static inline double tpow(double x, int n)45 {46 double y = 1;47 int neg = (n < 0);48 49 if (neg) n = -n;50 51 while (n) { // go through every bit of the integer number n52 if (n & 1) y *= x; // if bit set, multiply53 x *= x; // go to next power of 254 n >>= 1; // and to the next bit55 }56 return neg ? 1.0/y : y; // if n was negative, return reciprocal value57 }58 35 #endif 59 36 -
pcp/src/ions.c
ra97897 r79290f 23 23 */ 24 24 25 #ifdef HAVE_CONFIG_H 26 #include <config.h> 27 #endif 28 25 29 #include <stdlib.h> 26 30 #include <stdio.h> … … 32 36 #include "mymath.h" 33 37 34 35 38 // use double precision fft when we have it 36 #ifdef HAVE_CONFIG_H37 #include <config.h>38 #endif39 40 39 #ifdef HAVE_DFFTW_H 41 40 #include "dfftw.h" … … 144 143 I->Thermostat = None; 145 144 } 146 } 147 if (I->Thermostat == -1) { 145 } else { 148 146 if (P->Par.me == 0) 149 147 fprintf(stderr,"(%i) Warning: thermostat name was not understood!\n", P->Par.me); -
pcp/src/ions.h
ra97897 r79290f 20 20 21 21 22 // use double precision fft when available23 22 #ifdef HAVE_CONFIG_H 24 23 #include <config.h> 25 24 #endif 26 25 26 // use double precision fft when available 27 27 #ifdef HAVE_DFFTW_H 28 28 #include "dfftw.h" -
pcp/src/mergesort2.c
ra97897 r79290f 26 26 27 27 */ 28 29 #ifdef HAVE_CONFIG_H 30 #include <config.h> 31 #endif 28 32 29 33 #include<stdlib.h> -
pcp/src/mergesort2.h
ra97897 r79290f 25 25 */ 26 26 27 #ifdef HAVE_CONFIG_H 28 #include <config.h> 29 #endif 30 27 31 #include<stdlib.h> 28 32 -
pcp/src/myfft.c
ra97897 r79290f 18 18 */ 19 19 20 #ifdef HAVE_CONFIG_H 21 #include <config.h> 22 #endif 23 20 24 #include<stdlib.h> 21 25 #include<stdio.h> … … 25 29 26 30 // use double precision fft when we have it 27 #ifdef HAVE_CONFIG_H28 #include <config.h>29 #endif30 31 31 #ifdef HAVE_DFFTW_H 32 32 #include "dfftw.h" -
pcp/src/myfft.h
ra97897 r79290f 16 16 */ 17 17 18 // use double precision fft when we have it19 18 #ifdef HAVE_CONFIG_H 20 19 #include <config.h> 21 20 #endif 22 21 22 // use double precision fft when we have it 23 23 #ifdef HAVE_DFFTW_H 24 24 #include "dfftw.h" -
pcp/src/mymath.c
ra97897 r79290f 21 21 */ 22 22 23 #ifdef HAVE_CONFIG_H 24 #include <config.h> 25 #endif 26 23 27 #include<stdlib.h> 24 28 #include<stdio.h> … … 29 33 30 34 // use double precision fft when we have it 31 #ifdef HAVE_CONFIG_H32 #include <config.h>33 #endif34 35 35 #ifdef HAVE_DFFTW_H 36 36 #include "dfftw.h" … … 338 338 * \note formula and coefficients are taken from "Numerical Receipes in C" 339 339 */ 340 static double gammln(double xx) { 340 #ifdef HAVE_INLINE 341 inline double gammln(double xx) 342 #else 343 double gammln(double xx) 344 #endif 345 { 341 346 int j; 342 347 double x,tmp,ser; … … 361 366 * \warning maximum precision 1e-7 362 367 */ 363 static double gser(double a, double x) { 368 #ifdef HAVE_INLINE 369 inline double gser(double a, double x) 370 #else 371 double gser(double a, double x) 372 #endif 373 { 364 374 double gln = gammln(a); 365 375 double ap,sum,del; … … 389 399 * \note formula and coefficients are taken from "Numerical Receipes in C" 390 400 */ 391 static double gcf(double a, double x) { 401 #ifdef HAVE_INLINE 402 inline double gcf(double a, double x) 403 #else 404 double gcf(double a, double x) 405 #endif 406 { 392 407 double gln = gammln(a); 393 408 double gold = 0.0; … … 429 444 * \note formula and coefficients are taken from "Numerical Receipes in C" 430 445 */ 431 static double gammp(double a, double x) { 446 #ifdef HAVE_INLINE 447 inline double gammp(double a, double x) 448 #else 449 double gammp(double a, double x) 450 #endif 451 { 432 452 double res; 433 453 if (x < a+1.) { -
pcp/src/mymath.h
ra97897 r79290f 20 20 */ 21 21 22 // use double precision fft when we have it23 22 #ifdef HAVE_CONFIG_H 24 23 #include <config.h> … … 39 38 #include "defs.h" 40 39 40 // use double precision fft when we have it 41 41 #ifdef HAVE_DFFTW_H 42 42 #include "dfftw.h" … … 60 60 #define CNORMSQ3(a) ((a).re[0]*(a).re[0] + (a).re[1]*(a).re[1] + (a).re[2]*(a).re[2] + (a).im[0]*(a).im[0] + (a).im[1]*(a).im[1] + (a).im[2]*(a).im[2]) //!< square of complex euclidian norm 61 61 62 inline int Rest(int n, int m); 63 inline void RTranspose3(double *A); 64 inline void RMatMat33(double C[NDIM*NDIM], const double A[NDIM*NDIM], const double B[NDIM*NDIM]); 65 inline void RMat33Vec3(double C[NDIM], const double M[NDIM*NDIM], const double V[NDIM]); 66 inline int RMatReci3(double B[NDIM_NDIM], const double A[NDIM_NDIM]); 67 inline void RVec3Mat33(double C[NDIM], const double V[NDIM], const double M[NDIM*NDIM]); 68 inline void VP3(double V[NDIM], double A[NDIM], double B[NDIM]); 69 /* Skalarprodukt */ 70 inline double SP(const double *a, const double *b, const int n); 71 /* Multiplikation mit Skalar */ 72 inline void SM(double *a, const double c, const int n); 73 /* Nullvektor erzeugen */ 74 inline void NV(double *a, int n); 75 inline double dSum(int n, double *dx, int incx); 76 inline double Simps(int n, double *f, double h); 77 inline double derf(double x); 78 /* Initialisiere a array[3] mit b - c Orte mit periodisch */ 62 #ifdef HAVE_INLINE 63 inline double tpow(double x, int n); 64 inline int Rest(int n, int m); 65 inline void RTranspose3(double *A); 66 inline void RMatMat33(double C[NDIM*NDIM], const double A[NDIM*NDIM], const double B[NDIM*NDIM]); 67 inline void RMat33Vec3(double C[NDIM], const double M[NDIM*NDIM], const double V[NDIM]); 68 inline int RMatReci3(double B[NDIM_NDIM], const double A[NDIM_NDIM]); 69 inline void RVec3Mat33(double C[NDIM], const double V[NDIM], const double M[NDIM*NDIM]); 70 inline void VP3(double V[NDIM], double A[NDIM], double B[NDIM]); 71 /* Skalarprodukt */ 72 inline double SP(const double *a, const double *b, const int n); 73 /* Multiplikation mit Skalar */ 74 inline void SM(double *a, const double c, const int n); 75 /* Nullvektor erzeugen */ 76 inline void NV(double *a, int n); 77 inline double dSum(int n, double *dx, int incx); 78 inline double Simps(int n, double *f, double h); 79 inline void SetArrayToDouble0(double *a, int n); 80 /* Gamma functions */ 81 inline double gammln(double xx); 82 inline double gser(double a, double x); 83 inline double gcf(double a, double x); 84 inline double gammp(double a, double x); 85 inline double derf(double x); 86 #else 87 double tpow(double x, int n); 88 int Rest(int n, int m); 89 void RTranspose3(double *A); 90 void RMatMat33(double C[NDIM*NDIM], const double A[NDIM*NDIM], const double B[NDIM*NDIM]); 91 void RMat33Vec3(double C[NDIM], const double M[NDIM*NDIM], const double V[NDIM]); 92 int RMatReci3(double B[NDIM_NDIM], const double A[NDIM_NDIM]); 93 void RVec3Mat33(double C[NDIM], const double V[NDIM], const double M[NDIM*NDIM]); 94 void VP3(double V[NDIM], double A[NDIM], double B[NDIM]); 95 /* Skalarprodukt */ 96 double SP(const double *a, const double *b, const int n); 97 /* Multiplikation mit Skalar */ 98 void SM(double *a, const double c, const int n); 99 /* Nullvektor erzeugen */ 100 void NV(double *a, int n); 101 double dSum(int n, double *dx, int incx); 102 double Simps(int n, double *f, double h); 103 void SetArrayToDouble0(double *a, int n); 104 /* Gamma functions */ 105 double gammln(double xx); 106 double gser(double a, double x); 107 double gcf(double a, double x); 108 double gammp(double a, double x); 109 double derf(double x); 110 #endif 111 112 /* Initialisiere a array[3] mit b - c Orte mit periodisch */ 79 113 double Dist(const double *a, const double *b, const int n); 80 inline void SetArrayToDouble0(double *a, int n);81 114 void PrintCMat330(fftw_complex M[NDIM_NDIM]); 82 115 void PrintRMat330(fftw_real M[NDIM_NDIM]); -
pcp/src/opt.c
ra97897 r79290f 11 11 * $Id: opt.c,v 1.15 2007-02-12 09:44:56 foo Exp $ 12 12 */ 13 14 #ifdef HAVE_CONFIG_H 15 #include <config.h> 16 #endif 13 17 14 18 #include<stdio.h> -
pcp/src/opt.h
ra97897 r79290f 14 14 */ 15 15 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 16 20 void GetOptions(struct CallOptions *Call, int argc, char *const argv[]); 17 21 /* parsen der Kommandozeile */ -
pcp/src/output.c
ra97897 r79290f 30 30 $Id: output.c,v 1.51.2.2 2007-04-21 12:55:50 foo Exp $ 31 31 */ 32 33 #ifdef HAVE_CONFIG_H 34 #include <config.h> 35 #endif 36 32 37 #include<stdlib.h> 33 38 #include<stdio.h> … … 310 315 int OutputSrcPsiDensity(struct Problem *P, enum PsiTypeTag type) 311 316 { 312 int i,j,k, Index, zahl, owner; 317 int i,j,k, Index, owner; 318 size_t zahl; 313 319 struct Lattice *Lat = &P->Lat; 314 320 //struct RunStruct *R = &P->R; … … 414 420 Error(SomeError, "OutputSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 415 421 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 416 if (zahl != LevS->Dens->LocalSizeR) // check number of elements422 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 417 423 fprintf(stderr,"(%i)OutputSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, i, zahl, LevS->Dens->LocalSizeR); 418 424 //else … … 423 429 Error(SomeError, "OutputSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 424 430 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 425 if (zahl != LevS->Dens->LocalSizeR) // check number of elements431 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 426 432 fprintf(stderr,"(%i)OutputSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, i, zahl, LevS->Dens->LocalSizeR); 427 433 //else … … 445 451 Error(SomeError, "OutputSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 446 452 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 447 if (zahl != LevS->Dens->LocalSizeR) // check number of elements453 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 448 454 fprintf(stderr,"(%i)OutputSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, owner, zahl, LevS->Dens->LocalSizeR); 449 455 //else … … 570 576 int N[NDIM], GlobalNo[2]; 571 577 int LevelNo, readnr=0; 572 int zahl, signal = test ? 1 : 2; // 0 - ok, 1 - test failed, 2 - throw Error 578 int breaksignal = test ? 1 : 2; // 0 - ok, 1 - test failed, 2 - throw Error 579 size_t zahl; 573 580 char suffixdat[MAXSTRINGSIZE], suffixdoc[MAXSTRINGSIZE]; 574 int read_type, Num = 0, colorNo = 0; 581 int Num = 0, colorNo = 0; 582 enum PsiTypeTag read_type; 575 583 char spin[20]; 576 584 double Eps[2]; … … 611 619 debug(P,"ReadSrcPsiDensity: doc file pointer NULL\n"); 612 620 if (test) { 613 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)621 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 614 622 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 615 623 return 0; 616 624 } 617 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)625 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 618 626 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 619 627 Error(SomeError,"ReadSrcPsiDensity: cannot open doc file!"); … … 635 643 fclose(SrcPsiDoc); 636 644 if (test) { 637 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)645 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 638 646 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 639 647 return 0; 640 648 } 641 649 fprintf(stderr,"ReadSrcPsiDensity: Only %i items read!\n",readnr); 642 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)650 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 643 651 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 644 652 Error(SomeError, "ReadSrcPsiDensity: read error"); … … 649 657 fclose(SrcPsiDoc); 650 658 if (test) { 651 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)659 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 652 660 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 653 661 return 0; 654 662 } 655 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)663 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 656 664 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 657 665 Error(SomeError,"ReadSrcPsiDensity: Mismatching levels!"); … … 666 674 if (test) { 667 675 fprintf(stderr,"(%i) Min\t N(x,y,z)\tPsiNo+AddNo\n file: %s\t %i %i %i\t %i + %i\nsystem: %s\t %d %d %d\t %d + %d\n",P->Par.me, R->MinimisationName[read_type], N[0], N[1], N[2], GlobalNo[0], GlobalNo[1], R->MinimisationName[R->CurrentMin], LevS->N[0] , LevS->N[1], LevS->N[2], Lat->Psi.GlobalNo[PsiMaxNoDouble], Lat->Psi.GlobalNo[PsiMaxAdd]); 668 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)676 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 669 677 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 670 678 return 0; 671 679 } 672 680 fprintf(stderr,"ReadSrcPsiDensity: Type %i != CurrentMin %i || N[0] %i != %i || N[1] %i != %i || N[2] %i != %i || %s %i + %i != %i + %i\n", read_type, R->CurrentMin, N[0], LevS->N[0], N[1], LevS->N[1], N[2], LevS->N[2], spin, GlobalNo[0], GlobalNo[1], Num, P->Lat.Psi.GlobalNo[PsiMaxAdd]); 673 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)681 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 674 682 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 675 683 Error(SomeError,"ReadSrcPsiDensity: srcpsi file does not fit to system"); 676 684 } 677 signal = 0; // everything went alright, signal ok678 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)685 breaksignal = 0; // everything went alright, signal ok 686 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 679 687 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 680 688 } else { // others wait for signal from root process 681 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)689 if (MPI_Bcast(&breaksignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 682 690 Error(SomeError,"ReadSrcPsiDensity: Bcast of signal failed\n"); 683 if ( signal == 1)691 if (breaksignal == 1) 684 692 return 0; 685 else if ( signal == 2)693 else if (breaksignal == 2) 686 694 Error(SomeError, "ReadSrcPsiDensity: Something went utterly wrong, see root process"); 687 695 else if (P->Call.out[PsiOut]) … … 748 756 Error(SomeError, "ReadSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 749 757 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 750 if (zahl != LevS->Dens->LocalSizeR) // check number of elements758 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 751 759 fprintf(stderr,"(%i)ReadSrcPsiDensity: MPI_Recv from process 0 of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, owner, zahl, LevS->Dens->LocalSizeR); 752 760 //else … … 766 774 Error(SomeError, "ReadSrcPsiDensity: MPI_Recv of loaded coefficients failed!"); 767 775 MPI_Get_count(&status, MPI_DOUBLE, &zahl); 768 if (zahl != LevS->Dens->LocalSizeR) // check number of elements776 if (zahl != (size_t)LevS->Dens->LocalSizeR) // check number of elements 769 777 fprintf(stderr,"(%i)ReadSrcPsiDensity: MPI_Recv of loaded coefficients of GlobalNo %i, owner %i failed: Too few coefficients - %i instead of %i!\n", P->Par.me, k, P->Par.me_comm_ST_Psi, zahl, LevS->Dens->LocalSizeR); 770 778 //else -
pcp/src/output.h
ra97897 r79290f 14 14 $Id: output.h,v 1.17.2.1 2007-04-21 12:55:50 foo Exp $ 15 15 */ 16 17 #ifdef HAVE_CONFIG_H 18 #include <config.h> 19 #endif 16 20 17 21 static const char suffixdensdat[] = ".density.data"; //!< Suffix for density data file -
pcp/src/parsetest.c
ra97897 r79290f 1 1 //#include "init.h" 2 3 #ifdef HAVE_CONFIG_H 4 #include <config.h> 5 #endif 6 2 7 #include <stdio.h> 3 4 enum value_type { string_type, double_type, int_type, grid, lower_trigrid, upper_trigrid}; //!< Specifying the type to be read of a parameter 5 8 #include "data.h" 6 9 7 10 /** Reads parameter from a parsed file. -
pcp/src/pcp.c
ra97897 r79290f 517 517 * © 2006 Frederik Heber 518 518 */ 519 520 #ifdef HAVE_CONFIG_H 521 #include <config.h> 522 #endif 519 523 520 524 #include<signal.h> -
pcp/src/pcp.h
ra97897 r79290f 15 15 $Id: pcp.h,v 1.6 2006/03/30 22:19:51 foo Exp $ 16 16 */ 17 18 #ifdef HAVE_CONFIG_H 19 #include <config.h> 20 #endif 21 17 22 #include <signal.h> 18 23 -
pcp/src/pdbformat.c
ra97897 r79290f 4 4 $Id: pdbformat.c,v 1.9 2006/03/30 22:19:52 foo Exp $ 5 5 */ 6 7 #ifdef HAVE_CONFIG_H 8 #include <config.h> 9 #endif 6 10 7 11 #include<stdio.h> -
pcp/src/pdbformat.h
ra97897 r79290f 14 14 */ 15 15 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 16 20 int WritePDBLine(FILE *f, unsigned id, const char* atomname, const char* residuename, 17 21 unsigned residuenr, double x, double y, double z, -
pcp/src/perturbed.c
ra97897 r79290f 37 37 38 38 */ 39 40 #ifdef HAVE_CONFIG_H 41 #include <config.h> 42 #endif 39 43 40 44 #include <stdlib.h> … … 354 358 struct RunStruct *R = &P->R; 355 359 struct LatticeLevel *LevS = R->LevS; 356 const intstate = R->CurrentMin;360 const enum PsiTypeTag state = R->CurrentMin; 357 361 const int l_normal = Psi->TypeStartIndex[Occupied] + (l - Psi->TypeStartIndex[state]); // offset l to \varphi_l^{(0)} 358 362 const int ActNum = l - Psi->TypeStartIndex[state] + Psi->TypeStartIndex[1] * Psi->LocalPsiStatus[l].my_color_comm_ST_Psi; … … 1456 1460 double result = 0., E0 = 0., Elambda = 0., E1 = 0.;//, E2 = 0.; 1457 1461 int i,m,j; 1458 const intstate = R->CurrentMin;1462 const enum PsiTypeTag state = R->CurrentMin; 1459 1463 //const int l_normal = R->ActualLocalPsiNo - Psi->TypeStartIndex[state] + Psi->TypeStartIndex[Occupied]; 1460 1464 const int ActNum = R->ActualLocalPsiNo - Psi->TypeStartIndex[state] + Psi->TypeStartIndex[1] * Psi->LocalPsiStatus[R->ActualLocalPsiNo].my_color_comm_ST_Psi; … … 1665 1669 * \note Continuous Set of Damped Gauge Transformations according to Keith and Bader 1666 1670 */ 1667 #ifdef HAVE_INLINE1668 inline double ShiftGaugeOrigin(struct Problem *P, double r[NDIM], const int index)1669 #else1670 1671 double ShiftGaugeOrigin(struct Problem *P, double r[NDIM], const int index) 1671 #endif1672 1672 { 1673 1673 struct Ions *I = &P->Ion; … … 1760 1760 * \return linearly interpolated value of \a *grid for position \a R[NDIM] 1761 1761 */ 1762 double LinearInterpolationBetweenGrid(struct Problem *P, struct Lattice *Lat, struct LatticeLevel *Lev, double R[NDIM], fftw_real * grid)1762 double LinearInterpolationBetweenGrid(struct Problem *P, struct Lattice *Lat, struct LatticeLevel *Lev, double R[NDIM], fftw_real *fftgrid) 1763 1763 { 1764 1764 double x[2][NDIM]; … … 1788 1788 if ((k[g][0] >= N0*myPE) && (k[g][0] < N0*(myPE+1))) { 1789 1789 //fprintf(stderr,"(%i) grid[%i]: sigma = %e\n", P->Par.me, k[g][2]+N[2]*(k[g][1]+N[1]*(k[g][0]-N0*myPE)), sigma); 1790 sigma += (x[g][0]*x[0][1]*x[0][2])* grid[k[0][2]+N[2]*(k[0][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft1790 sigma += (x[g][0]*x[0][1]*x[0][2])*fftgrid[k[0][2]+N[2]*(k[0][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft 1791 1791 //fprintf(stderr,"(%i) grid[%i]: sigma += %e * %e \n", P->Par.me, k[g][2]+N[2]*(k[g][1]+N[1]*(k[g][0]-N0*myPE)), (x[g][0]*x[0][1]*x[0][2]), grid[k[0][2]+N[2]*(k[0][1]+N[1]*(k[g][0]-N0*myPE))]*mu0); 1792 sigma += (x[g][0]*x[0][1]*x[1][2])* grid[k[1][2]+N[2]*(k[0][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft1792 sigma += (x[g][0]*x[0][1]*x[1][2])*fftgrid[k[1][2]+N[2]*(k[0][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft 1793 1793 //fprintf(stderr,"(%i) grid[%i]: sigma += %e * %e \n", P->Par.me, k[g][2]+N[2]*(k[g][1]+N[1]*(k[g][0]-N0*myPE)), (x[g][0]*x[0][1]*x[1][2]), grid[k[1][2]+N[2]*(k[0][1]+N[1]*(k[g][0]-N0*myPE))]*mu0); 1794 sigma += (x[g][0]*x[1][1]*x[0][2])* grid[k[0][2]+N[2]*(k[1][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft1794 sigma += (x[g][0]*x[1][1]*x[0][2])*fftgrid[k[0][2]+N[2]*(k[1][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft 1795 1795 //fprintf(stderr,"(%i) grid[%i]: sigma += %e * %e \n", P->Par.me, k[g][2]+N[2]*(k[g][1]+N[1]*(k[g][0]-N0*myPE)), (x[g][0]*x[1][1]*x[0][2]), grid[k[0][2]+N[2]*(k[1][1]+N[1]*(k[g][0]-N0*myPE))]*mu0); 1796 sigma += (x[g][0]*x[1][1]*x[1][2])* grid[k[1][2]+N[2]*(k[1][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft1796 sigma += (x[g][0]*x[1][1]*x[1][2])*fftgrid[k[1][2]+N[2]*(k[1][1]+N[1]*(k[g][0]-N0*myPE))]*mu0; // if it's local and factor from inverse fft 1797 1797 //fprintf(stderr,"(%i) grid[%i]: sigma += %e * %e \n", P->Par.me, k[g][2]+N[2]*(k[g][1]+N[1]*(k[g][0]-N0*myPE)), (x[g][0]*x[1][1]*x[1][2]), grid[k[1][2]+N[2]*(k[1][1]+N[1]*(k[g][0]-N0*myPE))]*mu0); 1798 1798 } -
pcp/src/perturbed.h
ra97897 r79290f 12 12 13 13 */ 14 15 #ifdef HAVE_CONFIG_H 16 #include <config.h> 17 #endif 14 18 15 19 … … 36 40 void OutputOrbitalPositions(struct Problem *P, const enum PsiTypeTag type); 37 41 void fft_Psi(struct Problem *P, const fftw_complex *Psi, fftw_real *PsiR, const int index, const int symmetry); 38 inline int cross(const int i, const int j);39 inline int crossed(int i, int j);40 42 void AllocCurrentDensity(struct Density *Dens0); 41 43 void DisAllocCurrentDensity(struct Density *Dens0); 42 44 void PlotVectorPlane(struct Problem *P, int B_Index, int n_orth); 43 45 void ReadSrcPerturbedPsis(struct Problem *P, enum PsiTypeTag type); 44 inline double ShiftGaugeOrigin(struct Problem *P, double r[NDIM], const int index); 45 inline double sawtooth(struct Lattice *Lat, double L[NDIM], const int index); 46 inline void MinImageConv(struct Lattice *Lat, const double R[NDIM], const double r[NDIM], double *result); 46 double ShiftGaugeOrigin(struct Problem *P, double r[NDIM], const int index); 47 #ifdef HAVE_INLINE 48 inline double sawtooth(struct Lattice *Lat, double L[NDIM], const int index); 49 inline void MinImageConv(struct Lattice *Lat, const double R[NDIM], const double r[NDIM], double *result); 50 inline int cross(const int i, const int j); 51 inline int crossed(int i, int j); 52 #else 53 double sawtooth(struct Lattice *Lat, double L[NDIM], const int index); 54 void MinImageConv(struct Lattice *Lat, const double R[NDIM], const double r[NDIM], double *result); 55 int cross(const int i, const int j); 56 int crossed(int i, int j); 57 #endif 47 58 void test_fft_symmetry(struct Problem *P, const int l); 48 59 void test_rxp(struct Problem *P); -
pcp/src/pseudo.c
ra97897 r79290f 23 23 */ 24 24 25 #ifdef HAVE_CONFIG_H 26 #include <config.h> 27 #endif 28 25 29 #include <stdlib.h> 26 30 #include <stdio.h> … … 29 33 #include <string.h> 30 34 31 32 35 // use double precision fft when we have it 33 #ifdef HAVE_CONFIG_H34 #include <config.h>35 #endif36 37 36 #ifdef HAVE_DFFTW_H 38 37 #include "dfftw.h" -
pcp/src/pseudo.h
ra97897 r79290f 17 17 18 18 19 // use double precision fft when we have it20 19 #ifdef HAVE_CONFIG_H 21 20 #include <config.h> 22 21 #endif 23 22 23 // use double precision fft when we have it 24 24 #ifdef HAVE_DFFTW_H 25 25 #include "dfftw.h" -
pcp/src/riemann.c
ra97897 r79290f 11 11 $Id: riemann.c,v 1.8 2006/03/30 22:19:52 foo Exp $ 12 12 */ 13 14 #ifdef HAVE_CONFIG_H 15 #include <config.h> 16 #endif 13 17 14 18 #include <stdlib.h> … … 440 444 fft_3d_complex_to_real(plan, LevS->LevelNo, (int)FFTNFSVecUp, RTAC[RTAA], work); 441 445 RiemannRTransformPos(LevS, RTAR[RTAA], workR, NFields[RTAA]); 442 /* All RTA Žs in R*/446 /* All RTAᅵs in R*/ 443 447 for (i=0; i < LocalSizeR[RTAIRT]; i++) { 444 448 destDet[i] = 1./RDET3(&srcRT[NDIM_NDIM*i]); -
pcp/src/riemann.h
ra97897 r79290f 14 14 */ 15 15 16 #ifdef HAVE_CONFIG_H 17 #include <config.h> 18 #endif 19 16 20 void CalculateRiemannLaplaceS(const struct Lattice *Lat, struct RiemannTensor *RT, fftw_complex *src, fftw_complex *Lap/*, const double FactorC_R, const double FactorR_C*/); 17 21 void CalculateRiemannLaplace0(const struct Lattice *Lat, struct RiemannTensor *RT, fftw_complex *src, fftw_complex *Lap/*, const double FactorC_R, const double FactorR_C*/); -
pcp/src/run.c
ra97897 r79290f 22 22 $Id: run.c,v 1.101.2.2 2007-04-21 13:01:13 foo Exp $ 23 23 */ 24 25 #ifdef HAVE_CONFIG_H 26 #include <config.h> 27 #endif 24 28 25 29 #include <signal.h> -
pcp/src/run.h
ra97897 r79290f 16 16 $Id: run.h,v 1.42 2007/02/09 09:37:29 foo Exp $ 17 17 */ 18 19 #ifdef HAVE_CONFIG_H 20 #include <config.h> 21 #endif 22 18 23 19 24 #define RUNMAXOLD 2 //!< store this many old values of relative kinetic and total energ in RunStruct -
pcp/src/wannier.c
ra97897 r79290f 14 14 $Id: wannier.c,v 1.7 2007-10-12 15:50:38 heber Exp $ 15 15 */ 16 17 #ifdef HAVE_CONFIG_H 18 #include <config.h> 19 #endif 16 20 17 21 #include <math.h> … … 1975 1979 double WannierCentre[NDIM+1]; // combined centre and spread 1976 1980 MPI_Status status; 1977 int signal = 0; // 1 - ok, 0 - error1981 int errorsignal = 0; // 1 - ok, 0 - error 1978 1982 1979 1983 switch (Lat->Psi.PsiST) { … … 1993 1997 tagname = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "ParseWannierFile: *tagname"); 1994 1998 if(!OpenFile(P, &SpreadFile, suffix, "r", P->Call.out[ReadOut])) { // check if file exists 1995 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)1999 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 1996 2000 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 1997 2001 return 0; 1998 2002 //Error(SomeError,"ParseWannierFile: Opening failed\n"); 1999 2003 } 2000 signal = 1;2001 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)2004 errorsignal = 1; 2005 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 2002 2006 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 2003 2007 } else { 2004 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)2008 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 2005 2009 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 2006 if ( signal == 0)2010 if (errorsignal == 0) 2007 2011 return 0; 2008 2012 } … … 2014 2018 if (P->Par.me_comm_ST == 0) { // only process 0 may access the spread file 2015 2019 sprintf(tagname,"Psi%d_Lev%d",i,R->LevSNo); 2016 signal = 0;2020 errorsignal = 0; 2017 2021 if (!ParseForParameter(0,SpreadFile,tagname,0,3,1,row_double,WannierCentre,1,optional)) { 2018 2022 //Error(SomeError,"ParseWannierFile: Parsing WannierCentre failed"); 2019 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)2023 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 2020 2024 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 2021 2025 return 0; … … 2023 2027 if (!ParseForParameter(0,SpreadFile,tagname,0,4,1,double_type,&WannierCentre[NDIM],1,optional)) { 2024 2028 //Error(SomeError,"ParseWannierFile: Parsing WannierSpread failed"); 2025 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)2029 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 2026 2030 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 2027 2031 return 0; 2028 2032 } 2029 signal = 1;2030 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)2033 errorsignal = 1; 2034 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 2031 2035 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 2032 2036 } else { 2033 if (MPI_Bcast(& signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)2037 if (MPI_Bcast(&errorsignal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS) 2034 2038 Error(SomeError,"ParseWannierFile: Bcast of signal failed\n"); 2035 if ( signal == 0)2039 if (errorsignal == 0) 2036 2040 return 0; 2037 2041 } -
pcp/src/wannier.h
ra97897 r79290f 14 14 $Id: wannier.h,v 1.3 2007-10-08 15:43:29 heber Exp $ 15 15 */ 16 17 #ifdef HAVE_CONFIG_H 18 #include <config.h> 19 #endif 16 20 17 21 #include <gsl/gsl_complex.h>
Note:
See TracChangeset
for help on using the changeset viewer.
