I wrote my first python program today!

You might wanna dial down the confrontational tone a little bit. I'm not saying you're wrong. I'm just explaining the behavior that we're observing in our code base.

If you can come up with some kind of test case to prove me otherwise, go ahead.

I'm literally staring at the test case right now. Python's print statement is not following the order of execution with respect to C (via SWIG) and Fortran (via F2Py) code glued to it. C or Fortran prints are spit out in the correct order of execution, and Python prints are dumped all-at-once at program termination regardless of where in the code they appear. Using sys.stdout.write() solves this problem, and makes Python prints appear with the correct order of execution with C and Fortran code.

I'd love to share it, but I can't. It's research code under limited access, with compiled dependencies on an IBM BG/Q. Nobody here has the willingness or the time to produce a portable isolated test case for an already solved problem. Some day a poor undergrad might be forced to look into it as a vehicle for him to learn the code base, but that day isn't today. So you're just gonna have to take my word for it.

And in the meantime, this really isn't worth stressing out about. We're talking about trivial debug printouts not used in production code. Not to mention that this is a parallel environment that has specialized hardware and communication patterns between front-end nodes (which display printouts) and compute nodes (which execute the code). I haven't got the slightest clue about the implications of this setup for our code base, and frankly we don't have an awful lot of incentive to find out either given that the printouts aren't used for anything important.

/r/ProgrammerHumor Thread Parent Link - i.imgur.com