Changeset 3d4397


Ignore:
Timestamp:
Jul 10, 2012, 1:15:50 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
41f82c
Parents:
c676ca
git-author:
Frederik Heber <heber@…> (07/06/12 18:46:13)
git-committer:
Frederik Heber <heber@…> (07/10/12 13:15:50)
Message:

Extracted making announcement into own function.

File:
1 edited

Legend:

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

    rc676ca r3d4397  
    533533}
    534534
     535/** Prints the header of the output.
     536 *
     537 * \param tim timing structure
     538 */
     539void makeAnnouncement(
     540    Ref<RegionTimer> &tim
     541    )
     542{
     543  const char title1[] = "MPQC: Massively Parallel Quantum Chemistry";
     544  int ntitle1 = sizeof(title1);
     545  const char title2[] = "Version " SC_VERSION;
     546  int ntitle2 = sizeof(title2);
     547  ExEnv::out0() << endl;
     548  ExEnv::out0() << indent;
     549  for (int i=0; i<(80-ntitle1)/2; i++) ExEnv::out0() << ' ';
     550  ExEnv::out0() << title1 << endl;
     551  ExEnv::out0() << indent;
     552  for (int i=0; i<(80-ntitle2)/2; i++) ExEnv::out0() << ' ';
     553  ExEnv::out0() << title2 << endl << endl;
     554
     555  const char *tstr = 0;
     556#if defined(HAVE_TIME) && defined(HAVE_CTIME)
     557  time_t t;
     558  time(&t);
     559  tstr = ctime(&t);
     560#endif
     561  if (!tstr) {
     562    tstr = "UNKNOWN";
     563  }
     564
     565  ExEnv::out0()
     566       << indent << scprintf("Machine:    %s", TARGET_ARCH) << endl
     567       << indent << scprintf("User:       %s@%s",
     568                             ExEnv::username(), ExEnv::hostname()) << endl
     569       << indent << scprintf("Start Time: %s", tstr) << endl;
     570}
     571
    535572int
    536573try_main(int argc, char *argv[])
     
    663700 
    664701  // announce ourselves
    665   const char title1[] = "MPQC: Massively Parallel Quantum Chemistry";
    666   int ntitle1 = sizeof(title1);
    667   const char title2[] = "Version " SC_VERSION;
    668   int ntitle2 = sizeof(title2);
    669   ExEnv::out0() << endl;
    670   ExEnv::out0() << indent;
    671   for (i=0; i<(80-ntitle1)/2; i++) ExEnv::out0() << ' ';
    672   ExEnv::out0() << title1 << endl;
    673   ExEnv::out0() << indent;
    674   for (i=0; i<(80-ntitle2)/2; i++) ExEnv::out0() << ' ';
    675   ExEnv::out0() << title2 << endl << endl;
    676 
    677   const char *tstr = 0;
    678 #if defined(HAVE_TIME) && defined(HAVE_CTIME)
    679   time_t t;
    680   time(&t);
    681   tstr = ctime(&t);
    682 #endif
    683   if (!tstr) {
    684     tstr = "UNKNOWN";
    685   }
    686 
    687   ExEnv::out0()
    688        << indent << scprintf("Machine:    %s", TARGET_ARCH) << endl
    689        << indent << scprintf("User:       %s@%s",
    690                              ExEnv::username(), ExEnv::hostname()) << endl
    691        << indent << scprintf("Start Time: %s", tstr) << endl;
     702  makeAnnouncement(tim);
    692703
    693704  // get the thread group.  first try the commandline and environment
     
    11951206
    11961207#if defined(HAVE_TIME) && defined(HAVE_CTIME)
     1208  time_t t;
    11971209  time(&t);
    1198   tstr = ctime(&t);
     1210  const char *tstr = ctime(&t);
    11991211#endif
    12001212  if (!tstr) {
Note: See TracChangeset for help on using the changeset viewer.