#include #include #include "mpi.h" #include "oasis_c.h" int main(int argc, char *argv[]) { char *comp_name = "receiver"; fprintf(stdout,"Component name: %s\n", comp_name); fflush(stdout); int comp_id; OASIS_CHECK_ERR(oasis_c_init_comp(&comp_id, comp_name, OASIS_COUPLED)); fprintf(stdout, "Receiver: Component ID: %d\n", comp_id); fflush(stdout); MPI_Comm local_comm; OASIS_CHECK_ERR(oasis_c_get_localcomm(&local_comm)); int comm_size; OASIS_CHECK_MPI_ERR(MPI_Comm_size(local_comm, &comm_size)); int comm_rank; OASIS_CHECK_MPI_ERR(MPI_Comm_rank(local_comm, &comm_rank)); fprintf(stdout,"Receiver: local_comm_rank = %d of %d\n",comm_rank,comm_size); fflush(stdout); const int n_points = 16; if ( ( n_points % comm_size ) != 0 ) { OASIS_CHECK_ERR(oasis_c_abort(comp_id, comp_name, "Receiver: comm_size has to divide n_points exactly", __FILE__, __LINE__)); } int local_size = n_points/comm_size; int offset = comm_rank*local_size; int n_segments = 1; int part_id; int i; { int part_params[OASIS_Orange_Params(n_segments)]; part_params[OASIS_Strategy] = OASIS_Orange; part_params[OASIS_Segments] = n_segments; for (i = 0; i