MPI_Aint size;
int disp_unit;
MPI_Comm comm;
- //MPI_Info info
+ MPI_Info info;
int assert;
xbt_dynar_t requests;
xbt_bar_t bar;
MPI_Win* connected_wins;
+ char* name;
} s_smpi_mpi_win_t;
win->size = size;
win->disp_unit = disp_unit;
win->assert = 0;
- //win->info = info;
+ win->info = info;
+ if(info!=MPI_INFO_NULL)
+ info->refcount++;
win->comm = comm;
+ win->name = NULL;
win->requests = xbt_dynar_new(sizeof(MPI_Request), NULL);
win->connected_wins = xbt_malloc0(comm_size*sizeof(MPI_Win));
win->connected_wins[rank] = win;
xbt_barrier_wait((*win)->bar);
xbt_dynar_free(&(*win)->requests);
xbt_free((*win)->connected_wins);
+ if ((*win)->name != NULL){
+ xbt_free((*win)->name);
+ }
+ if((*win)->info!=MPI_INFO_NULL){
+ MPI_Info_free(&(*win)->info);
+ }
xbt_free(*win);
win = MPI_WIN_NULL;
return MPI_SUCCESS;
}
+void smpi_mpi_win_get_name(MPI_Win win, char* name, int* length){
+ if(win->name==NULL){
+ *length=0;
+ name=NULL;
+ return;
+ }
+ *length = strlen(win->name);
+ strcpy(name, win->name);
+}
+
+void smpi_mpi_win_get_group(MPI_Win win, MPI_Group* group){
+ if(win->comm != MPI_COMM_NULL)
+ *group = smpi_comm_group(win->comm);
+}
+
+void smpi_mpi_win_set_name(MPI_Win win, char* name){
+ win->name = strdup(name);;
+}
+
int smpi_mpi_win_fence( int assert, MPI_Win win){