Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running MOVES using a non-default port #75

Open
Hanisek opened this issue Jul 13, 2024 · 6 comments
Open

Running MOVES using a non-default port #75

Hanisek opened this issue Jul 13, 2024 · 6 comments

Comments

@Hanisek
Copy link

Hanisek commented Jul 13, 2024

I am having issues assigning a port to MOVES (other than 3306) - I specified a random port in MySQL.txt under the root folder (in this case it is ). I made sure it was available, and it is the same port that MariaDB was launched (in my.cnf), and the base database was imported. No matter how I change the number of the random port, it seems to be sticking with 13131 (which I really do not understand and this value does not mean anything to me).. Is MOVES by default using 13131 (looks like 13132 is also used) - otherwise any guess what went wrong?

PS I tried two ways of writing MySQL.txt and they generated the same results: port ID only, and port ID with a line break at the end.

@Hanisek
Copy link
Author

Hanisek commented Jul 13, 2024

My MOVES folder and xml files in case they are needed. I removed the subfolders in MOVES (too large to upload) but I kept the other files in the root. I was using the sh file to run under Linux.
mm401.zip
xml.zip

@Hanisek
Copy link
Author

Hanisek commented Jul 15, 2024

To add to my question - I am trying to run MOVES on a supercomputing cluster, where I noticed that I cannot do that if multiple jobs are assigned to the same node (likely due to the conflict of port). I am just wondering if I need to use the worker feature instead (not sure if that will work though).

@danielbizercox
Copy link
Collaborator

The issue that you are describing is not actually with MariaDB's port, but with a port MOVES Main is using. You can only ever have one MOVES Main running on a single computer. The way MOVES enforces this is by binding to port 13131. If port 13131 is already bound by a process, the process that you are launching knows there's already another MOVES Main process running, so it quits with an error message. For more information on MOVES architecture, please see section 5 of the MOVES Overview Report.

Tips For Faster MOVES Runs contains information on how to use MOVES workers. Additionally, it has tips on how to split up your RunSpecs. For example, you can take one large RunSpec and run it on one node / VM / computer, or you can split that large RunSpec into multiple smaller RunSpecs and run those simultaneously on separate nodes / VMs / computers. This will have much better performance, because smaller MOVES runs are faster and they can be run in parallel. For ease of post-processing, you can group the multiple output databases for the separate runs into a single database using Output Grouper Tool.

@Hanisek
Copy link
Author

Hanisek commented Jul 15, 2024

Thanks Daniel. To further clarify - I was not trying to run multiple moves on the same computer but the jobs we submitted could be assigned to multiple cores across the same node (on the supercomputing cluster). I read about the MOVES workers before but I never get to truly understand it.. My question is 1) is there any way I can change the default port that MOVES Main uses (efficiency is not my bottleneck - the ability to run on a different port can really help), and 2) can I essentially have the ability to run multiple instances of MOVES if I use the MOVES workers and the sharedDistributedFolderPath?

Thanks again for your prompt reply!

@danielbizercox
Copy link
Collaborator

MOVES will use whatever port you specify in MySQL.txt when connecting to the MariaDB database. Therefore, you will want to make sure that the port in MySQL.txt matches the port in MariaDB's my.ini (Windows) or my.conf (Linux). If the port is incorrectly set, you'll see the following behavior:

  • Opening the GUI will result in a popup box asking for MariaDB's connection details
  • Starting a run on the command line will immediately result in the following error message: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

However, what you are describing sounds like what MOVES does when you try to run multiple MOVES Main processes at the same time on the same computer (node). MOVES is not designed to be run in this way because the main process is not sandboxed--if you run multiple main processes, they will all be using the same execution database, temporary directory, cache, etc., and the runs will interfere with each other.

To prevent multiple instances of MOVES Main from running at the same time, it binds to port 13131. You'll know that you're running into this issue (having multiple instances of MOVES Main running at the same time) because you'll get this error message: ERROR: MOVES was unable to bind to 13131.

This port is not user configurable. And even if you could change it so that each instance was using a different port, your runs would error out because the instances would interfere with each other. This is why you can only have one instance of MOVES Main running per computer (node).

You can use multiple MOVES Workers per computer (node), but the number of workers is not a bottleneck for most MOVES runs. We generally do not see any improvement beyond 3 workers per onroad run. The sharedDistributedFolderPath can be used if you want to run MOVES Workers on other nodes, but again, this has limited effect.

@danielbizercox
Copy link
Collaborator

We have updated our documentation on how to run MOVES in parallel on multiple computers / virtual machines / nodes / etc. Hopefully this helps with your issue: https://github.com/USEPA/EPA_MOVES_Model/blob/master/docs/TipsForFasterMOVESRuns.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants