Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
 // #define ROMP_SUPPORT_ENABLED  . // #define ROMP_SUPPORT_ENABLED
Line 11: Line 11:
 static const int tracing = 1;  . static const int tracing = 1;
Line 18: Line 18:
The biggest problem is finding shared variables - variables written by one thread while being read or written by another. Intel's Inspector tool is aimed at finding these, and is very powerful. A simple fast alternative for finding some of the violations is to have code keep track of whether an object has been accessed for read or write by omp parallel loop iteration, and check that only one iteration accesses each object for write, or that the only accesses are reads.

Parent: MorphoOptimizationProject

This is detected by a difference either in the stdout lines or the created files. The problem is to find when the change first happened.

Start by uncommenting this #define in the romp_support.h, to enable the printing out of parallel for loop information

  • // #define ROMP_SUPPORT_ENABLED

Also enable tracing at the start of utils/romp_support.c

  • static const int tracing = 1;

Rebuild. Now when you run, you will get stdout lines that show when the parallel loops have executed, and you will see at the end all the loops that have executed.

Now add fprint's close to where those parallel loops are, to show what their inputs and output's are. To show a MRIS, simply print its hash using mris_print_hash. If the mris has the same state, its hash will be the same. It is highly unlikely that two different ones will have the same hash.

Now diff'ing the outputs should enable you to zoom into where the two runs differ. The biggest problem is finding shared variables - variables written by one thread while being read or written by another. Intel's Inspector tool is aimed at finding these, and is very powerful. A simple fast alternative for finding some of the violations is to have code keep track of whether an object has been accessed for read or write by omp parallel loop iteration, and check that only one iteration accesses each object for write, or that the only accesses are reads.

MorphoOptimizationProject_DebuggingNondeterminism (last edited 2021-09-22 09:51:17 by DevaniCordero)