Remove unneeded OpenSHA logging

Bug #888013 reported by Damiano Monelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Undecided
Anton Gritsay

Bug Description

When using a source model with a fault, and CY_2008_AttenRel, the Celery log is flooded by OpenSHA log messages like:

Region:
-9.16622627809039 1.1126727559689504E-15 3.0
-0.17302038231266684 1.6520326546233854E-18 3.0
-0.1640271764168891 1.6520318919295388E-18 3.0
-0.1550339705211114 1.6520311699370934E-18 3.0
-0.14604076462533366 1.6520304886459603E-18 3.0
-0.13704755872955593 1.652029848056055E-18 3.0
-0.12805435283377822 1.6520292481672992E-18 3.0
-0.1190611469380005 1.6520286889796181E-18 3.0
-0.11006794104222278 1.652028170492944E-18 3.0
8.883137954735501 -2.2186463928843316E-15 3.0
8.77306949335472 9.10056940473936 3.0
-9.05259163683597 9.107594032381712 3.0
Projected Trace:
-9.157233072194613 1.1126446305573884E-15 3.0
-0.1640271764168891 1.6520318919295388E-18 3.0
-0.1550339705211114 1.6520311699370934E-18 3.0
-0.14604076462533366 1.6520304886459603E-18 3.0
-0.13704755872955593 1.652029848056055E-18 3.0
-0.12805435283377822 1.6520292481672992E-18 3.0
-0.1190611469380005 1.6520286889796181E-18 3.0
-0.11006794104222278 1.652028170492944E-18 3.0
-0.10107473514644504 1.6520276927072123E-18 3.0
8.892131160631276 -2.2187008906796204E-15 3.0
Region:
-9.157233072194613 1.1126446305573884E-15 3.0
-0.1640271764168891 1.6520318919295388E-18 3.0
-0.1550339705211114 1.6520311699370934E-18 3.0
-0.14604076462533366 1.6520304886459603E-18 3.0
-0.13704755872955593 1.652029848056055E-18 3.0
-0.12805435283377822 1.6520292481672992E-18 3.0
-0.1190611469380005 1.6520286889796181E-18 3.0
-0.11006794104222278 1.652028170492944E-18 3.0
-0.10107473514644504 1.6520276927072123E-18 3.0
8.892131160631276 -2.2187008906796204E-15 3.0
8.781949492161544 9.10078904044293 3.0
-9.043711806948261 9.107367344452205 3.0
Projected Trace:
-9.148239866298836 1.1126165339802862E-15 3.0
-0.1550339705211114 1.6520311699370934E-18 3.0
-0.14604076462533366 1.6520304886459603E-18 3.0
-0.13704755872955593 1.652029848056055E-18 3.0
-0.12805435283377822 1.6520292481672992E-18 3.0
-0.1190611469380005 1.6520286889796181E-18 3.0
-0.11006794104222278 1.652028170492944E-18 3.0
-0.10107473514644504 1.6520276927072123E-18 3.0
-0.09208152925066732 1.6520272556223641E-18 3.0
8.901124366527055 -2.218755445814568E-15 3.0
Region:
-9.148239866298836 1.1126165339802862E-15 3.0
-0.1550339705211114 1.6520311699370934E-18 3.0
-0.14604076462533366 1.6520304886459603E-18 3.0
-0.13704755872955593 1.652029848056055E-18 3.0
-0.12805435283377822 1.6520292481672992E-18 3.0
-0.1190611469380005 1.6520286889796181E-18 3.0
-0.11006794104222278 1.652028170492944E-18 3.0
-0.10107473514644504 1.6520276927072123E-18 3.0
-0.09208152925066732 1.6520272556223641E-18 3.0
8.901124366527055 -2.218755445814568E-15 3.0
8.790829485512653 9.101008907131302 3.0
-9.034831971431464 9.107140888316623 3.0

This messages are unneeded and slow down the calculation. By exploring the source code,
I found that this messages comes from the DistanceX_Parameter.java class (https://github.com/gem/OpenSHA/blob/master/java/org/opensha/sha/imr/param/PropagationEffectParams/DistanceX_Parameter.java).

In the current implementation a boolean flag (line 58) is set to true:

    /** If true debug statements are printed out */
    protected final static boolean D = true;

when D is true the following messages are printed :

                // write these out if in debug mode
                if (D) {
                    System.out.println("Projected Trace:");
                    for (int l = 0; l < locsForExtendedTrace.size(); l++) {
                        Location loc = locsForExtendedTrace.get(l);
                        System.out.println(loc.getLatitude() + "\t"
                                + loc.getLongitude() + "\t" + loc.getDepth());
                    }
                    System.out.println("Region:");
                    for (int l = 0; l < locsForRegion.size(); l++) {
                        Location loc = locsForRegion.get(l);
                        System.out.println(loc.getLatitude() + "\t"
                                + loc.getLongitude() + "\t" + loc.getDepth());
                    }
                }

Setting D = false, should solve the issue and avoid printing this data to the log file

I attach the input files to reproduce the bug.

Revision history for this message
Damiano Monelli (monelli) wrote :
Anton Gritsay (angri)
Changed in openquake:
assignee: nobody → Anton Gritsay (angri)
status: New → In Progress
Revision history for this message
Anton Gritsay (angri) wrote :
Anton Gritsay (angri)
Changed in openquake:
status: In Progress → Fix Committed
John Tarter (toh2)
Changed in openquake:
milestone: none → 0.4.6
Changed in openquake:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.