#include "ga.h" /* Instead of using a static variable, we could attach these to a communicator, using a communicator attribute */ static MPI_Win *GA_mutex_wins = 0; static int GA_mutex_nwins = 0; int ga_create_mutexes( int num ) { int size, nwin, i; MPI_Comm_size( MPI_COMM_WORLD, &size ); nwin = (num + size - 1) / size; GA_mutex_wins = (MPI_Win *)malloc( nwin * sizeof(MPI_Win) ); if (!GA_mutex_wins) return 1; for (i=0; i