Commit 091e5064 authored by Kevin Harms's avatar Kevin Harms

The PGI compiler doesn't appear to like pointer arithmetic. It was

generating division by zero when using it. This change casts the
pointers to integers first and then does the subtraction.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@408 3b7491f3-a168-0410-bf4b-c445ed680a29
parent de35ba59
......@@ -1816,7 +1816,10 @@ static int cp_log_write(struct darshan_job_runtime* final_job, int rank,
buf = pointers[0];
for(i=0; i<count; i++)
{
displacements[i] = (MPI_Aint)(pointers[i] - buf);
/* use this transform to be compiler safe */
uintptr_t ptr = (uintptr_t) pointers[i];
uintptr_t base = (uintptr_t) buf;
displacements[i] = (MPI_Aint)(ptr - base);
}
DARSHAN_MPI_CALL(PMPI_Type_hindexed)(count, lengths, displacements,
MPI_BYTE, &mtype);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment