sdis_mpi.h (1950B)
1 /* Copyright (C) 2016-2025 |Méso|Star> (contact@meso-star.com) 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 16 #ifndef SDIS_MPI_H 17 #define SDIS_MPI_H 18 19 #ifndef SDIS_ENABLE_MPI 20 #error "Invalid inclusion. Stardis-Solver is compiled without MPI support" 21 #endif 22 23 #include "sdis_c.h" 24 25 #include <rsys/rsys.h> 26 #include <mpi.h> 27 28 /* Forward declarations */ 29 struct sdis_device; 30 31 /* Send the progress status `progress' to the master process */ 32 extern LOCAL_SYM void 33 mpi_send_progress 34 (struct sdis_device* dev, 35 const int32_t progress); 36 37 /* Fetch the progress status of non master processes into `progress'. The 38 * progress of the i-th process is stored in progress[i], meaning that the 39 * length of progress must be at least equal to the number of MPI processes */ 40 extern LOCAL_SYM void 41 mpi_fetch_progress 42 (struct sdis_device* dev, 43 int32_t progress[]); 44 45 /* Actively wait for the completion of the MPI request `req' */ 46 extern LOCAL_SYM void 47 mpi_waiting_for_request 48 (struct sdis_device* dev, 49 MPI_Request* req); 50 51 /* Actively wait for a message from the process iproc */ 52 extern LOCAL_SYM void 53 mpi_waiting_for_message 54 (struct sdis_device* dev, 55 const int iproc, 56 const enum mpi_sdis_message msg, 57 MPI_Status* status); 58 59 /* Waiting for all processes */ 60 extern LOCAL_SYM void 61 mpi_barrier 62 (struct sdis_device* dev); 63 64 #endif /* SDIS_MPI_H */