Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:20

0001 /**
0002 sreport.cc : Summarize + Present SEvt/NPFold metadata time stamps
0003 =============================================================================
0004 
0005 ::
0006 
0007     ~/opticks/sysrap/tests/sreport.sh
0008     ~/opticks/sysrap/tests/sreport.sh grab
0009     ~/opticks/sysrap/tests/sreport.sh ana
0010 
0011 
0012 Summarizes SEvt/NPFold metadata time stamps into substamp arrays
0013 grouped by NPFold path prefix. The summary NPFold is presented textually
0014 and saved to allow plotting from python.
0015 
0016 +-----+---------------------------------+-------------------------+
0017 | key | SEvt/NPFold path prefix         |  SEvt type              |
0018 +=====+=================================+=========================+
0019 | a   | "//A" eg: //A000 //A001         | Opticks/QSim SEvt       |
0020 +-----+---------------------------------+-------------------------+
0021 | b   | "//B" eg: //B000 //B001         | Geant4/U4Recorder SEvt  |
0022 +-----+---------------------------------+-------------------------+
0023 
0024 The tables are presented with row and column labels and the
0025 summary NPFold is saved to DIR_sreport sibling to invoking DIR
0026 which needs to contain SEvt/NPFold folders corresponding to the path prefix.
0027 The use of NPFold::LoadNoData means that only SEvt NPFold/NP
0028 metadata is loaded. Excluding the array data makes the load
0029 very fast and able to handle large numbers of persisted SEvt NPFold.
0030 
0031 Usage from source "run" directory creates the report saving into eg ../ALL3_sreport::
0032 
0033     epsilon:~ blyth$ cd /data/blyth/opticks/GEOM/J23_1_0_rc3_ok0/G4CXTest/ALL3
0034     epsilon:ALL3 blyth$ sreport
0035     epsilon:ALL3 blyth$ ls -alst ../ALL3_sreport
0036 
0037 Usage from report directory loads and presents the report::
0038 
0039     epsilon:ALL3 blyth$ cd ../ALL3_sreport/
0040     epsilon:ALL3_sreport blyth$ sreport
0041 
0042 Note that this means that can rsync just the small report directory
0043 and still be able to present the report and make plots on laptop concerning
0044 run folders with many large arrays left on the server.
0045 
0046 
0047 Debugging Notes
0048 -----------------
0049 
0050 Debugging this is whacky as its mostly stringstream preparation
0051 so cout/cerr reporting sometimes seems out of place compared to
0052 the report output. For this reason its important to label most
0053 output with where it comes from to speedup understanding+debug.
0054 
0055 **/
0056 
0057 #include "NPFold.h"
0058 
0059 #define WITH_SUBMETA 1
0060 
0061 struct sreport
0062 {
0063     static constexpr const char* JUNCTURE = "SEvt__Init_RUN_META,SEvt__BeginOfRun,SEvt__EndOfRun,SEvt__Init_RUN_META" ;
0064     static constexpr const char* RANGES = R"(
0065         SEvt__Init_RUN_META:CSGFoundry__Load_HEAD                     ## init
0066         CSGFoundry__Load_HEAD:CSGFoundry__Load_TAIL                   ## load_geom
0067         CSGOptiX__Create_HEAD:CSGOptiX__Create_TAIL                   ## upload_geom
0068         A%0.3d_QSim__simulate_HEAD:A%0.3d_QSim__simulate_LBEG         ## slice_genstep
0069         A%0.3d_QSim__simulate_PRUP:A%0.3d_QSim__simulate_PREL         ## upload genstep slice
0070         A%0.3d_QSim__simulate_PREL:A%0.3d_QSim__simulate_POST         ## simulate slice
0071         A%0.3d_QSim__simulate_POST:A%0.3d_QSim__simulate_DOWN         ## download slice
0072         A%0.3d_QSim__simulate_LEND:A%0.3d_QSim__simulate_PCAT         ## concat slices
0073         A%0.3d_QSim__simulate_BRES:A%0.3d_QSim__simulate_TAIL         ## save arrays
0074        )" ;
0075 
0076     bool    VERBOSE ;
0077 
0078     NP*       run ;   // dummy array that exists just to hold metadata
0079     NP*       runprof ;
0080     NP*       ranges ;
0081 
0082     NPFold*   substamp ;
0083     NPFold*   subprofile ;
0084     NPFold*   submeta ;
0085     NPFold*   submeta_NumPhotonCollected ;
0086     NPFold*   subcount ;
0087 
0088     sreport();
0089 
0090     NPFold* serialize() const ;
0091     void    import( const NPFold* fold );
0092     void save(const char* dir) const ;
0093     static sreport* Load(const char* dir) ;
0094 
0095     std::string desc() const ;
0096     std::string desc_run() const ;
0097     std::string desc_runprof() const ;
0098     std::string desc_ranges() const ;
0099     std::string desc_substamp() const ;
0100     std::string desc_subprofile() const ;
0101     std::string desc_submeta() const ;
0102     std::string desc_subcount() const ;
0103 };
0104 
0105 inline sreport::sreport()
0106     :
0107     VERBOSE(getenv("sreport__VERBOSE") != nullptr),
0108     run( nullptr ),
0109     runprof( nullptr ),
0110     ranges( nullptr ),
0111     substamp( nullptr),
0112     subprofile( nullptr ),
0113     submeta( nullptr ),
0114     submeta_NumPhotonCollected( nullptr ),
0115     subcount( nullptr )
0116 {
0117 }
0118 inline NPFold* sreport::serialize() const
0119 {
0120     NPFold* smry = new NPFold ;
0121     smry->add("run", run ) ;
0122     smry->add("runprof", runprof ) ;
0123     smry->add("ranges", ranges ) ;
0124     smry->add_subfold("substamp", substamp ) ;
0125     smry->add_subfold("subprofile", subprofile ) ;
0126     smry->add_subfold("submeta", submeta ) ;
0127     smry->add_subfold("submeta_NumPhotonCollected", submeta_NumPhotonCollected ) ;
0128     smry->add_subfold("subcount", subcount ) ;
0129     return smry ;
0130 }
0131 inline void sreport::import(const NPFold* smry)
0132 {
0133     run = smry->get("run")->copy() ;
0134     runprof = smry->get("runprof")->copy() ;
0135     ranges = smry->get("ranges")->copy() ;
0136     substamp = smry->get_subfold("substamp");
0137     subprofile = smry->get_subfold("subprofile");
0138     submeta = smry->get_subfold("submeta");
0139     submeta_NumPhotonCollected = smry->get_subfold("submeta_NumPhotonCollected");
0140     subcount = smry->get_subfold("subcount");
0141 }
0142 inline void sreport::save(const char* dir) const
0143 {
0144     NPFold* smry = serialize();
0145     smry->save_verbose(dir);
0146 }
0147 inline sreport* sreport::Load(const char* dir) // static
0148 {
0149     NPFold* smry = NPFold::Load(dir) ;
0150     sreport* report = new sreport ;
0151     report->import(smry) ;
0152     return report ;
0153 }
0154 
0155 inline std::string sreport::desc() const
0156 {
0157     std::stringstream ss ;
0158     ss << "[sreport.desc" << std::endl
0159        << desc_run()
0160        << desc_runprof()
0161        << desc_ranges()
0162        << desc_substamp()
0163        << desc_submeta()
0164        << desc_subcount()
0165        << "]sreport.desc" << std::endl
0166        ;
0167     std::string str = ss.str() ;
0168     return str ;
0169 }
0170 
0171 inline std::string sreport::desc_run() const
0172 {
0173     std::stringstream ss ;
0174     ss << "[sreport.desc_run (run is dummy small array used as somewhere to hang metadata) "
0175        << ( run ? run->sstr() : "-" )
0176        << "\n"
0177        << "[sreport.desc_run.descMetaKVS " << std::endl
0178        << ( run ? run->descMetaKVS(JUNCTURE, RANGES) : "-" ) << std::endl
0179        << "]sreport.desc_run.descMetaKVS " << std::endl
0180        << "]sreport.desc_run" << std::endl
0181        ;
0182     std::string str = ss.str() ;
0183     return str ;
0184 }
0185 
0186 
0187 inline std::string sreport::desc_runprof() const
0188 {
0189     std::stringstream ss ;
0190     ss << "[sreport.desc_runprof" << std::endl
0191        << ( runprof ? runprof->sstr() : "-" ) << std::endl
0192        << ".sreport.desc_runprof.descTable " << std::endl
0193        << ( runprof ? runprof->descTable<int64_t>(17) : "-" ) << std::endl
0194        << "]sreport.desc_runprof" << std::endl
0195        ;
0196     std::string str = ss.str() ;
0197     return str ;
0198 }
0199 
0200 inline std::string sreport::desc_ranges() const
0201 {
0202     std::stringstream ss ;
0203     ss << "[sreport.desc_ranges"
0204        << " ranges : " << ( ranges ? ranges->sstr() : "-" ) << std::endl
0205        << ".sreport.desc_ranges.descTable "
0206        << " ( ta,tb : timestamps expressed as seconds from first timestamp, ab: (tb-ta) )"
0207        << "\n"
0208        << ( ranges ? ranges->descTable<int64_t>(17) : "-" ) << std::endl
0209        << "]sreport.desc_ranges" << std::endl
0210        ;
0211     std::string str = ss.str() ;
0212     return str ;
0213 }
0214 
0215 /**
0216 report::desc_substamp
0217 -----------------------
0218 
0219 The substamp NPFold is created by::
0220 
0221    substamp = fold->subfold_summary("substamp",   ASEL, BSEL)
0222 
0223 
0224 **/
0225 
0226 inline std::string sreport::desc_substamp() const
0227 {
0228     std::stringstream ss ;
0229     ss << "[sreport.desc_substamp" << std::endl
0230        ;
0231     if(VERBOSE) ss
0232        << "[sreport.desc_substamp.VERBOSE" << std::endl
0233        << ( substamp ? substamp->desc() : "-" )
0234        << "]sreport.desc_substamp.VERBOSE" << std::endl
0235        ;
0236 
0237     ss << "[sreport.desc_substamp.compare_subarrays_report" << std::endl
0238        <<  ( substamp ? substamp->compare_subarrays_report<double, int64_t>( "delta_substamp", "a", "b" ) : "-" )
0239        << "]sreport.desc_substamp.compare_subarrays_report" << std::endl
0240        << "]sreport.desc_substamp" << std::endl
0241        ;
0242     std::string str = ss.str() ;
0243     return str ;
0244 }
0245 
0246 
0247 inline std::string sreport::desc_subprofile() const
0248 {
0249     std::stringstream ss ;
0250     ss << "[sreport.desc_subprofile" << std::endl
0251        ;
0252     if(VERBOSE) ss
0253        << "[sreport.desc_subprofile.VERBOSE" << std::endl
0254        << ( subprofile ? subprofile->desc() : "-" )
0255        << "]sreport.desc_subprofile.VERBOSE" << std::endl
0256        ;
0257 
0258     /*
0259     ss << "[sreport.desc_subprofile.compare_subarrays_report" << std::endl
0260        <<  ( subprofile ? subprofile->compare_subarrays_report<double, int64_t>( "delta_subprofile", "a", "b" ) : "-" )
0261        << "]sreport.desc_subprofile.compare_subarrays_report" << std::endl
0262     */
0263 
0264     ss
0265        << "]sreport.desc_subprofile" << std::endl
0266        ;
0267     std::string str = ss.str() ;
0268     return str ;
0269 }
0270 
0271 
0272 inline std::string sreport::desc_submeta() const
0273 {
0274     std::stringstream ss ;
0275     ss << "[sreport.desc_submeta" << std::endl
0276        << ( submeta ? submeta->desc() : "-" )
0277        << "]sreport.desc_submeta" << std::endl
0278        ;
0279     std::string str = ss.str() ;
0280     return str ;
0281 }
0282 inline std::string sreport::desc_subcount() const
0283 {
0284     std::stringstream ss ;
0285     ss << "[sreport.desc_subcount" << std::endl
0286        << ( subcount ? subcount->desc() : "-" )
0287        << "]sreport.desc_subcount" << std::endl
0288        ;
0289     std::string str = ss.str() ;
0290     return str ;
0291 }
0292 
0293 
0294 
0295 /**
0296 sreport_Creator
0297 ---------------
0298 
0299 1. loads folder metadata with NPFold::LoadNoData
0300 2. instanciates and populates sreport instance
0301 
0302 **/
0303 
0304 struct sreport_Creator
0305 {
0306     static constexpr const char* ASEL = "a://A" ;
0307     static constexpr const char* BSEL = "b://B" ;
0308 
0309     bool VERBOSE ;
0310     const char* dirp ;
0311     NPFold*    fold ;
0312     bool fold_valid ;
0313     const NP*  run ;
0314     sreport*   report ;
0315 
0316     sreport_Creator(  const char* dirp_ );
0317     void init();
0318     void init_SProf();
0319     void init_substamp();
0320     void init_subprofile();
0321     void init_submeta();
0322     void init_subcount();
0323 
0324     std::string desc() const ;
0325     std::string desc_fold() const ;
0326     std::string desc_fold_detail() const ;
0327     std::string desc_run() const ;
0328 };
0329 
0330 inline sreport_Creator::sreport_Creator( const char* dirp_ )
0331     :
0332     VERBOSE(getenv("sreport_Creator__VERBOSE") != nullptr),
0333     dirp(dirp_ ? strdup(dirp_) : nullptr),
0334     fold(NPFold::LoadNoData(dirp)),
0335     fold_valid(NPFold::IsValid(fold)),
0336     run(fold_valid ? fold->get("run") : nullptr),
0337     report(new sreport)
0338 {
0339     std::cout
0340         << "[sreport_Creator::sreport_Creator"
0341         << " fold_valid " << ( fold_valid ? "YES" : "NO " )
0342         << " run " << ( run ? "YES" : "NO " )
0343         << "\n"
0344         ;
0345     init();
0346     std::cout << "]sreport_Creator::sreport_Creator" << std::endl ;
0347 }
0348 
0349 
0350 /**
0351 sreport_Creator::init
0352 -----------------------
0353 
0354 1. construct SProf derived metadata arrays
0355 2. construct subfold derived arrays and fold
0356 
0357 **/
0358 
0359 
0360 inline void sreport_Creator::init()
0361 {
0362     std::cout << "[sreport_Creator::init\n" ;
0363 
0364     init_SProf();
0365 
0366     init_substamp();
0367     init_subprofile();
0368     init_submeta();
0369     init_subcount();
0370 
0371     std::cout << "]sreport_Creator::init\n" ;
0372 }
0373 
0374 /**
0375 sreport_Creator::init_SProf
0376 ----------------------------
0377 
0378 The SProf has the advantage of almost always being available, as the SProf.txt is small
0379 unlike the full arrays.
0380 
0381 1. read SProf.txt into meta string
0382 2. create report->runprof array from the "Index" lines, shaped (2,3) for the below example
0383 3. create report->run (dummy array with run metadata)
0384 4. create report->ranges. eg shaped (8,5) with the below example : this included time deltas between the keys
0385    that match the wildcard resolved sreport::RANGES
0386 
0387 Analysis of the SProf.txt written by SProf.hh, eg::
0388 
0389     A[blyth@localhost ALL1_Debug_Philox_ref1]$ cat SProf.txt
0390     SEvt__Init_RUN_META:1760707884870593,46464,8064
0391     CSGOptiX__SimulateMain_HEAD:1760707884871147,46464,10752
0392     CSGFoundry__Load_HEAD:1760707884871171,46464,11200
0393     CSGFoundry__Load_TAIL:1760707885851123,5419968,883988
0394     CSGOptiX__Create_HEAD:1760707885851159,5419968,883988
0395     CSGOptiX__Create_TAIL:1760707886286856,7316444,1222084
0396     A000_QSim__simulate_HEAD:1760707886286900,7316444,1222084
0397     A000_SEvt__BeginOfRun:1760707886286914,7316444,1222084
0398     A000_SEvt__beginOfEvent_FIRST_EGPU:1760707886287034,7316444,1222084
0399     A000_SEvt__setIndex:1760707886287057,7316444,1222084
0400     A000_QSim__simulate_LBEG:1760707886287202,7316444,1222084
0401     A000_QSim__simulate_PRUP:1760707886287207,7316444,1222084
0402     A000_QSim__simulate_PREL:1760707886288393,8266716,1222980
0403     A000_QSim__simulate_POST:1760707886441594,8266716,1227908
0404     A000_QSim__simulate_DOWN:1760707886541324,8373000,1334844
0405     A000_QSim__simulate_LEND:1760707886541353,8373000,1334844
0406     A000_QSim__simulate_PCAT:1760707886541381,8373000,1334844
0407     A000_QSim__simulate_BRES:1760707886541433,8373000,1334844 # numGenstepCollected=10,numPhotonCollected=1000000,numHit=200397
0408     A000_QSim__reset_HEAD:1760707886541441,8373000,1334844
0409     A000_SEvt__endIndex:1760707886541457,8373000,1334844
0410     A000_SEvt__EndOfRun:1760707887055687,8266716,1229000
0411     A000_QSim__reset_TAIL:1760707887055757,8266716,1229000
0412     A000_QSim__simulate_TAIL:1760707887055768,8266716,1229000
0413     CSGOptiX__SimulateMain_TAIL:1760707887056235,8266716,1229000
0414     A[blyth@localhost ALL1_Debug_Philox_ref1]$
0415 
0416 **/
0417 
0418 inline void sreport_Creator::init_SProf()
0419 {
0420     std::cout << "[sreport_Creator::init_SProf\n" ;
0421 
0422     std::string meta = U::ReadString2_("SProf.txt");
0423 
0424     report->runprof = NP::MakeMetaKVProfileArray(meta, "Index") ;
0425     std::cout << "-sreport_Creator::init.SProf:runprof   :" << ( report->runprof ? report->runprof->sstr() : "-" ) << std::endl ;
0426     // report->runprof, should now be report->prof
0427 
0428     report->run     = run ? run->copy() : nullptr ;
0429     std::cout << "-sreport_Creator::init_SProf.run       :" << ( report->run ? report->run->sstr() : "-" ) << std::endl ;
0430 
0431     report->ranges = run ? NP::MakeMetaKVS_ranges2( meta, sreport::RANGES ) : nullptr ;
0432     std::cout << "-sreport_Creator::init_SProf.ranges2   :" << ( report->ranges ?  report->ranges->sstr() : "-" ) <<  std::endl ;
0433 
0434     std::cout << "]sreport_Creator::init_SProf\n" ;
0435 }
0436 
0437 /**
0438 sreport_Creator::init_substamp
0439 -------------------------------
0440 
0441 1. create report->substamp from stamps found in NPFold_meta.txt of the specified subfolders
0442 
0443 **/
0444 
0445 
0446 inline void sreport_Creator::init_substamp()
0447 {
0448     std::cout << "[sreport_Creator::init_substamp\n" ;
0449 
0450     std::cout << "-sreport_Creator::init_substamp fold_valid " << ( fold_valid ? "Y" : "N" ) << std::endl ;
0451 
0452     report->substamp   = fold_valid ? fold->subfold_summary("substamp",   ASEL, BSEL) : nullptr ;
0453     std::cout << "-sreport_Creator::init_substamp ((NPFold)report.substamp).stats [" << ( report->substamp ? report->substamp->stats() : "-" ) << "]\n" ;
0454 
0455     std::cout << "]sreport_Creator::init_substamp\n" ;
0456 }
0457 
0458 /**
0459 sreport_Creator::init_subprofile
0460 ----------------------------------
0461 
0462 1. create report->subprofile from profile metadata from the subfold
0463 
0464 **/
0465 
0466 inline void sreport_Creator::init_subprofile()
0467 {
0468     std::cout << "[sreport_Creator::init_subprofile\n" ;
0469     report->subprofile = fold_valid ? fold->subfold_summary("subprofile", ASEL, BSEL) : nullptr ;
0470     std::cout << "-sreport_Creator::init_subprofile :[" << ( report->subprofile ? report->subprofile->stats() : "-" )  << "]\n" ;
0471     std::cout << "]sreport_Creator::init_subprofile\n" ;
0472 }
0473 
0474 /**
0475 sreport_Creator::init_submeta
0476 -------------------------------
0477 
0478 1. create report->submeta from subfold metadata
0479 2. report->submeta_NumPhotonCollected from subfold metadata
0480 
0481 **/
0482 
0483 
0484 inline void sreport_Creator::init_submeta()
0485 {
0486     std::cout << "[sreport_Creator::init_submeta\n" ;
0487 #ifdef WITH_SUBMETA
0488     std::cout << "-sreport_Creator::init_submeta.WITH_SUBMETA\n" ;
0489 
0490     report->submeta    = fold_valid ? fold->subfold_summary("submeta",    ASEL, BSEL) : nullptr ;
0491     std::cout << "-sreport_Creator::init_submeta :[" << ( report->submeta ? report->submeta->stats() : "-" )  << "]\n"  ;
0492 
0493     report->submeta_NumPhotonCollected = fold_valid ? fold->subfold_summary("submeta:NumPhotonCollected", ASEL, BSEL) : nullptr ;
0494     std::cout << "-sreport_Creator::init_submeta_NumPhotonCollected :[" << ( report->submeta_NumPhotonCollected ? report->submeta_NumPhotonCollected->stats() : "-" )  << "]\n" ;
0495 
0496 #else
0497     std::cout << "-sreport_Creator::init_submeta.NOT:WITH_SUBMETA\n" ;
0498 
0499 #endif
0500     std::cout << "]sreport_Creator::init_submeta\n" ;
0501 }
0502 
0503 /**
0504 sreport_Creator::init_subcount
0505 --------------------------------
0506 
0507 1. create report->subcount from subfold array counts
0508 
0509 **/
0510 
0511 inline void sreport_Creator::init_subcount()
0512 {
0513     std::cout << "[sreport_Creator::init_subcount\n" ;
0514     report->subcount   = fold_valid ? fold->subfold_summary("subcount",   ASEL, BSEL) : nullptr ;
0515     std::cout << "-sreport_Creator::init_subcount :[" << ( report->subcount ? report->subcount->stats() : "-" ) << "]\n" ;
0516     std::cout << "]sreport_Creator::init_subcount\n" ;
0517 }
0518 
0519 
0520 inline std::string sreport_Creator::desc() const
0521 {
0522     std::stringstream ss ;
0523     ss << "[sreport_Creator.desc" << std::endl
0524        << desc_fold()
0525        << ( VERBOSE ? desc_fold_detail() : "" )
0526        << ( VERBOSE ? desc_run() : "" )
0527        << "]sreport_Creator.desc" << std::endl
0528        ;
0529     std::string str = ss.str() ;
0530     return str ;
0531 }
0532 
0533 inline std::string sreport_Creator::desc_fold() const
0534 {
0535     std::stringstream ss ;
0536     ss << "[sreport_Creator.desc_fold" << std::endl
0537        << "fold = NPFold::LoadNoData(\"" << dirp << "\")" << std::endl
0538        << "fold " << ( fold ? "YES" : "NO " )  << std::endl
0539        << "fold_valid " << ( fold_valid ? "YES" : "NO " ) << std::endl
0540        << "]sreport_Creator.desc_fold" << std::endl
0541        ;
0542     std::string str = ss.str() ;
0543     return str ;
0544 }
0545 
0546 inline std::string sreport_Creator::desc_fold_detail() const
0547 {
0548     std::stringstream ss ;
0549     ss
0550        << "[sreport_Creator.desc_fold_detail " << std::endl
0551        << ( fold ? fold->desc() : "-" ) << std::endl
0552        << "]sreport_Creator.desc_fold_detail " << std::endl
0553        ;
0554     std::string str = ss.str() ;
0555     return str ;
0556 }
0557 
0558 inline std::string sreport_Creator::desc_run() const
0559 {
0560     std::stringstream ss ;
0561     ss << "[sreport_Creator.desc_run" << std::endl
0562        << ( run ? run->sstr() : "-" ) << std::endl
0563        << ".sreport_Creator.desc_run.descMetaKVS " << std::endl
0564        << ( run ? run->descMetaKVS() : "-" ) << std::endl
0565        << "]sreport_Creator.desc_run" << std::endl
0566        ;
0567     std::string str = ss.str() ;
0568     return str ;
0569 }
0570 
0571 
0572 
0573 
0574 int main(int argc, char** argv)
0575 {
0576     char* argv0 = argv[0] ;
0577     const char* dirp = argc > 1 ? argv[1] : U::PWD() ;
0578     if(dirp == nullptr) return 0 ;
0579     bool is_executable_sibling_path = U::IsExecutableSiblingPath( argv0 , dirp ) ;
0580 
0581     std::cout
0582        << "[sreport.main"
0583        << "  argv0 " << ( argv0 ? argv0 : "-" )
0584        << " dirp " << ( dirp ? dirp : "-" )
0585        << " is_executable_sibling_path " << ( is_executable_sibling_path ? "YES" : "NO " )
0586        << std::endl
0587        ;
0588 
0589     if( is_executable_sibling_path == false )  // not in eg ALL3_sreport directory
0590     {
0591         U::SetEnvDefaultExecutableSiblingPath("SREPORT_FOLD", argv0, dirp );
0592         std::cout << "[sreport.main : CREATING REPORT " << std::endl ;
0593 
0594         std::cout << "[sreport.main : creator " << std::endl ;
0595         sreport_Creator creator(dirp);
0596         std::cout << "]sreport.main : creator " << std::endl ;
0597         std::cout << "[sreport.main : creator.desc " << std::endl ;
0598         std::cout << creator.desc() ;
0599         std::cout << "]sreport.main : creator.desc " << std::endl ;
0600         if(!creator.fold_valid) return 1 ;
0601 
0602         sreport* report = creator.report ;
0603         std::cout << "[sreport.main : report.desc " << std::endl ;
0604         std::cout << report->desc() ;
0605         std::cout << "]sreport.main : report.desc " << std::endl ;
0606         report->save("$SREPORT_FOLD");
0607         std::cout << "]sreport.main : CREATED REPORT " << std::endl ;
0608 
0609         if(getenv("CHECK") != nullptr )
0610         {
0611             std::cout << "[sreport.main : CHECK LOADED REPORT " << std::endl ;
0612             sreport* report2 = sreport::Load("$SREPORT_FOLD") ;
0613             std::cout << report2->desc() ;
0614             std::cout << "]sreport.main : CHECK LOADED REPORT " << std::endl ;
0615         }
0616 
0617     }
0618     else
0619     {
0620         std::cout << "[sreport.main : LOADING REPORT " << std::endl ;
0621         sreport* report = sreport::Load(dirp) ;
0622         std::cout << report->desc() ;
0623         std::cout << "]sreport.main : LOADED REPORT " << std::endl ;
0624     }
0625 
0626     std::cout
0627        << "]sreport.main"
0628        << std::endl
0629        ;
0630 
0631     return 0 ;
0632 }
0633