Skip to content

Commit

Permalink
Merge pull request #583 from jabl/index-type
Browse files Browse the repository at this point in the history
Use size_t for index argument
  • Loading branch information
zbeekman committed Oct 5, 2018
2 parents f57481b + 25d74b2 commit 0b67734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/mpi/mpi_caf.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ unimplemented_alloc_comps_message(const char * functionname);

static void
locking_atomic_op(MPI_Win win, int *value, int newval,
int compare, int image_index, int index)
int compare, int image_index, size_t index)
{
CAF_Win_lock(MPI_LOCK_EXCLUSIVE, image_index - 1, win);
int ierr = MPI_Compare_and_swap(&newval, &compare,value, MPI_INT,
Expand Down Expand Up @@ -652,7 +652,7 @@ failed_stopped_errorhandler_function (MPI_Comm* pcomm, int* perr, ...)
}
#endif

void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
void mutex_lock(MPI_Win win, int image_index, size_t index, int *stat,
int *acquired_lock, char *errmsg, size_t errmsg_len)
{
const char msg[] = "Already locked";
Expand Down Expand Up @@ -737,7 +737,7 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
#endif // MPI_VERSION
}

void mutex_unlock(MPI_Win win, int image_index, int index, int *stat,
void mutex_unlock(MPI_Win win, int image_index, size_t index, int *stat,
char* errmsg, size_t errmsg_len)
{
const char msg[] = "Variable is not locked";
Expand Down
6 changes: 3 additions & 3 deletions src/openshmem/openshmem_caf.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,15 @@ caf_runtime_error (const char *message, ...)
/* being used, we could add something of the form "#ifdef _CMAKE" to remove the */
/* keyword only when building with CMake */
/* inline */ void locking_atomic_op(MPI_Win win, int *value, int newval,
int compare, int image_index, int index)
int compare, int image_index, size_t index)
{
CAF_Win_lock (MPI_LOCK_EXCLUSIVE, image_index-1, win);
MPI_Compare_and_swap (&newval,&compare,value, MPI_INT,image_index-1,
index*sizeof(int), win);
CAF_Win_unlock (image_index-1, win);
}

void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
void mutex_lock(MPI_Win win, int image_index, size_t index, int *stat,
int *acquired_lock, char *errmsg, int errmsg_len)
{
const char msg[] = "Already locked";
Expand Down Expand Up @@ -326,7 +326,7 @@ void mutex_lock(MPI_Win win, int image_index, int index, int *stat,
#endif // MPI_VERSION
}

void mutex_unlock(MPI_Win win, int image_index, int index, int *stat,
void mutex_unlock(MPI_Win win, int image_index, size_t index, int *stat,
char* errmsg, int errmsg_len)
{
const char msg[] = "Variable is not locked";
Expand Down

0 comments on commit 0b67734

Please sign in to comment.