I'm setting up a parallel optimisation environment using IBM CPLEX 12.9, Julia Language v1.1.0 and JuMP. To start a local optimisation I'm currently using the library CPLEX.jl that provides the connection (using C calls on background) to optimise some model locally. Let's call this machine A.
However, I'm trying to start an optimisation in a remote machine which means that when I start an optimisation on A, Julia will call the CPLEX installed on the machine B (which has more memory, cpus, etc).
Looking the CPLEX documentation I've seen that for a local optimisation we call the function
CPXopenCPLEX(int * status_p)
given by the lib libcplex1290.so. For a remote connection, CPLEX provides another interface to connect to external servers by the function
CPXopenCPLEXremote(char const * transport, int argc, char const *const * argv, int * status_p)
The package CPLEX.jl supports only local optimisation and it uses the CPXopenCPLEX() function. Looking for this package, the connection with the local CPLEX installation is made by the following command:
ccall(("CPXopenCPLEX",libcplex),Ptr{Cvoid}, (Ptr{Cint},),stats)
where libcplex="/opt/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290.so", and stats is an Array{Int32,1}. This command is found at the file cpx_env.jl of the package CPLEX.jl.
What I've tried is to implement a similar function that will call CPXopenCPLEXremote insteat of CPXopenCPLEX with the correct values. My Julia1.1 code is the following:
const libcplex = "/opt/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/libcplex1290remote.so"
argv=["/usr/bin/ssh", "IP_OF_REMOTE_MACHINE","/opt/ibm/ILOG/CPLEX_Studio129/cplex/bin/x86-64_linux/cplex", "-worker=process"]
ret= ccall(("CPXopenCPLEXremote",libcplex),Ptr{Cvoid}, (Ptr{Cchar},Cint,Ptr{Ptr{Cchar}},Ptr{Cint},),"processtransport",Int32(4),argv,stats)
The problem is ret=Ptr{Nothing} @0x0000000000000000 with means that the connection did not succedd.
I'm quite sure that the problem is in the way that I'm giving the arguments to ccall() to call CPXopenCPLEXremote.
Could someone with experience in this tye of call help me with the parameters?
I'm also configuring an automatic identification for the ssh connection. For now I've to inform my user and password on each ssh connection from the machine A to the remote machine B. (I'll update this question later)
Thank you all for any help.If it works, I'm going to create the lib CPLEXremote.jl for the community.
best regards, Isaias
status_p
after the call toCPXXopenCPLEXremote
? That may give you an error code that will help diagnose the issue. In case you haven't seen it, there is extensive documentation about remote object here. – rkersh