Coder Social home page Coder Social logo

Question: parallel run about ixmp HOT 14 OPEN

tzipperle avatar tzipperle commented on May 20, 2024
Question: parallel run

from ixmp.

Comments (14)

gidden avatar gidden commented on May 20, 2024

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

I have tried multiprocess with HSQLDB and I got a error. Do I need an oracle data base for parallel run?

from ixmp.

gidden avatar gidden commented on May 20, 2024

from ixmp.

danielhuppmann avatar danielhuppmann commented on May 20, 2024

If you use HSQLDB in file-based mode, only one process can access it a time. There is a way to launch an HSQLDB instance in server mode, which would allow multiple connections - but I have never tried that...

You will need a configuration file with the following, not sure what the driver should be. The url should probably be the path.

config.name = <some tag>

jdbc.driver = <??>
jdbc.url = <??>
jdbc.user = ixmp
jdbc.pwd = ixmp

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

I have also tried with the server mode. I started the server with:

java -cp ../lib/hsqldb.jar org.hsqldb.server.Server --database.0 file:message --dbname.0 xdb

And with the following config:

config.name = meassage@local

jdbc.driver.1 = org.hsqldb.jdbcDriver
jdbc.url.1 = jdbc:hsqldb:hsql://localhost/xdb
jdbc.user.1 = ixmp
jdbc.pwd.1 = ixmp

jdbc.driver.2 = org.hsqldb.jdbcDriver
jdbc.url.2 = jdbc:hsqldb:hsql://localhost/xdb
jdbc.user.2 = ixmp
jdbc.pwd.2 = ixmp

I could connect to the data base. But only one connection.

from ixmp.

danielhuppmann avatar danielhuppmann commented on May 20, 2024

Oh, so you were already on the right track. Sorry that it doesn't work as expected.

@peterkolp, any ideas?

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

Today I did a next try. I have startet a server from the installed ixmp from my conda environment.

java -cp C:\Users\anaconda3\envs\message-ghd\Lib\site-packages\ixmp\lib\hsqldb.jar org.hsqldb.server.Server --database.0 file:C:\Users\.local\ghd_server --dbname.0 ghd_server

But if I try to connect to the server, I get an error:

jpype._jexception.FlywayExceptionPyRaisable: org.flywaydb.core.api.FlywayException: Validate failed: Migration checksum mismatch for migration 1

Do you have any ideas to fix this problem?

from ixmp.

danielhuppmann avatar danielhuppmann commented on May 20, 2024

@zikolach, can you take a look?

from ixmp.

zikolach avatar zikolach commented on May 20, 2024

@tzipperle to start HSQLDB server you may use following command (same as in your comment):

java -cp ../../ixmp/lib/hsqldb.jar org.hsqldb.server.Server --database.0 file:ixmptest --dbname.0 ixmptest

To check you can connect it use following:

java -cp ../../ixmp/lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing \
    --driver org.hsqldb.jdbcDriver \
    --url jdbc:hsqldb:hsql://localhost:9001/ixmptest \
    --user ixmp \
    --password ixmp

If it succeed the JDBC URL is jdbc:hsqldb:hsql://localhost:9001/ixmptest.
Since you have migration issue - my assumption is you have done steps from above right!

Now we need to figure out why you have different checksums for migration files. You should see it in the log output as existing and new values. Using HSQLDB client you may try to change checksum in the database manually to fix it (assuming both migrations - the one previously applied and current one - have same changes differs only in formatting/line endings/etc).

Please do a backup copy of directory with database before changing anything manually!

If you attach more detailed log - we can try to figure out what exactly is the problem.

Also you may be interested in using Postgresql database. Recently we added it support (for testing purposes to the moment). But you'll need to care about data migration yourself.

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

java -cp ../../ixmp/lib/hsqldb.jar org.hsqldb.util.DatabaseManagerSwing
--driver org.hsqldb.jdbcDriver
--url jdbc:hsqldb:hsql://localhost:9001/ixmptest
--user ixmp
--password ixmp

I could not check this under windows 10. I get a error unknown driver and the log file is after the run empty.

I start with a new project without a database. It should not be a problem with the data migration

from ixmp.

zikolach avatar zikolach commented on May 20, 2024

@tzipperle please ensure the hsqldb.jar file exists in the folder at specified path ../../ixmp/lib/hsqldb.jar - you may need to change path.

If you want to try postgresql option - options for config file may look like:

jdbc.driver = org.postgresql.Driver
jdbc.url = jdbc:postgresql://localhost:5432/ixmptest
jdbc.user = ixmp
jdbc.pwd = ixmp

You'll need to create an empty DB before trying to access it or (if you familiar with Docker) use following compose file to run Postgresql instance in container:

version: "3"
services:
  db:
    image: postgres:10
    environment:
      POSTGRES_USER: ixmp
      POSTGRES_PASSWORD: ixmp
      POSTGRES_DB: ixmptest
    ports:
      - "5432:5432"
    volumes:
      - /path/on/the/host/system:/var/lib/postgresql/data

In the snippets above ixmptest is a name of database schema.

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

I had a problem with the backslash. Now I can connect to the server.

I have tried the following workflow:

  1. Deleted the old database
  2. Started the server
  3. Opened a Platform to the server
  4. Migration error

The log-file now contains the following information:

/C1/SET SCHEMA SYSTEM_LOBS
INSERT INTO BLOCKS VALUES(0,2147483647,0)
COMMIT

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

I could fix the problem with the migration. It was a problem with the conda environment. After I recreated the environment it works. @zikolach Thanks for your help.

from ixmp.

tzipperle avatar tzipperle commented on May 20, 2024

Hi @zikolach ,
I have a short question. I use a HSQLDB server and after about 1000 scenario runs the RAM usage of the process "Zulu Platform x64 Architecture" increase highly and the I get an server error.

I think I have to change the table type from memory to cached (hsqldb.default_table_type=cached). But I am not sure how I could do this.

Do you have any ideas what I can do?

from ixmp.

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.