Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

ModelUtil.connect(solverHost, solverPort);

Please login with a confirmed email address before reporting spam

Hi everyone,
I try to compair the results of two solvers running in parallel on two different comsol-servers.
Therefor I try to establish a link from my Java-API to two comsol server. But only one connection will be established. Can someone give me a hint to find a workaround?
Any help is warmly welcome!

Thanks
Matthias

My Java-code :

public class StartPoint {
public static void main(String[] args) {
Thread a = new Thread(new MultiTest("localhost",2036));
Thread b = new Thread(new MultiTest("localhost",2040));
a. start();
b. start();
}
}


class MultiTest implements Runnable
{
private String solverHost;
private int solverPort;
public MultiTest(String solverHost,int solverPort){
this.solverHost=solverHost;
this.solverPort=solverPort;
}
public void run(){
System.out.println("try: "+solverPort);
ModelUtil.connect(solverHost, solverPort);
System.out.println("done: "+solverPort);
}
}


The output:
try: 2036
try: 2040
done: 2036

1 Reply Last Post 2012年10月25日 GMT-4 11:18
COMSOL Moderator

Hello Matthias Juettner

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2012年10月25日 GMT-4 11:18
Starting 2 Java-VMs an establishing a connection between them was the only way to solve the problem!
Starting 2 Java-VMs an establishing a connection between them was the only way to solve the problem!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.