PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Fast output to ascii file

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Mon Nov 08, 2010 1:37 pm    Post subject: Fast output to ascii file Reply with quote

I have a large 2D array, it's too slow to write out the data to ascii using
Code:

DO i = 1, col
    write (file_ID, *) a(:, i)
END DO


I tried using flush() , yet it's still slow. Any suggestion please.

Tuan
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Tue Nov 09, 2010 2:01 pm    Post subject: Reply with quote

Hi Tuan,

Calling flush will slow things down since this forces a write to the disk and disk I/O is the slow part. Instead, you want to use a larger system I/O buffer. I happen to be in the process of writing an example of using setvbuf for another users (See: https://www.pgroup.com/userforum/viewtopic.php?t=2283) which may help you as well.

Note that if the output does not need to be formatted, then it would be faster to output in binary.

- Mat
Back to top
View user's profile
Tuan



Joined: 11 Jun 2009
Posts: 233

PostPosted: Wed Nov 10, 2010 1:12 pm    Post subject: Reply with quote

Thanks Mat. I'll check when an example from you is posted.

Tuan
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group