Ignore:
Timestamp:
Aug 11, 2025, 5:43:56 PM (6 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, Candidate_v1.7.1, stable
Children:
c41ce0
Parents:
c099dc
git-author:
Frederik Heber <frederik.heber@…> (05/02/24 22:20:01)
git-committer:
Frederik Heber <frederik.heber@…> (08/11/25 17:43:56)
Message:

MPQCJob mutes output on verbosity level 0 and unmutes else.

  • we redirect stdout to /dev/null when verbose level of 0 is set.
  • passing on verbosity level to MPQCJob.
  • Tested that the verbosity can be changed per executed job and will not be touched with a job of the same verbosity level.
Location:
ThirdParty/mpqc_open/src/bin/mpqc
Files:
2 edited

Legend:

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

    rc099dc r6294b6  
    11771177}
    11781178
     1179//!> this is backup for the old ExEnv::out0 stream when we override using /dev/null
     1180ostream *oldstream = NULL;
     1181
    11791182/** Performs the main work to calculate the ground state energies, gradients, etc.
    11801183 *
     
    11931196  // get the basename for output files
    11941197  setOutputBaseName(_initvalues.input, _initvalues.output);
     1198
     1199  // Based on verbose flag in InitValues, out ExEnv::set_out to nullstream (see out0()) to mute info
     1200  ofstream nullofstream;
     1201  if (_initvalues.verbose == 0) {
     1202    // only change out0 when oldstream is unset, yet
     1203    if (oldstream == NULL) {
     1204      ExEnv::out0() << "Muting mpqc's output due to verbosity level of 0." << endl;
     1205      nullofstream.open("/dev/null");
     1206      oldstream = &ExEnv::out0();
     1207      ExEnv::set_out(&nullofstream);
     1208    }
     1209  } else {
     1210    // only revert out0 if oldstream is set, i.e., when it has been changed
     1211    if (oldstream != NULL) {
     1212      ExEnv::out0() << "Unmuting mpqc's output due to verbosity level of 1 or larger." << endl;
     1213      ExEnv::set_out(oldstream);
     1214      oldstream = NULL;
     1215    }
     1216  }
    11951217
    11961218  // parse input into keyvalue container
     
    14771499      outstream(NULL),
    14781500      in_char_array(NULL),
    1479       values(::values)
     1501      values(::values),
     1502      verbose(0)
    14801503  {};
    14811504
  • ThirdParty/mpqc_open/src/bin/mpqc/mpqc.h

    rc099dc r6294b6  
    5959    sc::GetLongOpt options;
    6060    sc::Ref< sc::MessageGrp> grp;
     61    int verbose;
    6162  };
    6263
Note: See TracChangeset for help on using the changeset viewer.