Originally posted by: Demétrios
Dear All,
I'm using the IBM ILOG CPLEX Optimization Studio V12.5 linux version. And I'm using Callable Library on C language. I'm trying to parallel my application using Threads. I'm following the steps described on this site:
http://web.njit.edu/all_topics/Prog_Lang_Docs/cplex80/doc/userman/html/moreUsing28.html#1006792
But, It's not working, i.e., the number of threads set in CPX_PARAM_THREADS is not running. I can follow the steps described on this site:
http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r2/index.jsp?topic=%2Filog.odms.cplex.help%2FContent%2FOptimization%2FDocumentation%2FCPLEX%2F_pubskel%2FCPLEX934.html
If I use CPXsetintparam(env,CPX_PARAM_LPMETHOD, CPX_ALG_CONCURRENT) the parallelism works. But, in this case the CPLEX uses 3 different algorithms. And I need to parallelize just the primal simplex algorithm.
A piece of my code:
env = CPXopenCPLEX (&status);
if ( env == NULL ) {
char errmsg[CPXMESSAGEBUFSIZE];
fprintf (stderr, "Could not open CPLEX environment.\n");
CPXgeterrorstring (env, status, errmsg);
fprintf (stderr, "%s", errmsg);
goto TERMINATE;
}
status = CPXsetintparam (env, CPX_PARAM_SCRIND, CPX_OFF);
if ( status ) {
fprintf (stderr,
"Failure to turn on screen indicator, error %d.\n", status);
goto TERMINATE;
}
status = CPXsetintparam (env, CPX_PARAM_DATACHECK, CPX_ON);
if ( status ) {
fprintf (stderr,
"Failure to turn on data checking, error %d.\n", status);
goto TERMINATE;
}
lp = CPXcreateprob (env, &status, "lpex1");
if ( lp == NULL ) {
fprintf (stderr, "Failed to create LP.\n");
goto TERMINATE;
}
status = CPXsetintparam (env, CPX_PARAM_THREADS, 12);
if ( status ) {
fprintf (stderr,
"Failure to set the number of threads, error %d.\n", status);
goto TERMINATE;
}
status = CPXsetintparam (env, CPX_PARAM_PARALLELMODE, CPX_PARALLEL_DETERMINISTIC);
if ( status ) {
fprintf (stderr,
"Failure to set the parallel mode, error %d.\n", status);
goto TERMINATE;
}
status = populatebynonzero (env, lp,argc,argv);
if ( status ) {
fprintf (stderr, "Failed to populate problem.\n");
goto TERMINATE;
}
status = CPXsetintparam (env, CPX_PARAM_ITLIM, 5000);
if ( status ) {
fprintf (stderr,
"Failed to set the optimization method, error %d.\n", status);
goto TERMINATE;
}
status = CPXprimopt(env, lp);
if ( status ) {
fprintf (stderr, "Failed to optimize LP.\n");
goto TERMINATE;
}
status = CPXgetobjval (env, lp,&objval);
if ( status ) {
fprintf (stderr, "Failed to obtain solution.\n");
goto TERMINATE;
}
so, What am I doing wrong?
#CPLEXOptimizers#DecisionOptimization