Skip to content

Commit

Permalink
mixed_cg_merge: added orphaned version of update_backward_gauge for u…
Browse files Browse the repository at this point in the history
…se in Hopping_Matrix_32
  • Loading branch information
kostrzewa committed Nov 11, 2015
1 parent 8b8b447 commit 71c55aa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
58 changes: 38 additions & 20 deletions update_backward_gauge.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,12 @@ void update_backward_gauge(su3 ** const gf) {
return;
}

void update_backward_gauge_32(su3_32 ** const gf) {
#ifdef OMP
#pragma omp parallel
{
#endif
void update_backward_gauge_32_orphaned(su3_32 ** const gf) {

int ix=0, kb=0, iy=0;

#ifdef OMP
#pragma omp for
#pragma omp for nowait
#endif
for(ix = 0; ix < VOLUME/2; ix++) {
iy = (VOLUME+RAND)/2+ix;
Expand All @@ -99,15 +95,30 @@ void update_backward_gauge_32(su3_32 ** const gf) {
_su3_assign(g_gauge_field_copy_32[1][ix][3], gf[kb][3]);
}

// we use the implicit barrier at the end of the single section to catch all
// threads, in the meantime, one of them modifies the global flag
#ifdef OMP
} /* OpenMP closing brace */
#pragma omp single
{
#endif
g_update_gauge_copy_32 = 0;
#ifdef OMP
}
#endif
}

g_update_gauge_copy_32 = 0;
void update_backward_gauge_32(su3_32 ** const gf) {
#ifdef OMP
#pragma omp parallel
{
#endif
update_backward_gauge_32_orphaned(gf);
#ifdef OMP
} /* OpenMP closing brace */
#endif
return;
}


#elif _USE_TSPLITPAR

void update_backward_gauge(su3 ** const gf) {
Expand Down Expand Up @@ -230,17 +241,11 @@ void update_backward_gauge(su3 ** const gf) {
return;
}


void update_backward_gauge_32(su3_32 ** const gf) {
#ifdef OMP
#pragma omp parallel
{
#endif

void update_backward_gauge_32_orphaned(su3_32 ** const gf) {
int ix=0, kb=0, kb2=0;

#ifdef OMP
#pragma omp for
#pragma omp for nowait
#endif
for(ix = 0; ix < VOLUME/2; ix++) {
kb2=g_eo2lexic[ix];
Expand All @@ -261,7 +266,7 @@ void update_backward_gauge_32(su3_32 ** const gf) {
_su3_assign(g_gauge_field_copy_32[ix][7],gf[kb][3]);
}
#ifdef OMP
#pragma omp for
#pragma omp for nowait
#endif
for(ix = (VOLUME+RAND)/2; ix < (VOLUME+RAND)/2+VOLUME/2; ix++) {
kb2=g_eo2lexic[ix];
Expand All @@ -281,12 +286,25 @@ void update_backward_gauge_32(su3_32 ** const gf) {
kb=g_idn[g_eo2lexic[ix]][3];
_su3_assign(g_gauge_field_copy_32[ix][7],gf[kb][3]);
}
// the threads are caught by the implicit barrier here
#ifdef OMP
#pragma omp single
#endif
g_update_gauge_copy_32 = 0;
#ifdef OMP
}
#endif
}

void update_backward_gauge_32(su3_32 ** const gf) {
#ifdef OMP
#pragma omp parallel
{
#endif
update_backward_gauge_32_orphaned(gf);
#ifdef OMP
} /* OpenMP closing brace */
#endif

g_update_gauge_copy_32 = 0;
return;
}

Expand Down
1 change: 1 addition & 0 deletions update_backward_gauge.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "su3.h"

void update_backward_gauge(su3 ** const gf);
void update_backward_gauge_32_orphaned(su3_32 ** const gf);
void update_backward_gauge_32(su3_32 ** const gf);

#endif

0 comments on commit 71c55aa

Please sign in to comment.