Open krislock opened 4 months ago
I was able to get past the segmentation fault by changing AlpsKnowledgeBroker()
to AlpsKnowledgeBroker(model)
in Alps/src/AlpsKnowledgeBrokerMPI.h
as follows:
AlpsKnowledgeBrokerMPI(int argc,
char* argv[],
AlpsModel& model,
bool showBanner = true)
:
AlpsKnowledgeBroker(model)
{
init();
initializeSearch(argc, argv, model, showBanner);
}
Note that this was using Alps@2.0
which does not have #include "#include "mpi.h""
in Alps/configure
.
I built Alps as follows:
export MPIINCDIR=<directory containing mpi.h>
export MPILIB="$(pkg-config --libs ompi)"
export MPICC=mpicc
export MPICXX=mpiCC
./coinbrew fetch Alps@2.0
Alps/src/AlpsKnowledgeBrokerMPI.h
as mentioned above../coinbrew --tests none build Alps --enable-static --disable-shared
Sorry for the delay and for these issues, I have not been using Alps with MPI in some time. I did try to get BLIS running with MPI fairly recently and was successful eventually, but only with an older version I believe. There is some discussion at https://github.com/coin-or/CHiPPS-BLIS/discussions/10. Anyway, it seems you got it working for now. I can dig into this further if you are still playing with it. Depending on what you're doing exactly, I can recommend a specific version that may work out of the box. The different version are a bit confusing.
Hello,
My apologies to trouble you with this. I've been trying to compile and run the ALPS example Knap with MPI.
Here are my steps:
wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew; chmod u+x coinbrew
./coinbrew --tests none build Alps@master --enable-static --disable-shared --with-mpi-cflags="$(pkg-config --cflags ompi)" --with-mpi-lflags="$(pkg-config --libs ompi)" MPICC=mpicc MPICXX=mpiCC
This results in the error:
Then changed #include "#include "mpi.h"" in the
Alps/configure
file to#include "mpi.h"
, and tried again:rm -fr build/ dist/
./coinbrew --tests none build Alps@master --enable-static --disable-shared --with-mpi-cflags="$(pkg-config --cflags ompi)" --with-mpi-lflags="$(pkg-config --libs ompi)" MPICC=mpicc MPICXX=mpiCC
Now it successfully builds and installs.
Next, I tried to compile the Knap example.
export LD_LIBRARY_PATH=/home/krislock/coin-or/dist/lib:$LD_LIBRARY_PATH
cd build/Alps/master/examples/Knap/
make
This results in the error:
This implies that
COIN_HAS_MPI
is not set to1
. However, thedist/include/coin-or/AlpsConfig.h
has#define ALPS_HAS_MPI 1
. So I renamedCOIN_HAS_MPI
toALPS_HAS_MPI
everywhere in theAlps/examples/Knap/KnapMain.cpp
file, and tried to compile again.make clean; make
Now it compiles without error. However, when I run the executable, I get a segmentation fault.
Any help you can give would be greatly appreciated!
Nathan