- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
A bit off a backstory. We've been recently migrated to SSD in our company. After that fortran code that we have started running very slowly on my computer, my colleagues seem to be fine.
I've tracked the problem down in debugger to various IDUMMY = SYSTEM(command line stuff) calls. Basically whenever this place is reached I have 1-2 second pause before commad executes.
Solutions that have worked for me (i.e. they execute instantly):
deleting files:
either:
OPEN(UNIT=123, FILE='FileName', DISPOSE='DELETE')
CLOSE(UNIT=123)
or
IDUMMY = DELFILESQQ('FileName') !this seems to work just fine
Overwriting files:
OPEN(UNIT=123, FILE='FileName', STATUS='REPLACE')
Now my only remaining issue is one place where I have to copy a file.
I tried IDUMMY = SYSTEMQQ('copy [path]file1.txt [path]file2.txt') same result as with IDUMMY = SYSTEMQQ('copy [path]file1.txt [path]file2.txt')
So I have two questions:
1) why could would this be happening?
2) any elegant way to copy a file in fortran without a using either SYSTEM or SYSTEMQQ? RENAMEFILEQQ executes instantly, but unfortunatelly also moves the file.
Any help would be aprreciated.
P.S. using Parallel Studio XE 2016 Update 3, version 16.0.0062.12
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
program P use ISO_FORTRAN_ENV implicit none integer(INT8), allocatable :: contents(:) integer iunit integer(INT64) size open(newunit=iunit,file='test.txt',status='old',access='stream') inquire(iunit,size=size) allocate(contents(size)) read(iunit) contents close(iunit) open(newunit=iunit,file='copy.txt',status='replace',access='stream') write(iunit) contents close(iunit) deallocate(contents) end program P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would use the CopyFile Windows SDK routine. The Miscellaneous\CopyFolder sample, in the Parallel Studio XE samples bundle, demonstrates this. I attached a copy (!) here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! This has helped.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page