/* StarPU --- Runtime system for heterogeneous multicore architectures. * * Copyright (C) 2013-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria * * 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 "helper.h" #include #define ARRAY_SIZE 12 #define STARPU_MPI_INIT(void) do{struct starpu_conf conf; int ret; \ starpu_conf_init(&conf); \ conf.nmic = 0; \ conf.nmpi_ms = 0; \ ret = starpu_init(NULL); \ if (STARPU_UNLIKELY(ret == -ENODEV)) \ { \ return 77; \ } \ STARPU_CHECK_RETURN_VALUE(ret, "starpu_init"); \ if (starpu_cpu_worker_get_count() < 1) \ { \ FPRINTF(stderr, "This application requires at least 1 cpu worker\n"); \ starpu_shutdown(); \ return 77; \ } \ starpu_mpi_init(&argc, &argv, 1); \ starpu_mpi_comm_size(MPI_COMM_WORLD, &nb_nodes); \ starpu_mpi_comm_rank(MPI_COMM_WORLD, &me); \ }while(0) int nb_nodes; int me; int backup_of(int _me) { if (_me==0) return 1; else return 0; return (_me+1)%nb_nodes; } int pseudotest_checkpoint_template_register(int argc, char* argv[]) { starpu_data_handle_t h; starpu_data_handle_t h_array[ARRAY_SIZE]; starpu_mpi_checkpoint_template_t cp_template1, cp_template2; int val = 42; int val2 = 1234; int array[ARRAY_SIZE]; int ret; //init array for (int i=0 ; i