Print a File on Multiple Processors
I am using MPI to send data between multiple processors. I have one file that I run on about 12 processors, all of which send data back to a single file running on a main node.
I am trying to have the file which is running on the 12 processors spawn a text file with some information regarding the data and time sent to the main node.
However, in the one file running on 12 processors, the code I am using to open the file and print to it is not working. I have a strong feeling this is because the way the code is written now, it is trying to open 12 of the same file and there is a conflict.
I am trying to think of a way to print this information to a file without doing it the cheesy, obvious way, I.E - replicating the fprintf() statements 12 times and have 12 fopen()s, f close()s, etc.
Does anyone have any ideas?