Skip to content

Use size_t for index argument #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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