c++ - MPI send recv input arguments -
i have problems part of code (i semplified more clear).
//p number of processor (we suppose 2) //vett vector contains elements send //disp vector elements index of first element send //elem vector elements number of elements send //local_v destination vector (of dimension elem[rank]) //local_n number of elements have arrive (=elem[rank])
in case cycle executed 1 time
for(unsigned int = 1; < p; i++){ if(rank==0){ mpi_send(&vett[disp[i]], elem[i], mpi_int, i, 0, mpi_comm_world); }else{ mpi_recv(&local_v, local_n, mpi_int, 0, 0, mpi_comm_world, mpi_status_ignore); } }
processor1 sends other(in case processor2). not sure if use correctly mpi_send, in particular i'm not sure first input argument correct...
in mpi_recv
missing [0]
after receive buffer, entire line:
mpi_recv(&local_v[0], local_n, mpi_int, 0, 0, mpi_comm_world, mpi_status_ignore);
Comments
Post a Comment