char *tohash = str;
*ans=5381;
printf("hashing !\n");
- int c = *(tohash++);
+ int c = *tohash;
while (c != 0) {
*ans = ((*ans << 5) + *ans) + c; /* hash * 33 + c */
- c = *(tohash++);
+ tohash++;
+ c = *tohash;
}
return NULL;
}
//Try SMPI_SHARED_CALL function, which should call hash only once and for all.
char *str = strdup("onceandforall");
if(rank==size-1){
- SMPI_SHARED_CALL(hash,str,str,buf);
+ SMPI_SHARED_CALL(hash,str,str,buf);
}
MPI_Barrier(MPI_COMM_WORLD);