Coder Social home page Coder Social logo

Comments (15)

anjohan avatar anjohan commented on August 22, 2024 2

I don't want to do the other things I need to do today, so I'll see if I can fix this.

from phoebe.

cepellotti avatar cepellotti commented on August 22, 2024 1

Well, I did modify that function yesterday, but I don't understand how it could cause an error. In my partial defense, I am running with 2 OMP threads and 4 MPI processes on my laptop and the silicon example runs fine to completion.

from phoebe.

anjohan avatar anjohan commented on August 22, 2024 1

They may also have been reintroduced by a merge (there was another issue that showed up as well, so it seems we messed something up).

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

@cepellotti -- was there anything yesterday that might have changed in divideWorkIter when you fixed those merge issues yesterday?

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

I'm also going to quickly check an older copy of phoebe (pre-recent pull request) to see if this is the result of any of the related changes.

from phoebe.

anjohan avatar anjohan commented on August 22, 2024

It still looks correct to me, it just isn't thread safe because divideWorkIter sets some member vectors

from phoebe.

anjohan avatar anjohan commented on August 22, 2024

I made this function thread-safe on the omp-fix branch, just changing it to

std::vector<int> MPIcontroller::divideWorkIter(size_t numTasks) {
  // return a vector of the start and stop points for task division
  int start = (numTasks * rank) / size;
  int stop = (numTasks * (rank + 1)) / size;
  std::vector<int> divs;
  for (int i = start; i < stop; i++) {
    divs.push_back(i);
  }
  return divs;
}

It no longer segfaults, but it does give the wrong results with openmp. And I have no idea where to start on that.

I guess any parallel loop that relies on divideWork is problematic.

from phoebe.

cepellotti avatar cepellotti commented on August 22, 2024

It does give wrong results because other parts rely on the member variables that are set by divideWork() (the members workDivision*).

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

I thought I removed those workDivision members a while ago -- out of curiosity, why do we want to store those?

from phoebe.

cepellotti avatar cepellotti commented on August 22, 2024

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

No I removed them here: 36cc228 , I think we discussed that they weren't necessary because we could just return start/stop or iterators.

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

Should I remove them again today? This would fix the wrongness of the result.

from phoebe.

cepellotti avatar cepellotti commented on August 22, 2024

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

Ok, I'll redo this by the end of today -- glad @anjohan caught this now!

from phoebe.

jcoulter12 avatar jcoulter12 commented on August 22, 2024

This was an error related to different compiler optimizations. Should be fixed by ba60d09

from phoebe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.