Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setvbuf3f problems.

Status
Not open for further replies.

Travis214

Programmer
Joined
May 19, 2009
Messages
9
Location
CA
Hello,

I am attempting to change the buffering of my output to line buffering instead of full buffering. I need this because I keep having problems with machines restarting which makes me lose data because it is all sitting in a buffer. I am trying to use setvbuf3f to accomplish this. I can change stdout from line buffering to no buffering (as a test to see if the function ever works) but I cannot set the buffering on any of the unit numbers that I open myself, it always returns 1. I am using it as follows:

Code:
[COLOR=blue]OPEN[/color](21,[COLOR=red]FILE=[/color][COLOR=teal]'aNewFile.txt'[/color])
ierr = [COLOR=blue]setvbuf3f[/color](21,1,512)
[COLOR=blue]write[/color](21,*) [COLOR=teal]'Some data'[/color]

I have tried changing the buffer size but that doesn't seem to be the problem. What am I doing wrong? I am making the calls in a program that uses MPI, will that effect this function? I am using the PGI 6.1 compiler on an x64 Linux machine.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top