Code Monkey home page Code Monkey logo

Comments (6)

msrocka avatar msrocka commented on August 11, 2024

Mmh, this is just a debug log message, not an error message and not a message regarding the calculation. Without more details (server setup, native libraries loaded or not, database, what does not work) it is hard to say something.

from olca-modules.

pedroripper avatar pedroripper commented on August 11, 2024

Hi @msrocka. Thank you for your response and sorry for the delay.

I am starting the server running the following line in my terminal

.\ipc-server.cmd ecoinvent_v3_10_Consequential_Unit_Processes_2024_01_22_rodolpho

After that, I run something similar the example below (which runs into the same problem).

It never prints the "Finished" string, so it is probably something wrong in the calculation part.

import olca_ipc
import olca_schema

client = olca_ipc.Client(8080)

group = olca_schema.new_unit_group('Mass units', 'kg')
mass = olca_schema.new_flow_property('Mass', group)
client.put_all(group, mass)

concrete = client.get(olca_schema.Flow, 'ef5d9b7f-0d4a-49b9-a2eb-eef36ded1c38')
steel = client.get(olca_schema.Flow, '0c826417-e870-4c43-95c4-b38ff2ff47d2')

output_product = olca_schema.new_product("MyProduct", mass)
client.put(output_product)

process = olca_schema.new_process("MyProcess")

exchange = olca_schema.new_input(process, concrete, 10)
exchange.is_quantitative_reference = True

exchange = olca_schema.new_input(process, steel, 5)
exchange.is_quantitative_reference = True

exchange = olca_schema.new_output(process, output_product, 1)
exchange.is_quantitative_reference = True

created_process = client.put(process)

product_system = client.create_product_system(created_process)

method = client.get_descriptors(olca_schema.ImpactMethod)[0]

calculationSetup = olca_schema.CalculationSetup(
    target = product_system,
    impact_method = method,
)
print("Start calculation")
result = client.calculate(calculationSetup)
result.wait_until_ready()
print("Finished!")
impacts = result.get_total_impacts()

from olca-modules.

pedroripper avatar pedroripper commented on August 11, 2024

Hi @msrocka !

I was wondering if you had time to look at my example.

Thanks!

from olca-modules.

msrocka avatar msrocka commented on August 11, 2024

The script works for me (but it should not create mass and a unit group but should instead get it from the database like it is done for the linked products). What is missing currently in the server startup script is the loading of the calculation libraries, the calculation then takes quite some time. The -native parameter needs to be set to a location where the calculation libraries can be found (it is described in the ipc-doc). If the script is started from a current MKL version it should point to the installation folder; something like

%java% -Xmx3584M -cp * org.openlca.ipc.Server -timeout 30 -native %script_dir%\.. -db %1

from olca-modules.

pedroripper avatar pedroripper commented on August 11, 2024

Hi @msrocka ! Thank you so much for your response.

I understand that I have to point the calculation libraries folder. But I am having trouble to find it.

Shouldn't it be inside the database? I am getting confused because when I open the database with OpenLCA, there is a folder (that seems to be inside the database) with the methods. However, when I double click on the database, this is what I see

image

from olca-modules.

pedroripper avatar pedroripper commented on August 11, 2024

Also, if it is not too much trouble, could you send me a command example (with all the necessary parameters) that I should run in order for my code to work?

from olca-modules.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.