00001 /* -*- Mode: C; c-basic-offset:4 ; -*- */ 00002 /* 00003 * (C) 2003 by Argonne National Laboratory. 00004 * See COPYRIGHT in top-level directory. 00005 */ 00006 #include <string.h> 00007 #include "mpioimpl.h" 00008 #include "mpiu_greq.h" 00009 00010 #ifdef HAVE_WEAK_SYMBOLS 00011 /* Include mapping from MPI->PMPI */ 00012 #define MPIO_BUILD_PROFILING 00013 #include "mpioprof.h" 00014 #endif 00015 00016 int MPIU_Greq_query_fn(void *extra_state, MPI_Status *status) 00017 { 00018 int foo; 00019 00020 /* can't touch user's MPI_ERROR, so hold it for a moment */ 00021 foo = status->MPI_ERROR; 00022 00023 /* get the status from the blocking operation */ 00024 memcpy(status, extra_state, sizeof(MPI_Status)); 00025 00026 /* restore MPI_ERROR to whatever it had when we got it */ 00027 status->MPI_ERROR = foo; 00028 00029 /* and let Test|Wait know we weren't canceled */ 00030 MPI_Status_set_cancelled(status, 0); 00031 00032 return MPI_SUCCESS; 00033 } 00034 00035 int MPIU_Greq_free_fn(void *extra_state) 00036 { 00037 /* frees the memory allocated in MPIO_Completed_request_create */ 00038 ADIOI_Free(extra_state); 00039 00040 return MPI_SUCCESS; 00041 } 00042 int MPIU_Greq_cancel_fn(void *extra_state, int complete) 00043 { 00044 MPIU_UNREFERENCED_ARG(extra_state); 00045 MPIU_UNREFERENCED_ARG(complete); 00046 00047 /* can't cancel */ 00048 return MPI_SUCCESS; 00049 }