openfam::fam::fam_barrier_all
Suspends the execution of the calling PE until all other PEs issue a call to this particular fam_barrier_all() statement.
Synopsis
void fam_barrier_all(void);
Description
This method is used to suspend the execution of the calling PE until all other PEs issue a call to this particular fam_barrier_all() statement.
Input Arguments
None.
Return Values
None.
Notes
The OpenFAM library suspends the execution of calling PE until all other cooperating PEs issue a call to this function. Since data consistency in FAM cannot be guaranteed by this library function, this method should not be used to synchronize the data for non-blocking APIs.
Example
#include <string.h> #include <fam/fam.h> #include <fam/fam_exception.h> using namespace std; using namespace openfam; int main(void) { fam *myFam = new fam(); // ... Initialization code here try { Fam_Region_Descriptor *region = myFam->fam_lookup_region("myRegion"); // create 50 element unnamed integer array in FAM with 0600 // (read/write by owner) permissions in myRegion Fam_Descriptor *descriptor = myFam->fam_allocate((uint64_t)(50 * sizeof(int)), 0600, region); printf("Successully allocated 50 unnamed integer elements\n"); } catch (Fam_Exception &e) { printf("fam API failed: %d: %s\n", e.fam_error(), e.fam_error_msg()); } // Wait for all PEs to complete allocation fam_barrier_all(); // Continue with the application try{ // free allocated space in FAM myFam->fam_deallocate(descriptor); printf("Successully de-allocated 50 unnamed integer elements\n"); } catch (Fam_Exception &e) { printf("fam API failed: %d: %s\n", e.fam_error(), e.fam_error_msg()); } // ... Finalization code here }