<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi,</div><div><br></div><div>I'm trying to overwrite the weak symbol mpi_waitany_ (fortran symbol), but I get an error (the function doesn't seem to work since it returns an index of 0).</div><div>Here is my code, any idea why it doesn't work?</div><div><br></div><div><p style="margin: 0px;" data-mce-style="margin: 0px;"><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">void mpi_waitany_(MPI_Fint* count, MPI_Fint* array_of_requests,</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     MPI_Fint* index, MPI_Fint* status, MPI_Fint* err)</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">{</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     MPI_Status cstatus;</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     MPI_Status_f2c(status, &cstatus);</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     MPI_Request* c_req = (MPI_Request*)malloc(sizeof(MPI_Request)*(*count));</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     int i;</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     for(i=0;i<*count;i++) {</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">         c_req[i] = MPI_Request_f2c(array_of_requests[i]);</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     }</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     *err = PMPI_Waitany(*count,c_req,index,&cstatus);</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     MPI_Status_c2f(&cstatus, status);</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     for(i=0;i<*count;i++) {</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">         array_of_requests[i] = MPI_Request_c2f(c_req[i]);</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     }</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">     free(c_req);</span><br><span style="font-family: 'courier new', courier, monaco, monospace, sans-serif;">}</span></p><p style="margin: 0px;" data-mce-style="margin: 0px;"><br></p><p style="margin: 0px;" data-mce-style="margin: 0px;">Thanks!</p></div><div><br></div><div><span name="x"></span><span size="2" data-mce-style="font-size: small;" style="font-size: small;"><span size="3" data-mce-style="font-size: medium;" style="font-size: medium;">Matthieu Dorier<br>
  </span>PhD student at ENS Rennes<br><a href="http://people.irisa.fr/Matthieu.Dorier">http://people.irisa.fr/Matthieu.Dorier</a></span><span name="x"></span><br></div></div></body></html>