Menu

#21 Failure when switching to evaluationTree_OpenMP

v1.0_(example)
open
nobody
None
1
2018-06-21
2018-06-20
Jaime Souza
No

Hello,

I need to use external functions but it is not posible to change the evaluationMode configuration parameter. I have tried both possiblities:
simulation.EvaluationMode = eEvaluationTree_OpenMP
cfg.SetString('daetools.core.equations.evaluationMode', 'evaluationTree_OpenMP')
Without success.

My DAETools version is daetools-1.8.0-py3.6-macosx-10.6-intel.egg.

I get the following error with the Tutorial 14:

python tutorial14.py console
Traceback (most recent call last):
  File "tutorial14.py", line 323, in <module>
    run(guiRun=guiRun)
  File "tutorial14.py", line 306, in run
    cfg.SetString('daetools.core.equations.evaluationMode', 'evaluationTree_OpenMP')
Boost.Python.ArgumentError: Python argument types in
    daeConfig.SetString(daeConfig, str, str)
did not match C++ signature:
    SetString(daeConfig {lvalue} self, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > propertyPath, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > {lvalue} value)

And with Tutorial 21:

python tutorial21.py console
Traceback (most recent call last):
  File "tutorial21.py", line 68, in <module>
    from daetools.pyDAE.evaluator_opencl import pyEvaluator_OpenCL
  File "/Users/jaimenms/PycharmProjects/study-daetools/.venv/lib/python3.6/site-packages/daetools-1.8.0-py3.6-macosx-10.6-intel.egg/daetools/pyDAE/evaluator_opencl.py", line 14, in <module>
    import pyEvaluator_OpenCL
ModuleNotFoundError: No module named 'pyEvaluator_OpenCL'

Maybe there are missing libraries in the MacOs package. As the 1.8.0 source code is not available for Download, I could not confirm it.

Regards

Jaime Souza

Discussion

  • ciroki

    ciroki - 2018-06-20

    Hi Jaime,

    Issue 1. I checked on my machine and both ways work. When you use:

    simulation.EvaluationMode = eEvaluationTree_OpenMP
    

    what error you get?

    Also, please try this and let me know if it works:

    eMode = 'evaluationTree_OpenMP'
    cfg.SetString('daetools.core.equations.evaluationMode', eMode)
    

    Issue 2. You are right: OpenCL implementation of the Compute Stack Evaluator is not available for macOS. if I can recall correctly, I had some problems with the OpenCL runtime installation so it couldn't be compiled. I'll check if it can be fixed in the new release.

    Cheers
    Dragan

     
  • ciroki

    ciroki - 2018-06-20

    My bad, please try this:
    propertyPath = 'daetools.core.equations.evaluationMode'
    eMode = 'evaluationTree_OpenMP'
    cfg.SetString(propertyPath, eMode)
    It could be a problem with the way the functions in the extension module are defined.

    Dragan

     
  • Jaime Souza

    Jaime Souza - 2018-06-20

    For the:

    simulation.EvaluationMode = eEvaluationTree_OpenMP
    

    I get:

    >       simulation.EvaluationMode = eEvaluationTree_OpenMP
    E       NameError: name 'eEvaluationTree_OpenMP' is not defined
    

    And for the

    eMode = 'evaluationTree_OpenMP'
    cfg.SetString('daetools.core.equations.evaluationMode', eMode)
    

    I get:

            eMode = 'evaluationTree_OpenMP'
    >       cfg.SetString('daetools.core.equations.evaluationMode', eMode)
    E       Boost.Python.ArgumentError: Python argument types in
    E           daeConfig.SetString(daeConfig, str, str)
    E       did not match C++ signature:
    E           SetString(daeConfig {lvalue} self, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > propertyPath, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > {lvalue} value)
    
     
  • ciroki

    ciroki - 2018-06-20

    eEvaluationTree_OpenMP is defined in pyCore. Thus, the line below:

    simulation.EvaluationMode = eEvaluationTree_OpenMP
    

    should work provided that the pyCore module has been successfully imported. Can you check if it is imported?

    Dragan

     
  • Jaime Souza

    Jaime Souza - 2018-06-20

    Yes it is. My first line is:

    from daetools.pyDAE import *
    
     
  • ciroki

    ciroki - 2018-06-20

    Well, strange. Do other flags work, i.e. those for distributed equations boundaries: eOpenOpen etc.? I checked, they are all defined in the same module (pyCore).

     
  • Jaime Souza

    Jaime Souza - 2018-06-20

    Yes. It is all working. Except the things that are related to EvaluationMode.

    My guess is that this 1.8.0 MacOS is actually a 1.7.3.

     
  • ciroki

    ciroki - 2018-06-20

    Well, could be, I will check.

     
  • ciroki

    ciroki - 2018-06-20

    Judging by the dates, the files appear to be from 1.7.3. I'll double check, perhaps I copied old extension modules.

     
  • ciroki

    ciroki - 2018-06-20

    Yes, the extension modules are from 1.7.3, indeed. I will upload the new version now.

     
  • Jaime Souza

    Jaime Souza - 2018-06-21

    Great. Now it is working. Thanks.

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB