#9 accessing struct field in spawn


In a spawn block, when accessing a particular struct field, it seems that the wrong address is being used. The problem goes away if I explicitly print something related to that structure in the spawn, so I am guessing it has something to do with the live analysis.

Here are some details. How to reproduce:

1. check out version 11886 of the directory https://subversion.umiacs.umd.edu/xmt/applications/graph-applications/trunk
svn co -r11886 https://subversion.umiacs.umd.edu/xmt/applications/graph-applications/trunk graph-applications
2. check out version 11886 of the alex-devel branch of the compiler
svn co -r11886 https://subversion.umiacs.umd.edu/xmt/new-compiler/compiler/branches/devel/alex xmtcc-alex
3. check out version 11886 of the george2-devel branch of the simulator
svn co -r11886 https://subversion.umiacs.umd.edu/xmt/simulator/branches/devel/george/power2 xmtsim-george2
4. Set all the correct paths to use the compiler and simulator.
5. cd graph-applications/graph_lib ; make
6. cd ../maxflow
7. make sim
Look at the output. There will be a bunch of lines saying "main::initialize...". The Level values on those lines should be identical to the level lines printed above, but they have huge random values.
8. open maxflow.vis.par.c. Uncomment line 322 (a printf). save the file.
9. run 'make sim' again.
Look at the output. The Level values in the "main::initialize..." lines will look correct now.

I think something happens with the network.label field in the code, which is a int*. It's value somehow is not correctly read (maybe it's incorrectly broadcast or something), but unless I explicitly print something with it, it is not read correctly.


  • George Caragea

    George Caragea - 2010-08-25
    • priority: 5 --> 8
  • George Caragea

    George Caragea - 2010-08-25

    I think I managed to pinpoint the problem down further. I think it has something to do with the stack pointer ($sp, or $29) in parallel mode. It might be related to the parallel stack implementation.

    See in the attached .sim file. To generate this file, follow the same steps as above, but update to revision 11887.

    In the sim file, look at line 492. There a value (address of network.level[0]) is stored on the stack at 24($29). $29 is then broadcast in the spawn, which is good. Later, at line 542, the same value is trying to be read from 24($29) and printed (this is line 321 in the maxflow.vis.par.c file). However, in the meantime, the value of $29 was changed in line 531, so now the $sp points to the wrong frame.

    I'm pretty sure it's supposed to read the same value that was written, i checked by looking at the trace from the simulator, and that's what it's trying to do.

  • George Caragea

    George Caragea - 2010-08-25

    my bad, in the previous comment, use revision 11888 to be able to compile the project. I had forgotten to commit a header file.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks