Changeset 13460


Ignore:
Timestamp:
Sep 12, 2019 12:29:50 PM (3 months ago)
Author:
Christian Andersson
Message:

Minor update to the evaluator connection. Related to ticket:5837

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-evaluator/Compiler/ModelicaFrontEnd/src/java/org/jmodelica/common/evaluation/ExternalProcessCacheImpl.java

    r13449 r13460  
    4646   
    4747    private String getSharedLibrary(External<K> ext) {
    48         /* Messy messy... */
     48        /* Messy messy... Please fix me...*/
    4949        String sharedLib = "";
    5050        final String extName = ext.getName();
     
    9393        add("ModelicaStrings_substring");
    9494        add("ModelicaStrings_length");
    95         add("item3");
     95        add("ModelicaStrings_skipWhiteSpace");
    9696    }};
    9797   
     
    126126        arguments.add(inputArguments);
    127127        /* TODO:
    128          * Verify that the actual inputs/outputs are supported
     128         * Verify that the actual inputs/outputs are supported (not sure how to best do that)!
    129129         */
    130130       
     
    143143                String executable = null;
    144144                ArrayList<String> arguments = new ArrayList<String>();
     145                String debugMsg = "";
    145146                if (canUseEvaluator(ext, arguments)) {
    146147                    String jmHome = System.getenv("JMODELICA_HOME");
     
    151152                    arguments.add(0, executable); /* Needs to be first */
    152153                   
    153                     mc.log().debug("Using pre-compiled evaluator for outputs: '" + getOutputArguments(ext) + "' and inputs: '" + getInputArguments(ext) +"'");
     154                    debugMsg = "Succesfully connected external function '" + ext.getName() + "' to the evaluator '"
     155                            + executable + "' with outputs: '" + getOutputArguments(ext) + "' and inputs: '" + getInputArguments(ext) + "'";
    154156                } else {
    155157                    executable = mc.compileExternal(ext);
     158                    debugMsg = "Succesfully compiled external function '" + ext.getName() + "' to executable '"
     159                            + executable + "' code for evaluation";
    156160                }
    157161                arguments = arguments.size() == 0 ? null : arguments; /* Can likely be made better...*/
     
    162166                }
    163167                time = System.currentTimeMillis() - time;
    164                 mc.log().debug("Succesfully compiled external function '" + ext.getName() + "' to executable '"
    165                         + executable + "' code for evaluation, time: " + time + "ms");
     168                mc.log().debug(debugMsg +", time: " + time + "ms");
    166169            } catch (FileNotFoundException e) {
    167170                ef = failedEval(ext, "c-code generation failed '" + e.getMessage() + "'", true);
     
    294297        public void evaluate(External<K> ext, Map<K, V> values, int timeout, ProcessCommunicator<V, T> com)
    295298                throws IOException {
    296             long time = System.currentTimeMillis();
    297             log().debug("Evaluating external function: " + ext.getName());
    298299            com.startTimer(timeout);
    299300            com.check("EVAL");
     
    308309            com.accept("READY");
    309310            com.cancelTimer();
    310             time = System.currentTimeMillis() - time;
    311             log().debug("Finished evaluating external function, time: " + time + "ms");
    312311        }
    313312
Note: See TracChangeset for help on using the changeset viewer.