int MPE_Counter_attr_delete( MPI_Win counter_win, int keyval, void *attr_val, void *extra_state ) { int counter_flag, *counter_mem, *myval_p = (int *)attr_val; MPI_Win_get_attr( counter_win, MPI_WIN_BASE, &counter_mem, &counter_flag ); /* Free the memory used by the counter and local value */ if (counter_flag && counter_mem) MPI_Free_mem( counter_mem ); free( myval_p ); return MPI_SUCCESS; }