Changeset ab755a


Ignore:
Timestamp:
Jul 10, 2012, 1:15:51 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
d2d7fc
Parents:
ce1e39
git-author:
Frederik Heber <heber@…> (07/08/12 19:59:01)
git-committer:
Frederik Heber <heber@…> (07/10/12 13:15:51)
Message:

Placed initial stuff in try_main() into own function.

  • also moved Work() before try_main().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/bin/mpqc/mpqc.cc

    rce1e39 rab755a  
    11281128}
    11291129
    1130 void Work(ostream *&outstream, struct OptionValues &values, const char *&input, const char *&generic_input, int argc, char **argv);
    1131 
    1132 int
    1133 try_main(int argc, char *argv[])
     1130void init()
    11341131{
    11351132  //trash_stack();
     
    11671164  setrlimit(RLIMIT_CORE,&rlim);
    11681165#endif
    1169 
    1170   ExEnv::init(argc, argv);
    1171 
    1172   // parse commandline options
    1173   GetLongOpt options;
    1174   int optind = ParseOptions(options, argc, argv);
    1175   const char *output = 0;
    1176   ostream *outstream = 0;
    1177   ComputeOptions(options, output, outstream);
    1178   OptionValues values;
    1179   parseRemainderOptions(options, values, argc, argv);
    1180 
    1181   // get input file names, either object-oriented or generic
    1182   const char *object_input = 0;
    1183   const char *generic_input = 0;
    1184   getInputFileNames(object_input, generic_input, options, argc, argv);
    1185   const char *input;
    1186   if (object_input) input = object_input;
    1187   if (generic_input) input = generic_input;
    1188 
    1189   // get the basename for output files
    1190   setOutputBaseName(input, output);
    1191 
    1192   // now comes the actual work
    1193   Work(outstream, values, input, generic_input, argc, argv);
    1194 
    1195   if (output != 0) {
    1196     ExEnv::set_out(&cout);
    1197     delete outstream;
    1198   }
    1199 
    1200   return 0;
    12011166}
    12021167
     
    15061471}
    15071472
     1473int
     1474try_main(int argc, char *argv[])
     1475{
     1476  init();
     1477
     1478  ExEnv::init(argc, argv);
     1479
     1480  // parse commandline options
     1481  GetLongOpt options;
     1482  int optind = ParseOptions(options, argc, argv);
     1483  const char *output = 0;
     1484  ostream *outstream = 0;
     1485  ComputeOptions(options, output, outstream);
     1486  OptionValues values;
     1487  parseRemainderOptions(options, values, argc, argv);
     1488
     1489  // get input file names, either object-oriented or generic
     1490  const char *object_input = 0;
     1491  const char *generic_input = 0;
     1492  getInputFileNames(object_input, generic_input, options, argc, argv);
     1493  const char *input;
     1494  if (object_input) input = object_input;
     1495  if (generic_input) input = generic_input;
     1496
     1497  // get the basename for output files
     1498  setOutputBaseName(input, output);
     1499
     1500  // now comes the actual work
     1501  Work(outstream, values, input, generic_input, argc, argv);
     1502
     1503  if (output != 0) {
     1504    ExEnv::set_out(&cout);
     1505    delete outstream;
     1506  }
     1507
     1508  return 0;
     1509}
     1510
     1511
    15081512double EvaluateDensity(SCVector3 &r, Ref<Integral> &intgrl, GaussianBasisSet::ValueData &vdat, Ref<Wavefunction> &wfn)
    15091513{
Note: See TracChangeset for help on using the changeset viewer.