Dear Michael

I truly appreciate your time and effort. Many thanks for your clear comments.

If possible please delete the entire thread.

Best regards;

Hossein

On Mon, Jan 5, 2015 at 8:38 PM, Michael Bussieck wrote:

Hossein,

I can not delete an individual attachment. I can only delete the entire thread. Which I can do on your request.

mymodel.threads=n; indicates the solver that eventually gets the model instance (solve mymodel …) to use n threads to solve the model. It’s up to the solver how to use the number of threads. E.g. Cplex may start with a concurrent LP to solve the root node and then use the threads to process multiple nodes simultaneously. A solver may not do anything in parallel. It’s also hard to see the multiple threads in action. Usually the solver log indicates the use of multiple threads. Here the Cplex log on a MIP with threads=4:

…

MIP search method: dynamic search.

Parallel mode: deterministic, using up to 4 threads.

…

Since there are many places where the MIP codes works sequential (e.g. presolve, probing, …) just looking at the task manager won’t really tell you much. If you are deep in the B&B tree you should see the CPU column go above 100/#cores for your GAMS/Cplex job (look for gmsgennx.exe). The default parallelmode in GAMS/Cplex is deterministic meaning Cplex needs some synchronization points and that reduces the level of parallelism. With the grid facility you manage the solve jobs yourselves and you should see multiple GAMS/Cplex jobs running in the task manager (again look for gmsgennx.exe). You can combine the two. For example, you can manage to run four solve jobs in parallel using the grid facility each using 2 threads on a 8 core machine, or you run two jobs and each job uses 4 threads. The best setting all depends on the problems characteristics. Hence, there is no simple answer to the question “How can I set the solver (CPLEX) to use the maximum available threads and RAM to speed up solution process?”.

Hope this helps,

Michael Bussieck - GAMSWorld Coordinator

On Monday, January 5, 2015 11:12:40 AM UTC-5, Hossein wrote:

Dear Michael

Many thanks for your valuable comments.

I have one request and one other question. would you please study them

Request: The attached code files in the previous post are very critical for me. So, If possible, please remove the attached code in the previous post from the group forums.

Question:

I want to dedicate the maximum possible threads of my computer to the GAMS solver. My model is MIP. I run my code in Grid computing environment. I set model option as follows:

modelname.threads=0;

It means the model can use all available cores. However I have some questions.

What is the relationship between this option (modelname.threads) and grid computing environment? â€˜McCarl Expanded GAMS Userâ€™explains â€œNote that this does not alter the cores used in Grid computing.â€ about modelname.threads option.

How can I set the solver (CPLEX) to use the maximum available threads and RAM to speed up solution process?

How can I monitor it? I monitored its process via task manager in windows but most of the time CPU and memory usage was below the %40 and %30 respectively. My laptop is core i7 with 8Gb RAM

Thanks in advance;

Regards;

Hossein

On Mon, Jan 5, 2015 at 7:15 PM, Michael Bussieck wrote:

I was mistaken. Cplex can violate bounds by eprhs and still consider the problem feasible (search for bound infeasibilitye in http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.2.0/ilog.odms.cplex.help/Content/Optimization/Documentation/CPLEX/_pubskel/CPLEX433.html). In case the model is degenerate a variable can be basic and (almost) at bound. In this case Cplex computes the value of the variable using the (inverse of the) basis matrix and this calculation might result into a number on the “wrong” side of the bound. I don’t think there is much you can do other than tightening the eprhs tolerance. NLP solvers work a little differently, they will obey the bound because the variable might be used in function argument that has a restricted domain (e.g. sqrt).

Best,

Michael Bussieck - GAMSWorld Coordinator

On Monday, January 5, 2015 5:36:42 AM UTC-5, Hossein wrote:

Dear Michael

Enclosed you can find the attachment. The solver is set to ‘automatic’ based on the cplex option (‘lpmethod=0’).

The provided code is complex and take several hours to solve in 8G RAM i7 CPU laptop (using iterative procedure). The attached log file only includes the 26th iteration of master problem.

You can review only the master problem (DCOPF_PSCM_main) which positive variables have negative values.

Please mechanically search the following line in the lst file (TESE2.lst). The ‘cur’ is positive variable.

g3 .t6 . -1.707E-6 +INF .

Moreover, some other rows in the ‘cur’ variables are also negative.

The ‘CUr(thg,PRD)’ variable has been defined as the positive variable in the gms file (TESE2.gms)

For the used algorithms, please see the following lines in the gms file (TESE2.gms):

putclose opts /‘rerun= NONO’ /‘feasopt=no’/‘lpmethod=0’/‘epopt=1e-4’/‘eprhs=1e-5’/‘advind=0’/‘preind=1’;

OPTION Savepoint=1;

If((ord(cntr) gt 5) or ((ord(FLRLP) gt 3) and (ord(cntr) gt 2)),

putclose opts /‘rerun= NONO’ /‘feasopt=no’/‘lpmethod=0’/‘epopt=1e-4’/‘eprhs=1e-5’/‘advind=1’/‘preind=1’;

Execute_loadpoint ‘DCOPF_PSCM_main_p’;);

Thanks in advance,

Regards;

Hossein

On Mon, Jan 5, 2015 at 12:43 PM, Michael Bussieck wrote:

Hmmm, this is strange. Cplex simplex obeys the bounds exactly since it is part of the algorithm. Did you solve this with barrier? Can you send log, lst, model to reproduce?

Michael Bussieck - GAMSWorld Coordinator

On Monday, January 5, 2015 3:59:22 AM UTC-5, Hossein wrote:

Dear all

I have some variables which are defined as the positive variables. However, the obtained values for these variables are negative in the optimal feasible solution. It should be noted that these negative values are smaller than the feasibility tolerance (eprhs in CPLEX) . while I declare this variables as the positive variables I expected positive value results.

Does anyway exist for solving this problem except reducing the feasibility tolerance?

Regards;

Hossein

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at http://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.