Commit 73f0dfde authored by James Dinan's avatar James Dinan
Browse files

[svn-r10676] RMA State Tracking: Lock/Fence interleaving test

This test checks for invalid interleaving of passive and active target epochs.
Currently, we do not detect this error, so this test case is disabled in the
test suite.

Reviewer: goodell
parent 746653af
......@@ -22,6 +22,7 @@ noinst_PROGRAMS = \
win_sync_complete \
win_sync_lock_at \
win_sync_lock_pt \
win_sync_lock_fence \
win_sync_nested \
win_sync_op
......@@ -7,5 +7,8 @@ win_sync_free_at 2
win_sync_complete 2
win_sync_lock_at 2
win_sync_lock_pt 2
# FIXME - MPICH currently does not detect the erroneous synchronization in
# win_sync_lock_fence.
#win_sync_lock_fence 2
win_sync_nested 2
win_sync_op 2
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
*
* (C) 2012 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "mpi.h"
#include <stdio.h>
#include <stdlib.h>
#include "mpitest.h"
#include "win_sync.h"
int main(int argc, char *argv[])
{
int rank, nproc;
int errors = 0, all_errors = 0;
int buf, my_buf;
MPI_Win win;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
MPI_Win_create(&buf, sizeof(int), sizeof(int),
MPI_INFO_NULL, MPI_COMM_WORLD, &win);
MPI_Win_set_errhandler(win, MPI_ERRORS_RETURN);
MPI_Win_fence(0, win);
MPI_Win_lock(MPI_LOCK_SHARED, 0, MPI_MODE_NOCHECK, win);
MPI_Get(&my_buf, 1, MPI_INT, 0, 0, 1, MPI_INT, win);
MPI_Win_unlock(0, win);
/* This should fail because the window is no longer in a fence epoch */
CHECK_ERR(MPI_Get(&my_buf, 1, MPI_INT, 0, 0, 1, MPI_INT, win));
MPI_Win_fence(0, win);
MPI_Win_free(&win);
MPI_Reduce(&errors, &all_errors, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
if (rank == 0 && all_errors == 0) printf(" No Errors\n");
MPI_Finalize();
return 0;
}
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