We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently calls of implicit functions are always in the function and the loop structure is ignored. The call should be placed in the loop.
#include <cmath> #include <cstdlib> #define OMPI_SKIP_MPICXX #include <mpi.h> #include "ExtraPInstrumenter.hpp" // Test reproducing a bug where an impliict call is placed incorrectly - outside // of the loop. MPI_Request send(int * val, int rank) { MPI_Request req; MPI_Isend(val, 1, MPI_INT, 1 - rank, 0, MPI_COMM_WORLD, &req); return req; } void f(int x1, int x2, MPI_Request req) { int tmp = 0; for(int i = 0; i < x1; i += 1) tmp += i*1.1; for(int j = 0; j < x2; j += 1) MPI_Wait(&req, MPI_STATUS_IGNORE); } int main(int argc, char ** argv) { MPI_Init(&argc, &argv); int rank, size; int val = 1; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); int x1 EXTRAP = atoi(argv[1]); int x2 EXTRAP = 2*atoi(argv[2]); register_variable(&x1, VARIABLE_NAME(x1)); register_variable(&x2, VARIABLE_NAME(x2)); MPI_Request req = send(&val, rank); f(x1, x2, req); MPI_Finalize(); return 0; }
Produces
{ "functions": { "MPI_Wait": { "func_idx": 1, "loops": [ { "callstacks": [ [ 2, 0 ] ], "instance": { "0": { "level": 0, "0": { "level": 0, "params": [ "p" ] } } } ] }, "_Z1fiiP14ompi_request_t": { "file": "bug_loop_implicit_function.cpp", "func_idx": 0, "line": 23, "loops": [ { "callstacks": [ [ 2 ] ], "instance": { "0": { "level": 0, "params": [ [ "x2" ] ] }, "1": { "level": 0, "params": [ [ "x1" ] ] }, "2": { "level": 0, "params": [ [ "p" ] ] } } } ] } }, "functions_demangled_names": [ "f(int, int, ompi_request_t*)", "MPI_Wait", "main", "void register_variable<int>(int*, char const*)", "send(int*, int)" ], "functions_mangled_names": [ "_Z1fiiP14ompi_request_t", "MPI_Wait", "main", "_Z17register_variableIiEvPT_PKc", "_Z4sendPii" ], "functions_names": [ "f", "MPI_Wait", "main", "register_variable<int>", "send" ], "parameters": [ "x1", "x2", "p" ] }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently calls of implicit functions are always in the function and the loop structure is ignored.
The call should be placed in the loop.
Produces
The text was updated successfully, but these errors were encountered: