Changeset c510a7
- Timestamp:
- Apr 29, 2008, 12:19:51 PM (17 years ago)
- Children:
- e936b3
- Parents:
- 307fd1
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r307fd1 rc510a7 691 691 void SaveConfig(char *ConfigFileName, config *configuration, periodentafel *periode, molecule *mol) 692 692 { 693 char filename[ 255];693 char filename[MAXSTRINGSIZE]; 694 694 ofstream output; 695 695 … … 752 752 ofstream output; 753 753 string line; 754 char filename[ 255];754 char filename[MAXSTRINGSIZE]; 755 755 char *ConfigFileName = NULL; 756 756 char *ElementsFileName = NULL; -
molecuilder/src/config.cpp
r307fd1 rc510a7 13 13 config::config() 14 14 { 15 mainname = (char *) MallocString(sizeof(char)* 255,"config constructor: mainname");16 defaultpath = (char *) MallocString(sizeof(char)* 255,"config constructor: mainname");17 pseudopotpath = (char *) MallocString(sizeof(char)* 255,"config constructor: mainname");18 configpath = (char *) MallocString(sizeof(char)* 255,"config constructor: mainname");19 configname = (char *) MallocString(sizeof(char)* 255,"config constructor: mainname");15 mainname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 16 defaultpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 17 pseudopotpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 18 configpath = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 19 configname = (char *) MallocString(sizeof(char)*MAXSTRINGSIZE,"config constructor: mainname"); 20 20 strcpy(mainname,"pcp"); 21 21 strcpy(defaultpath,"not specified"); … … 414 414 char *ptr = NULL; 415 415 int last = -1; 416 for(int i=0;i< 255;i++) {416 for(int i=0;i<MAXSTRINGSIZE;i++) { 417 417 if (filename[i] == '/') 418 418 last = i; … … 1168 1168 case(string_type): 1169 1169 if (value != NULL) { 1170 if (maxlength == -1) maxlength = strlen((char *)value); // get maximum size of string array 1170 //if (maxlength == -1) maxlength = strlen((char *)value); // get maximum size of string array 1171 maxlength = MAXSTRINGSIZE; 1171 1172 length = maxlength > (dummy-dummy1) ? (dummy-dummy1) : maxlength; // cap at maximum 1172 1173 strncpy((char *)value, dummy1, length); // copy as much -
molecuilder/src/defs.hpp
r307fd1 rc510a7 37 37 enum value_type { string_type, double_type, int_type, row_int, row_double, grid, lower_trigrid, upper_trigrid}; 38 38 39 // maximum length of any char array 40 #define MAXSTRINGSIZE 255 41 39 42 // various standard filenames 40 43 #define DEFAULTCONFIG "main_pcp_linux" -
molecuilder/src/moleculelist.cpp
r307fd1 rc510a7 304 304 { 305 305 ofstream outputFragment; 306 char FragmentName[ 255];307 char PathBackup[ 255];306 char FragmentName[MAXSTRINGSIZE]; 307 char PathBackup[MAXSTRINGSIZE]; 308 308 bool result = true; 309 309 bool intermediateResult = true; 310 310 atom *Walker = NULL; 311 311 vector BoxDimension; 312 char TEFilename[ 255];312 char TEFilename[MAXSTRINGSIZE]; 313 313 char *FragmentNumber; 314 314 int FragmentCounter = 0; -
molecuilder/src/molecules.cpp
r307fd1 rc510a7 1892 1892 ifstream KeySetFile; 1893 1893 stringstream line; 1894 char *filename = (char *) Malloc(sizeof(char)* 255, "molecule::ParseKeySetFile - filename");1894 char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - filename"); 1895 1895 1896 1896 if (FragmentList != NULL) { // check list pointer … … 1905 1905 // each line represents a new fragment 1906 1906 int NumberOfFragments = 0; 1907 char *buffer = (char *) Malloc(sizeof(char)* 255, "molecule::ParseKeySetFile - *buffer");1907 char *buffer = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::ParseKeySetFile - *buffer"); 1908 1908 // 1. scan through file to know number of fragments 1909 1909 while (!KeySetFile.eof()) { 1910 KeySetFile.getline(buffer, 255);1910 KeySetFile.getline(buffer, MAXSTRINGSIZE); 1911 1911 if (strlen(buffer) > 0) // there is at least on possible number on the parsed line 1912 1912 NumberOfFragments++; … … 1919 1919 NumberOfFragments = 0; 1920 1920 while ((!KeySetFile.eof()) && (FragmentList->NumberOfMolecules > NumberOfFragments)) { 1921 KeySetFile.getline(buffer, 255);1921 KeySetFile.getline(buffer, MAXSTRINGSIZE); 1922 1922 KeySet CurrentSet; 1923 1923 if ((strlen(buffer) > 0) && (ScanBufferIntoKeySet(out, buffer, CurrentSet))) // if at least one valid atom was added, write config … … 1946 1946 ofstream AdjacencyFile; 1947 1947 atom *Walker = NULL; 1948 char *filename = (char *) Malloc(sizeof(char)* 255, "molecule::StoreAdjacencyToFile - filename");1948 char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::StoreAdjacencyToFile - filename"); 1949 1949 bool status = true; 1950 1950 … … 1982 1982 bool molecule::CheckAdjacencyFileAgainstMolecule(ofstream *out, char *path, atom **ListOfAtoms, int bondorder) 1983 1983 { 1984 char *filename = (char *) Malloc(sizeof(char)* 255, "molecule::CheckAdjacencyFileAgainstMolecule - filename");1984 char *filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "molecule::CheckAdjacencyFileAgainstMolecule - filename"); 1985 1985 ifstream File; 1986 1986 bool status = true; … … 1996 1996 1997 1997 // determine order from file 1998 File.getline(filename, 255);1998 File.getline(filename, MAXSTRINGSIZE); 1999 1999 if (bondorder != atoi(&filename[5])) { 2000 2000 *out << "Bond order desired is " << bondorder << " and does not match one in file " << filename[6] << "." << endl; … … 2003 2003 // Parse the file line by line and count the bonds 2004 2004 while (!File.eof()) { 2005 File.getline(filename, 255);2005 File.getline(filename, MAXSTRINGSIZE); 2006 2006 stringstream line; 2007 2007 line.str(filename); -
molecuilder/src/molecules.hpp
r307fd1 rc510a7 247 247 element *start; //!< start of element list 248 248 element *end; //!< end of element list 249 char header1[ 255]; //!< store first header line250 char header2[ 255]; //!< store second header line249 char header1[MAXSTRINGSIZE]; //!< store first header line 250 char header2[MAXSTRINGSIZE]; //!< store second header line 251 251 252 252 periodentafel(); -
molecuilder/src/periodentafel.cpp
r307fd1 rc510a7 175 175 infile.open(filename); 176 176 if (infile != NULL) { 177 infile.getline(header1, 255);178 infile.getline(header2, 255); // skip first two header lines177 infile.getline(header1, MAXSTRINGSIZE); 178 infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines 179 179 cout << "Parsed elements:"; 180 180 while (!infile.eof()) { -
pcp/src/defs.h
r307fd1 rc510a7 27 27 #define NDIM_NDIM (NDIM*NDIM) //!< spatial squared 28 28 29 #define MAXDUMMYSTRING (199) //!< maximum length when mallocting space for string 29 30 #define MAXSTRINGSIZE (255) //!< maximum length when mallocting space for string 30 31 31 32 //#define mu0 6.691762496807159e-04 //!< permeability of the vacuum in atomic units (a_0 m_e e^{-2}, converted from CODATA values) -
pcp/src/helpers.c
r307fd1 rc510a7 92 92 void* Malloci(size_t size, const char* output, int i) 93 93 { 94 char dummyoutput[MAX DUMMYSTRING];94 char dummyoutput[MAXSTRINGSIZE]; 95 95 void* dummy = (void *) malloc(size); 96 96 if (!dummy) { … … 110 110 void* Mallocii(size_t size, const char* output, int i, int j) 111 111 { 112 char dummyoutput[MAX DUMMYSTRING];112 char dummyoutput[MAXSTRINGSIZE]; 113 113 void* dummy = (void *) malloc(size); 114 114 if (!dummy) { … … 142 142 void* Realloci(void* pointer, size_t size, const char* output, int i) 143 143 { 144 char dummyoutput[MAX DUMMYSTRING];144 char dummyoutput[MAXSTRINGSIZE]; 145 145 void *dummy = (void *) realloc(pointer, size); 146 146 if (!dummy) { … … 161 161 void* Reallocii(void* pointer, size_t size, const char* output, int i, int j) 162 162 { 163 char dummyoutput[MAX DUMMYSTRING];163 char dummyoutput[MAXSTRINGSIZE]; 164 164 void *dummy = (void *) realloc(pointer, size); 165 165 if (!dummy) { … … 234 234 int info; 235 235 char processor_name[MPI_MAX_PROCESSOR_NAME]; 236 char dummy[MAX DUMMYSTRING];236 char dummy[MAXSTRINGSIZE]; 237 237 P->Par.procs = P->Par.proc[PEPsi]*P->Par.proc[PEGamma]; 238 238 P->Par.me = -1; /* eigene Position noch unklar */ -
pcp/src/init.c
r307fd1 rc510a7 1176 1176 struct LatticeLevel *LevS = R->LevS; 1177 1177 MPI_Comm_rank(P->Par.comm_ST_Psi, &myPE); // Determines the rank of the calling process in the communicator 1178 //char name[ 255];1178 //char name[MAXSTRINGSIZE]; 1179 1179 //sprintf(name, ".Psis-%i.all", myPE); 1180 1180 //FILE *psi; … … 1533 1533 /* Namen einlesen */ 1534 1534 1535 P->Files.filename = MallocString(MAX DUMMYSTRING,"ReadParameters: filename");1535 P->Files.filename = MallocString(MAXSTRINGSIZE,"ReadParameters: filename"); 1536 1536 ParseForParameter(P->Call.out[ReadOut],file, "mainname", 0, 1, 1, string_type, P->Files.filename, 1, critical); 1537 1537 //debug(P,"mainname"); 1538 1538 CreateMainname(P, filename); 1539 P->Files.default_path = MallocString(MAX DUMMYSTRING,"ReadParameters: default_path");1539 P->Files.default_path = MallocString(MAXSTRINGSIZE,"ReadParameters: default_path"); 1540 1540 ParseForParameter(P->Call.out[ReadOut],file, "defaultpath", 0, 1, 1, string_type, P->Files.default_path, 1, critical); 1541 P->Files.pseudopot_path = MallocString(MAX DUMMYSTRING,"ReadParameters: pseudopot_path");1541 P->Files.pseudopot_path = MallocString(MAXSTRINGSIZE,"ReadParameters: pseudopot_path"); 1542 1542 ParseForParameter(P->Call.out[ReadOut],file, "pseudopotpath", 0, 1, 1, string_type, P->Files.pseudopot_path, 1, critical); 1543 1543 ParseForParameter(P->Call.out[ReadOut],file,"ProcPEGamma", 0, 1, 1, int_type, &(P->Par.proc[PEGamma]), 1, critical); -
pcp/src/ions.c
r307fd1 rc510a7 293 293 I->TotalMass = 0; 294 294 char *free_name, *name; 295 name = free_name = Malloc( 255*sizeof(char),"IonsInitRead: Name");295 name = free_name = Malloc(MAXSTRINGSIZE*sizeof(char),"IonsInitRead: Name"); 296 296 for (i=0; i < I->Max_Types; i++) { 297 297 sprintf(name,"Ion_Type%i",i+1); 298 298 I->I[i].corecorr = NotCoreCorrected; 299 I->I[i].Name = MallocString( 255, "IonsInitRead: Name");300 I->I[i].Symbol = MallocString( 255, "IonsInitRead: Symbol");299 I->I[i].Name = MallocString(MAXSTRINGSIZE, "IonsInitRead: Name"); 300 I->I[i].Symbol = MallocString(MAXSTRINGSIZE, "IonsInitRead: Symbol"); 301 301 ParseForParameter(P->Call.out[ReadOut],source, name, 0, 1, 1, int_type, &I->I[i].Max_IonsOfType, 1, critical); 302 302 ParseForParameter(P->Call.out[ReadOut],source, name, 0, 2, 1, int_type, &I->I[i].Z, 1, critical); … … 1014 1014 //struct RunStruct *R = &P->R; 1015 1015 struct Ions *I = &P->Ion; 1016 char filename[ 255];1016 char filename[MAXSTRINGSIZE]; 1017 1017 FILE *output; 1018 1018 int is, ia, nr = 0; -
pcp/src/opt.c
r307fd1 rc510a7 182 182 */ 183 183 static int Start_ddd(char *Host, char *program, pid_t pid) { 184 char s[MAX DUMMYSTRING];184 char s[MAXSTRINGSIZE]; 185 185 if (Host) sprintf(s, "ddd -display %s %s %ld &", Host, program, (long int)pid); 186 186 else sprintf(s, "ddd %s %ld &", program, (long int)pid); … … 196 196 */ 197 197 static int Start_gdb(char *Host, char *program, pid_t pid) { 198 char s[MAX DUMMYSTRING];198 char s[MAXSTRINGSIZE]; 199 199 if (Host) sprintf(s, "xterm -display %s -e gdb %s %ld &", Host, program, (long int)pid); 200 200 else sprintf(s, "xterm -e gdb %s %ld &", program, (long int)pid); … … 210 210 */ 211 211 static int Start_dbx(char *Host, char *program, pid_t pid) { 212 char s[MAX DUMMYSTRING];212 char s[MAXSTRINGSIZE]; 213 213 program = program; 214 214 if (Host) sprintf(s, "xterm -display %s -e dbx -p %ld &", Host, (long int)pid); … … 225 225 */ 226 226 static int Start_cvd(char *Host, char *program, pid_t pid) { 227 char s[MAX DUMMYSTRING];227 char s[MAXSTRINGSIZE]; 228 228 program = program; 229 229 if (Host) sprintf(s, "cvd -pid %ld -display %s &", (long int)pid, Host); … … 240 240 */ 241 241 static int Start_totalview(char *Host, char *program, pid_t pid) { 242 char s[MAX DUMMYSTRING];242 char s[MAXSTRINGSIZE]; 243 243 int myrank = 0; 244 244 MPI_Comm_rank(MPI_COMM_WORLD, &myrank); … … 257 257 */ 258 258 static int Start_ups(char *Host, char *program, pid_t pid) { 259 char s[MAX DUMMYSTRING];259 char s[MAXSTRINGSIZE]; 260 260 if (Host) sprintf(s, "ups -display %s %s %ld &", Host, program, (long int)pid); 261 261 else sprintf(s, "ups %s %ld &", program, (long int)pid); … … 271 271 */ 272 272 void StartDebugger(void) { 273 char Host[MAX DUMMYSTRING] = "", Debugger[MAXDUMMYSTRING] = "";273 char Host[MAXSTRINGSIZE] = "", Debugger[MAXSTRINGSIZE] = ""; 274 274 char *host_ptr = Host; 275 275 int (*Debugger_call) (char *, char *, pid_t); -
pcp/src/output.c
r307fd1 rc510a7 329 329 330 330 SpeedMeasure(P,ReadnWriteTime,StartTimeDo); 331 suffixdat = (char *) Malloc(sizeof(char)* 255, "OutputSrcPsiDensity: *suffixdat");332 suffixdoc = (char *) Malloc(sizeof(char)* 255, "OutputSrcPsiDensity: *suffixdoc");331 suffixdat = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "OutputSrcPsiDensity: *suffixdat"); 332 suffixdoc = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "OutputSrcPsiDensity: *suffixdoc"); 333 333 sprintf(suffixdat, ".%.254s.L%i", P->R.MinimisationName[type], LevS->LevelNo); 334 strncpy (suffixdoc, suffixdat, 255);334 strncpy (suffixdoc, suffixdat, MAXSTRINGSIZE); 335 335 // for the various spin cases, output the doc-file if it's process 0 336 336 if (P->Par.me_comm_ST == 0) { // if we are process 0 of SpinDouble or SpinUp&-Down … … 338 338 case SpinDouble: 339 339 colorNo = 0; 340 strncat (suffixdat, suffixsrcpsidat, 255-strlen(suffixdat));341 strncat (suffixdoc, suffixsrcpsidoc, 255-strlen(suffixdoc));340 strncat (suffixdat, suffixsrcpsidat, MAXSTRINGSIZE-strlen(suffixdat)); 341 strncat (suffixdoc, suffixsrcpsidoc, MAXSTRINGSIZE-strlen(suffixdoc)); 342 342 Num = Lat->Psi.GlobalNo[PsiMaxNoDouble]; 343 343 break; 344 344 case SpinUp: 345 345 colorNo = 0; 346 strncat (suffixdat, suffixsrcpsiupdat, 255-strlen(suffixdat));347 strncat (suffixdoc, suffixsrcpsiupdoc, 255-strlen(suffixdoc));346 strncat (suffixdat, suffixsrcpsiupdat, MAXSTRINGSIZE-strlen(suffixdat)); 347 strncat (suffixdoc, suffixsrcpsiupdoc, MAXSTRINGSIZE-strlen(suffixdoc)); 348 348 Num = Lat->Psi.GlobalNo[PsiMaxNoUp]; 349 349 break; 350 350 case SpinDown: 351 351 colorNo = 1; 352 strncat (suffixdat, suffixsrcpsidowndat, 255-strlen(suffixdat));353 strncat (suffixdoc, suffixsrcpsidowndoc, 255-strlen(suffixdoc));352 strncat (suffixdat, suffixsrcpsidowndat, MAXSTRINGSIZE-strlen(suffixdat)); 353 strncat (suffixdoc, suffixsrcpsidowndoc, MAXSTRINGSIZE-strlen(suffixdoc)); 354 354 Num = Lat->Psi.GlobalNo[PsiMaxNoDown]; 355 355 break; … … 571 571 int LevelNo, readnr=0; 572 572 int zahl, signal = test ? 1 : 2; // 0 - ok, 1 - test failed, 2 - throw Error 573 char suffixdat[ 255], suffixdoc[255];573 char suffixdat[MAXSTRINGSIZE], suffixdoc[MAXSTRINGSIZE]; 574 574 int read_type, Num = 0, colorNo = 0; 575 575 char spin[20]; … … 581 581 SpeedMeasure(P,ReadnWriteTime,StartTimeDo); 582 582 sprintf(suffixdat, ".%.254s.L%i", P->R.MinimisationName[type], LevSNo); 583 strncpy (suffixdoc, suffixdat, 255);583 strncpy (suffixdoc, suffixdat, MAXSTRINGSIZE); 584 584 // Depending on Psis::SpinType the source psi doc file is opened and header written 585 585 switch (Lat->Psi.PsiST) { 586 586 case SpinDouble: 587 587 colorNo = 0; 588 strncat (suffixdat, suffixsrcpsidat, 255-strlen(suffixdat));589 strncat (suffixdoc, suffixsrcpsidoc, 255-strlen(suffixdoc));588 strncat (suffixdat, suffixsrcpsidat, MAXSTRINGSIZE-strlen(suffixdat)); 589 strncat (suffixdoc, suffixsrcpsidoc, MAXSTRINGSIZE-strlen(suffixdoc)); 590 590 strncpy (spin, "GlobalNoSpinDouble", 20); 591 591 Num = Lat->Psi.GlobalNo[PsiMaxNoDouble]; … … 593 593 case SpinUp: 594 594 colorNo = 0; 595 strncat (suffixdat, suffixsrcpsiupdat, 255-strlen(suffixdat));596 strncat (suffixdoc, suffixsrcpsiupdoc, 255-strlen(suffixdoc));595 strncat (suffixdat, suffixsrcpsiupdat, MAXSTRINGSIZE-strlen(suffixdat)); 596 strncat (suffixdoc, suffixsrcpsiupdoc, MAXSTRINGSIZE-strlen(suffixdoc)); 597 597 strncpy (spin, "GlobalNoSpinUp", 20); 598 598 Num = Lat->Psi.GlobalNo[PsiMaxNoUp]; … … 600 600 case SpinDown: 601 601 colorNo = 1; 602 strncat (suffixdat, suffixsrcpsidowndat, 255-strlen(suffixdat));603 strncat (suffixdoc, suffixsrcpsidowndoc, 255-strlen(suffixdoc));602 strncat (suffixdat, suffixsrcpsidowndat, MAXSTRINGSIZE-strlen(suffixdat)); 603 strncat (suffixdoc, suffixsrcpsidowndoc, MAXSTRINGSIZE-strlen(suffixdoc)); 604 604 strncpy (spin, "GlobalNoSpinDown", 20); 605 605 Num = Lat->Psi.GlobalNo[PsiMaxNoDown]; … … 1051 1051 1052 1052 // Open respective file depending on RiemannTensor use 1053 suffix = (char *) Malloc(sizeof(char)* 255, "CombineOutVisDensity: *suffix");1053 suffix = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CombineOutVisDensity: *suffix"); 1054 1054 switch (Lat->RT.ActualUse) { 1055 1055 case active: … … 1317 1317 int is,ia,i; 1318 1318 FILE *SrcIonDoc, *SrcIonData; 1319 char *suffix = (char *) Malloc(sizeof(char)* 255, "CombineOutVisDensity: *suffix");1319 char *suffix = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CombineOutVisDensity: *suffix"); 1320 1320 1321 1321 if (!(P->Par.me == 0)) return; … … 1493 1493 1494 1494 // generate file names 1495 suffix = (char *) Malloc(sizeof(char)* 255, "OutVisIons: * suffix");1495 suffix = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "OutVisIons: * suffix"); 1496 1496 datnamef = (char*) 1497 1497 malloc(strlen(P->Files.mainname)+strlen(suffixionfor) + 1); … … 1776 1776 time(&seconds); // get current time 1777 1777 1778 filename = (char *) Malloc(sizeof(char)* 255, "PlotSrcPlane: *filename");1778 filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "PlotSrcPlane: *filename"); 1779 1779 switch (Lat->Psi.PsiST) { 1780 1780 case SpinDouble: -
pcp/src/perturbed.c
r307fd1 rc510a7 2975 2975 } 2976 2976 2977 suffixchi = (char *) Malloc(sizeof(char)* 255, "CalculateMagneticSusceptibility: *suffixchi");2977 suffixchi = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CalculateMagneticSusceptibility: *suffixchi"); 2978 2978 // store symmetrized matrix 2979 2979 for (in=0;in<NDIM;in++) … … 3100 3100 gsl_matrix_complex *H = gsl_matrix_complex_calloc(NDIM,NDIM); 3101 3101 FILE *SigmaFile; 3102 char *suffixsigma = (char *) Malloc(sizeof(char)* 255, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma");3102 char *suffixsigma = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CalculateChemicalShieldingByReciprocalCurrentDensity: *suffixsigma"); 3103 3103 3104 3104 time_t seconds; … … 3400 3400 const int N0 = Lev0->Plan0.plan->local_nx; 3401 3401 FILE *MomentFile; 3402 char *suffixmoment = (char *) Malloc(sizeof(char)* 255, "CalculateMagneticMoment: *suffixmoment");3402 char *suffixmoment = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "CalculateMagneticMoment: *suffixmoment"); 3403 3403 time_t seconds; 3404 3404 time(&seconds); // get current time … … 3885 3885 if (!myPE) { // only process 0 writes to file 3886 3886 // open file 3887 filename = (char *) Malloc(sizeof(char)* 255, "PlotVectorPlane: *filename");3887 filename = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "PlotVectorPlane: *filename"); 3888 3888 sprintf(&filename[0], ".current.L%i.csv", Lev0->LevelNo); 3889 3889 OpenFile(P, &PlotFile, filename, "w", P->Call.out[ReadOut]); -
pcp/src/pseudo.c
r307fd1 rc510a7 483 483 PP->lm_endmax = 0; 484 484 PP->corecorr = NotCoreCorrected; 485 cpiInputFileName = (char *) Malloc(sizeof(char)* 255, "InitPseudoRead: *cpiInputFileName");485 cpiInputFileName = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "InitPseudoRead: *cpiInputFileName"); 486 486 for (it = 0; it < I->Max_Types; it++) { 487 487 PP->lm_end[it] = I->I[it].l_max*I->I[it].l_max+1-2*I->I[it].l_loc; -
pcp/src/wannier.c
r307fd1 rc510a7 1875 1875 1876 1876 if (P->Par.me_comm_ST == 0) { 1877 tagname = (char *) Malloc(sizeof(char)* 255, "ParseWannierFile: *tagname");1877 tagname = (char *) Malloc(sizeof(char)*MAXSTRINGSIZE, "ParseWannierFile: *tagname"); 1878 1878 if(!OpenFile(P, &SpreadFile, suffix, "r", P->Call.out[ReadOut])) { // check if file exists 1879 1879 if (MPI_Bcast(&signal,1,MPI_INT,0,P->Par.comm_ST) != MPI_SUCCESS)
Note:
See TracChangeset
for help on using the changeset viewer.