0
I’m trying to make a simple code in c++ which aims to run 1 million PL (linear programming) with the gurobi optimizer using MPI parallel processing.
The problem is that when using MPI and Gurobi (student version) together, for some reason the program stops running correctly. So, I debugged the program, commented line by line and found that the problem comes when I try to create the environment of gurobi env = new Grbenv();. Below I put a part of the code. In the code, I simply play on the screen the number of the process, however, when I try to create the environment of the gurobi, the program no longer works, it does not of the error, but it seems that it stands in stand-by for about 5 seconds and finishes, and the correct procedure would be to play on the screen the number of processes. In the code below, supposedly creating the environment of the gurobi is meaningless, since I’m not optimizing anything, but it should work anyway. Implementation of optimization will be the next step.
Has anyone ever seen anything like it?
#include "mpi.h"
#include "gurobi_c++.h"
void main(){
GRBEnv *env = 0;
// cria um ambiente para o gurobi.
env = new GRBEnv();
int NumProcs, NumId;
MPI_Init(NULL, NULL);
MPI_Comm_size(MPI_COMM_WORLD, &NumProcs);
MPI_Comm_rank(MPI_COMM_WORLD, &NumId);
cout << NumProcs;
MPI_Finalize();
}
Hello. Welcome(a) to SOPT. This site is not a forum. Do the [tour] and read [Ask]. Then edit your question to provide details of your difficulty. Otherwise, no one can help you.
– Luiz Vieira
you can compile some program using only the gurobi ?
– Felipe
@Felipe with you, I’ve been using Gurobi for some time.. I can also run programs only with MPI.. The problem seems to me that eh when the two are together.
– GLMF