Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one test C\C++ code which uses MPI calls: is there any set of mock functions, that I can use?

#include <mpi.h>
double f() {
    double timer = MPI_Wtime();
    return timer;
}

What I am searching for is some set of mock MPI functions, so I can #include <mpi_mocks.h> instead of mpi.h and get it compiled without linking to MPI library. It could also be something like #define MOCK which will trigger this behavior in mpi.h.

like image 262
Anton Daneyko Avatar asked Nov 13 '22 12:11

Anton Daneyko


1 Answers

As far as I can see, there are no mocks you could just #include and be done. However, it should be no big deal to write the needed functions yourself and for whichever mocking framework you chose to use. Just start with an empty header and look which functions you compiler complains about.

like image 92
Arne Mertz Avatar answered Nov 15 '22 05:11

Arne Mertz