/* StarPU --- Runtime system for heterogeneous multicore architectures. * * Copyright (C) 2011-2018 CNRS * Copyright (C) 2013 Inria * Copyright (C) 2013-2015,2017 Université de Bordeaux * * StarPU is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or (at * your option) any later version. * * StarPU is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU Lesser General Public License in COPYING.LGPL for more details. */ #include #include #include #include "helper.h" #if !defined(STARPU_HAVE_SETENV) #warning setenv is not defined. Skipping test int main(void) { return STARPU_TEST_SKIPPED; } #else void func_cpu(void *descr[], void *_args) { (void)descr; (void)_args; } struct starpu_codelet mycodelet = { .cpu_funcs = {func_cpu}, .nbuffers = 2, .modes = {STARPU_RW, STARPU_R}, .model = &starpu_perfmodel_nop, }; #define N 1000 /* Returns the MPI node number where data indexes index is */ int my_distrib(int x) { return x; } void test_cache(int rank, char *enabled, size_t *comm_amount) { int i; int ret; unsigned *v[2]; starpu_data_handle_t data_handles[2]; setenv("STARPU_MPI_CACHE", enabled, 1); ret = starpu_init(NULL); STARPU_CHECK_RETURN_VALUE(ret, "starpu_init"); ret = starpu_mpi_init(NULL, NULL, 0); STARPU_CHECK_RETURN_VALUE(ret, "starpu_mpi_init"); for(i = 0; i < 2; i++) { int j; v[i] = malloc(N * sizeof(unsigned)); for(j=0 ; j