Originally posted by: Yamaz
hi, I am trying parallel MIP with Cplex.
Recently I was learning how to make the remote object from the source code file "iloparmipopt.cpp".
I realized that the function IloCplex::userfunction can invoke a designated function in the remote object and also transport some data.
It exchanges the information between "Master" and "Worker". In the example of "iloparmipopt.cpp", the function is used like:
...
double objdiff;
...
IloCplex::Serializer s;
s.add(objdiff);
status = cplex.userfunction (USERACTION_CHANGEOBJDIFF,s.getRawLength(), s.getRawData(),0, 0, NULL);
...
However, when I modified the example and trying to transport an array, error happens. The code is something like:
...
double *x;
for (int i=0;i<10;i++)
x[i]=i;
double const *b;
b=static_cast<double const*>(x)
IloCplex::Serializer s1;
s1.add(b,10);
int status = cplex.userfunction (TRANSPORT_ARRAY,s1.getRawLength(), s1.getRawData(),0, 0, NULL);
...
Such code did not work and return the status with 1426.
I am doing this in three computers with Centos 7.4, two of which are workers. But I am sure the code above can work in Mac OS.
Does anyone can tell me what is the problem and how can I solve it to make it right in Linux?
Thank you very much.
#CPLEXOptimizers#DecisionOptimization