Changeset c4a0a2


Ignore:
Timestamp:
Jun 10, 2008, 11:13:41 AM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
68fbb5
Parents:
d11f22
Message:

enabled fast parsing (-n)

config::Load(): the repetition and thereby impossible setting of "sequential" makes reading of big configs very slow. Hence, a command line parameter can be specified to skip more instances of Ion_Type...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/config.cpp

    rd11f22 rc4a0a2  
    2424  configname[0]='\0';
    2525 
     26  FastParsing = false;
    2627  ProcPEGamma=8;
    2728  ProcPEPsi=1;
     
    642643      atom *neues = new atom();
    643644      // then parse for each atom the coordinates as often as present
    644       while (ParseForParameter(verbose,file, keyword, 0, 1, 1, double_type, &neues->x.x[0], repetition, (repetition == 1) ? critical : optional) &&
    645         ParseForParameter(verbose,file, keyword, 0, 2, 1, double_type, &neues->x.x[1], repetition, (repetition == 1) ? critical : optional) &&
    646         ParseForParameter(verbose,file, keyword, 0, 3, 1, double_type, &neues->x.x[2], repetition, (repetition == 1) ? critical : optional))
    647         repetition++;
    648       repetition--;
    649       //cout << "Found " << repetition << " times of the keyword " << keyword << "." << endl;
     645      if (!FastParsing) {
     646        while (ParseForParameter(verbose,file, keyword, 0, 1, 1, double_type, &neues->x.x[0], repetition, (repetition == 1) ? critical : optional) &&
     647          ParseForParameter(verbose,file, keyword, 0, 2, 1, double_type, &neues->x.x[1], repetition, (repetition == 1) ? critical : optional) &&
     648          ParseForParameter(verbose,file, keyword, 0, 3, 1, double_type, &neues->x.x[2], repetition, (repetition == 1) ? critical : optional))
     649          repetition++;
     650        repetition--;
     651        //cout << "Found " << repetition << " times of the keyword " << keyword << "." << endl;
     652      }
    650653      ParseForParameter(verbose,file, keyword, 0, 1, 1, double_type, &neues->x.x[0], repetition,critical);
    651654      ParseForParameter(verbose,file, keyword, 0, 2, 1, double_type, &neues->x.x[1], repetition,critical);
     
    656659      if(!ParseForParameter(verbose,file, keyword, 0, 6, 1, double_type, &neues->v.x[1], repetition,optional))
    657660        neues->v.x[1] = 0.;
    658       if(!ParseForParameter(verbose,file, keyword, 0, 7, 1, double_type, &neues->v.x[2], repetition,optional))
     661      if(!ParseForParameter(verbose,file, keyword, (int)FastParsing, 7, 1, double_type, &neues->v.x[2], repetition,optional))
    659662        neues->v.x[2] = 0.;
    660663      neues->type = elementhash[i]; // find element type
Note: See TracChangeset for help on using the changeset viewer.