X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6bb8549789b7ac183f0c9ad041fc34a466aeb83d..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/examples/smpi/ampi_test/ampi_test.cpp diff --git a/examples/smpi/ampi_test/ampi_test.cpp b/examples/smpi/ampi_test/ampi_test.cpp index 9c7650a961..e9e25d31ed 100644 --- a/examples/smpi/ampi_test/ampi_test.cpp +++ b/examples/smpi/ampi_test/ampi_test.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -7,14 +7,18 @@ #include "smpi/smpi.h" #include "smpi/sampi.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_plugin_load_balancer_example, smpi, "Simple tracing test for SAMPI functions"); - int main(int argc, char* argv[]) { MPI_Init(&argc, &argv); + // useless alocations for testing and coverage void* pointer = malloc(100 * sizeof(int)); + void* ptmp; + if ((ptmp = realloc(pointer, 50 * sizeof(int))) != nullptr) + pointer = ptmp; + if ((ptmp = realloc(pointer, 200 * sizeof(int))) != nullptr) + pointer = ptmp; free(pointer); - pointer = malloc(100 * sizeof(int)); + pointer = calloc(100, sizeof(int)); int rank; int err = MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get id of this process */ if (err != MPI_SUCCESS) {