Unreliable Timing in FORTRAN Program

Could you listen to the following tale and let me know what you think might be happening?
Three weeks ago (about 2 wks after a reboot) I started an experiment on my Ultra 10 (360Mhz UltraIIi cpu). It was a continuation of an experiment I had been running on a slower machine at Drexel University (250Mhz UltraII cpu). The ratio of speeds on the two machines over the past year and a half has always been about 1.42/1. The experiment on my machine started at a point about 20,000 seconds before the end of the Drexel run. So, just to be sure about the ratio of speeds, I examined the repeated segment and compared the runtimes. (To do timing I use internal calls to the SYSTIM subprogram which provides intermediate elapsed time to write into the program output.)
Surprisingly, the ratio of speeds was 0.97/1 (really horrible). I checked my cpu occupancy and swapping/paging using 'tops' and 'vmstat' and could find nothing unusual. My program needs about 45M of RAM for scratch arrays. However, tops indicates that of the 256M of RAM in the system only 22M is free. There is no apparent paging or swapping. This left me feeling very uncomfortable, as I count on program timing to evaluate my altorithm. 98% of the time, this large experiment is the only program occupying the cpu. At most I do some editing, browse the web for a half hour once in two weeks and run occasional small program for under 20 minutes. While the program continued to run, I added a short (small <10MB) program that normally takes 35 seconds to run to completion. It took 35 seconds as expected. I made the same test on the Drexel machine and it took 50 seconds, which was as it should be.
Anyhow, the kicker came when I decided to stop the program to run a few more tests to see what might be the matter. Test 1: I stopped the program and watched the cpu utilization go down to zero. I reset the inputs to exactly the same as the run started three weeks ago. The executable was not touched. This time it ran 1.47 times as fast (really weird). This was somewhat satisfying since 1.47*0.97 is just about the expected speed ratio. The output was identical to the first time I had run it, confirming that nothing internal to the program had been changed. In neither case was there another significant program running. Then I made Test 2. I restarted the program from a point just before I had cut it off in Test 1. So, I was able to compare a small segment (3,000 seconds) of another repeated segment. Again, the new run was faster, this time by a ratio of 1.22/1.
Have you any idea what might be happening? I do need to understand so I can create a more reliable means of evaluating my runtimes.

Maybe DBMS_UTILITY.GET_CPU_TIME?

Similar Messages

  • Sunstudio11, Internal Error when I execute a fortran program

    Hello,
    I installed sunstudio11 on a amd64 machine with ubuntu 6.06 LTS dapper drake.
    I get an "Internal Error" message when I execute a fortran program (myprog < input.file).
    Annotation: Exception occurred in Request Processor
    java.lang.NullPointerException
         at org.openide.execution.ProcessExecutor$PERunnable.run(ProcessExecutor.java:368)
    [catch] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:118)
    The program is not running and it seems he is waiting on the input.file, although "< input.file" was set as an argument.
    Thanks in advance for help,
    Thomas

    This is Sun Studio 11 right? Not a preview release of SS12?
    So you must be using gfortran to build your program?
    I assume the program runs from the command line okay.
    If you're an IDE user, then I recommend that you check out the
    new IDE in Sun Studio 12 Express 3 release. The new one is pre-release
    and it has some rough edges, but it's the direction we're going
    in the future, and we'd love to get feedback on it.
    --chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Linker error when compiling Fortran program

    I have some problems when linking a Fortran program. The compiling (with gfortran) works without problems and produces (amongst others) several ".mod" files. As soon as the products are to be linked, these .mod-files provoke a "bad magic number (not a Mach-O file)" error from the linker.
    I use gcc 4.3 with gfortran. Any ideas?
    Powerbook G4 12", 1.33 GHz/MacBook Pro 2GHz   Mac OS X (10.4.8)  

    Possibly, but the error doesn't come from gfortran itself, but from the linker (ld), so I don't see right now, why this should make a difference.
    You think it is because these .mod-files are compiled incorrectly?

  • Linking with a fortran program

    I have made a java program that generate an input file when a botton is clicked. This input file is used by a fortran program to generate results.
    Now the question is how can I link my java program so that when I press the button the input file that is generated and also the fortran program start running. Is it possible to run a program in some other language from code inside my java program.
    I dont want to write my fortran program again in java.
    thanks

    If you want to run an application, the same as running it from the command line, then you can use Runtime.exec(). If you need to 'link' to a library then you will need to use JNI to create a wrapper in C and that C code actually calls the library (fortran library.)

  • Help! Running Fortran program with Xcode

    Hi all,
    I am developing a Fortran code for a class project, I understand Matlab, but very little of advanced programming like Fortran or C++, but have to learn some for my class (note: it is not a programming class). The professor gave us a code to run and modify it, the code is supposed to work (and in fact it is working on windows computers). I didn't know how to run Fortran on a mac so I followed the instructions given in these links:
    http://www.macresearch.org/xcodegfortran_contest_winner_damienbobillot
    http://lists.apple.com/archives/fortran-dev/2006/Mar/msg00011.html
    I installed Xcode 2.4, and gfortran. After I made my Project on Xcode (following the links above), I clicked Build and it was successful, but after I clicked Build and Go I got the following error:
    Warning:Array reference at (1) is out of bounds
    Command/usr/local/bin/gfortran failed with exit code 1
    I don't know what does that mean. Can anyone help me with this?
    I would like some easy-to-follow instructions to run a Fortran program with Xcode, starting from the basics.
    It is hard to find an easy compiler for mac, PC people have qFortran (for free at at school) and things like that where you just have to click compile and that is it.
    Thanks!
    lbml

    I'd need to see your code to give details, but the error you got says you declared an array with a certain number of elements and then you tried to talk to the array outside those elements.
    For example you say:
    integer myArray(5)
    and then try to index either myArray(0) or myArray (6).
    Does that make sense. I have never tried to get fortran working with Xcode, but I did get Pascal working, so it is probably better is someone else helps you, but I will try if no one steps up.

  • JNI call changes Fortran program behavior dependent on locale

    Hello,
    we observed a strange problem with a Fortran code calling Java methods via JNI. The code is reading strings (e.g. 2.726), converting them into double values. Until Java7 everything was fine with this code, but since Java7 the double values were suddenly cut to what appeared to us as integer values as soon as JNI_CreateJavaVM was called. Changing between Java6 and 7 (libjvm) really made the difference. Looking into the problem we now noticed that under Java7 the behaviour is dependent on the system locale. When we used de_DE the values were cut, under POSIX,C,en_US etc. they were converted properly. This dependency was not existing in Java6. We created a testcase to reproduce this problem, which can be found here: http://planck.mpa-garching.mpg.de/testcase.tgz - just modify JAVAPATH in the Makefile and run it.
    Our temporary solution is to make sure that LC_ALL (or more specific LC_NUMERIC) is set to a working value, but we wonder if this is a bug which was introduced recently or if this is intended.
    Best regards.

    OK, I will explain in detail what we are doing (basically our testcase):
    We have a Fortran program which defines a character and a double variable. We fill the char with "2.726". Convert this via Fortran read Method to double. Print the resulting double, which is 2.726.
    Now we call a C Wrapper which does nothing else than just creating a JVM.
    We do the same test as above in the Fortran program, just now the resulting double value is 2.000
    To prevent misunderstandings, I will also copy the code of both programs here:
    Fortran:
    character(len=4096)::tstr
    double precision tdbl
    tstr="2.726"
    read (tstr,*) tdbl
    print *,"before JVM creation: result=",tdbl
    call cfunc
    tstr="2.726"
    read (tstr,*) tdbl
    print *,"after JVM creation: result=",tdbl
    end program
    C part:
    #include <jni.h>
    JavaVM *jvm;
    JNIEnv *env;
    int cfunc()
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString = "-Djava.compiler=NONE";           /* disable JIT */
    vm_args.version = JNI_VERSION_1_4;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = 0;
    JNI_CreateJavaVM(&jvm, (void **)&env, &vm_args);
    return 0;

  • I want to add timing in my program

    my program wants to run between specified time 5 mins or  10 mins.. it should be chosen manually
    please help me to add this 
    kindly help me frndz
    Solved!
    Go to Solution.
    Attachments:
    GetIPStatus- latest (1).vi ‏30 KB

    Just wrap it all in a while loop with a timer connected to the Stop function. After the loop, wire empty string arrays to your ItemNames property nodes.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • How can I link between FORTRAN program and Labview

    I try to use lapviwe to link betwwen different codes one of the them is FORTRAN *.for and the other is Neurosolution breadboards *.nsb but I don't know how so if you can help me I'll do appreciate that for you.

    ahmedr40,
    I would suggest building the FORTRAN code into a DLL as well as the breadboard code. You can then use the Call Library Function node to call the compiled code. This would be the easiest and fastest method. You could also compile these pieces of code and link them to some C/C++ code that you can write and then call this code from LabVIEW.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Timing an entire program in labVIEW

    I am doing a project with different sensors I need to be able to time how long the program is running from power on to off. Has anyone any suggestions as to how to do this.

    As soon as the program starts, get the timestamp using Get Date/Time In Seconds.  Store that value somewhere (like in a shift register).  You can then get the current time with the same fuction and subtract the timestamp value from the program start.  You now know how long the program has been running.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Timing in OOP programming

    Hi,
    I need to get the order in which stuff happens in my first game right. Here is what I want to do.
    Player clicks play button, button goes away and timer starts. //This is all working fine
    Next I want a text box to animate for 60frames. //This works fine
    ONLY then I want my next movie clips to start playing
    How do I make step 3 wait for that 60 frames? I have no idea of how to code this.
    Please help
    Charine

    Hi kglad,
    I built a new timer with an event listener to trigger the appearance of my text box after the play button has been pushed.
    Once the first event has played I will make the next one follow. But I have a problem with the first even.
    My swf runs, but without the text box. It gives me the following error message the second time round:
              Word Timer Started
              TypeError: Error #1009: Cannot access a property or method of a null object reference.
                  at BugGoopFSGame/placeMyWordBox()
                  at flash.utils::Timer/_timerDispatch()
                  at flash.utils::Timer/tick()
              Word Timer Finished
    My main .as file has the timers. The one not working call a function for wordArray.placeMyWordBox();
    My WordArray .as file is for the word array in which the loop and all the logics will work. In it it has this function
    public function placeMyWordBox():void
                addChild(wordBox);
      3.My WordBox .as class file is the one in which the text box with TLF text lives within a movie clip (embedded text)
    I checked for spelling mistakes and syntex errors - can't find anything. How do I fix this?
    Thanks
    Charine
    Here are my files:
    1. Main .as file with three timers. Two work (game and tile timers) and the word timer give above error
    package
        import flash.display.*;
        import flash.utils.Timer;
        import flash.events.*;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.text.*;
        import flash.//others not relevant to this
        public class BugGoopFSGame extends MovieClip
            public var *//lots not relevant,
            public var gameTimer:Timer;
            public var wordTimer:Timer;
            public var tileTimer:Timer;
            public var myplaybtn:Play;
            public var wordBox:WordBox;
            public var wordArray:WordArray;
            public function BugGoopFSGame()
                 // lots of children not relevant
                myplaybtn = new Play();
                addChild(myplaybtn);
                gameTimer = new Timer(31,5120);
                wordTimer = new Timer(1000,1); //Just once for 60 flames, because I want game timer to follow this later.
                tileTimer = new Timer(500,384);
                //Add event listener for start button
                myplaybtn.addEventListener(MouseEvent.CLICK, startTimer);
                //Add event listener for Game timer WORKS FINE;
                gameTimer.addEventListener(TimerEvent.TIMER, tickTock);
                gameTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerFinished);
                gameTimer.addEventListener(TimerEvent.TIMER, scaleLifeBar);
                // Add event listener for tileTimer functions WORKS FINE
                tileTimer.addEventListener(TimerEvent.TIMER, runTile);
                tileTimer.addEventListener(TimerEvent.TIMER_COMPLETE, tileTimerFinished);
                tileTimer.addEventListener(TimerEvent.TIMER, gameLoop);
                //Add event listener for word Timer functions - problem here
                wordTimer.addEventListener(TimerEvent.TIMER, wordTimerStarted);
                wordTimer.addEventListener(TimerEvent.TIMER_COMPLETE, wordTimerFinished);
                wordTimer.addEventListener(TimerEvent.TIMER, placeMyWordBox);// This does not run in swf
            //Start timer function
            public function startTimer(timerEvent:MouseEvent):void
               gameTimer.start();
                trace("Timer started");
                myplaybtn.visible = false;
                tileTimer.start();
                trace("TileTimer started");
                wordTimer.start();
                trace("Word Timer Started");
           public function tickTock(timerEvent:TimerEvent):void
                trace("Tick");
            public function timerFinished(timerEvent:TimerEvent):void
                trace("Timer is finished");
            public function runTile(timerEvent:TimerEvent):void
                trace("Run Tile, RUN!")
                public function tileTimerFinished(timerEvent:TimerEvent):void
                trace("Tile Timer is finished");
            //start wordArray
            public function wordTimerStarted(timerEvent:TimerEvent):void
                trace("Word Timer Started");
            public function wordTimerFinished(timerEvent:TimerEvent):void
                trace("Word Timer Finished");
            public function placeMyWordBox(timerEvent:TimerEvent):void //box never appears in swf
                wordArray.placeMyWordBox();
                trace("WordArray added");
            //Start gameLoop
            public function gameLoop(timerEvent:TimerEvent):void
                        letterArray.gameLoop();
    2.  .as file in which the loop and all the logics will work
    package
        import flash.display.MovieClip;
        public class WordArray extends MovieClip
            public var wordBox:WordBox = new WordBox();
            //private var  wordsL1:Array = ("a","has","of","off","on","not","got","in","is","it");
            // ***constructor code
            public function WordArray()
                trace("Word Array is working");
            public function placeMyWordBox():void
                addChild(wordBox);
    3..as class file in which the text box with TLF text lives within a movie clip (embedded text)
    package 
        import flash.display.MovieClip;
        import flash.text.*;
        public class WordBox extends MovieClip
            public var wordBox = new WordBox();
            // constructor code
            public function WordBox()
                x = 305;
                y = 326;

  • QT7 Open Image Sequence unreliable timing

    Hi, I used "Open Image Sequence" to create a slideshow of 10 jpegs, supposed to be 5 seconds per frame. But when played, the video shows the opening photo for 10 seconds, then plays the others with unpredictable time length (some about 5 seconds as desired; others it flips through in 1-2 seconds.) Am I doing something wrong? How can I get the pictures to actually change every 5 seconds, or if possible, specify how long each photo lasts? thanks

    I have a similar problem.
    I renamed all the images to use only numbers in sequence.
    When I try to create a slide show and select the image in the folder it only shows one and never shows the "Image Sequence Settings" dialog box.
    I can play the slide show, but it shows them at about 3 pictures per second.

  • File exists but program can't open it

    G'day all.
    I am trying to port some fortran programs from a True64 environment into Sun v9/SunStudio 11. On the alpha it has no problems, but on the Sun it can't open a file with a name that is only 78 characters long. The Fortran User's guide states that the maximum length for a file name is 1024 characters.. The file most certainly exists and is readable to the user: stat gives:
    silo@eclipse /silo1/tech1/install/bin -> stat /silo1/tech1/install/import/rtmet/NCC/dayClim/200706/2007062720070627.dc
      File: `/silo1/tech1/install/import/rtmet/NCC/dayClim/200706/2007062720070627.dc'
      Size: 133170         Blocks: 288        IO Block: 8192   regular file
    Device: 1d8005ah/30933082d     Inode: 110852      Links: 1
    Access: (0664/-rw-rw-r--)  Uid: ( 3953/sielewiczj)   Gid: (  700/    ciss)
    Access: 2008-07-23 12:44:00.533357000 +1000
    Modify: 2008-07-04 14:21:00.107423000 +1000
    Change: 2008-07-08 09:27:39.322719000 +1000The compiled Fortran code (called from a wrapper script) however:
    [07/23/08 12:46]: silo_dc_import_wrapper starting
    Determining dates to process
    Now starting to process Silo 1998
    aah, how sweet - found file /tmp/silo/DC_filelist                              
    About to check  /silo1/tech1/install/import/rtmet/NCC/dayClim/200706/2007062720070627.dc                                              
    In file not Found  /silo1/tech1/install/import/rtmet/NCC/dayClim/200706/2007062720070627.dc                                                Bye
    ******  FORTRAN RUN-TIME SYSTEM  ******
    Error 2:  No such file or directory
    Location:  the OPEN statement at line 770 of "dc_importer.f90"
    Unit:  12
    File:   /silo1/tech1/install/import/rtmet/NCC/dayClim/200706/2007062720070627.dc
    AbortNote that it could succesfully open the file /tmp/silo/DC_filelist... The code in question is:
    ! Problematic snippet from much longer program..
             integer*4 eof, ymd
             character*120 in_file, filelist
             logical file_exists
             file_exists = .TRUE.
             filelist = params(2)
             inquire(file = filelist,  exist = file_exists)
             if ( file_exists == .FALSE. ) then
               write(*,'(3a)') 'Not Found ', filelist, ' Bye'
               return
             endif
             print *, "aah, how sweet - found file ", filelist
             open ( unit=11, file=filelist, status='OLD' ) ! THIS succeeds (/tmp/silo/... short filename)
             read ( 11, "(i8, A120)", iostat = eof) ymd, in_file
             do while ( eof == 0 )
                write (*,'(2a)') "About to check " , in_file
               inquire(file = in_file,  exist = file_exists)
               if ( file_exists == .FALSE. ) then
                 write( *, '(3a)') 'In file not Found ', in_file, ' Bye'
    !             return (commented out to see if open also gives an error..)
               endif
             open ( unit=12, file=in_file(1:len_trim(in_file)) , status='OLD' ) ! THIS is where the program bombs out.
             end doI am stumped. Why would this bomb out? The file exists, is readable, the filename is << 1024 characters.. I've also tried to run this as the user who owns the file, to no avail. Any suggestions, please?
    Cheers,
    Tony

    First, check to be sure the program has read and execute access on every directory in the path to the file.
    If the directory permissions are all OK, run your program under truss:
    truss -f -a -vall -o /output/file/name/here your.progam.hereThere should be something like a stat() and an open() call for that file shown as failing in your truss output file. Hopefully that will give you some more information.

  • Problem when calling external program

    Hi,
    I have a strange problem and no more idea how to solve it.
    What I do:
    In Java I call an external Fortran-exe with Runtime.getRuntime().exec(...) This Fortran program creates 4 files.
    What I get:
    One of the 4 files is incomplete, the first few lines are missing.
    What makes me wonder:
    When I take the exec-statement to the commandline and let it run there, everything is fine and the files contain all the info I need. All the 4 files are correct then.
    What I also tried:
    I tried to copy the (incomplete) file within Fortran. That means when I call the Fortran program I get 2 identical files then but with different filenames. Doing so on the commandline everything is fine again. But again, the same commandline String called in the exec in my Java program it is getting worse: The formerly incomplete file is empty now with 0 bytes.
    Even if I wait for the process to finish does not help.
    I do not understand it any more and would really like to know what happens there, why, and what can I do to avoid it or to get my complete output files. What does Runtime.getRuntime().exec(myString) do different than when I take the myString on the commandline?
    Any hints welcome.
    TIA

    Hi,
    unfortunately this does not help. I have already about 15 Fortran programs running this way which work accurately. So a possible problem with output stream does not look reasonable to me in this case.

  • Reading Windows text file in Fortran?

    Is there a way to make the f90 compiler read Windows text files properly? I made a simple test with a text file created on a Windows system containing these three lines:
    This is a Windows text file.
    It has some extra control characters.
    Unix does not have those.
    The output I got was:
    <-ext file.
    <-e extra control characters.
    <-se.
    Kevin

    That makes more sense. The problem isn't with the Fortran program, but with the Unix terminal (xterm, or whatever you're using to display the output). If you pipe the output through od like this you'll see all the characters, including the ^M:
    bash-3.00$ fortranread | od -c
    0000000       w   i   n   f   i   l   e       i   s       -   >   T   h
    0000020   i   s       i   s       a       W   i   n   d   o   w   s   
    0000040   t   e   x   t       f   i   l   e   .  \r                   
    0000060                                                               
    0000100                                           <   -  \n       w   i
    0000120   n   f   i   l   e       i   s       -   >   I   t       h   a
    0000140   s       s   o   m   e       e   x   t   r   a       c   o   n
    0000160   t   r   o   l       c   h   a   r   a   c   t   e   r   s   .
    0000200  \r                                                           
    0000220                               <   -  \n       w   i   n   f   i
    0000240   l   e       i   s       -   >   U   n   i   x       d   o   e
    0000260   s       n   o   t       h   a   v   e       t   h   o   s   e
    0000300   .  \r                                                       
    0000320                                                               
    0000340                   <   -  \n
    0000347When the terminal sees the ^M character, it does a carriage return. That means that the next character gets written in the first column. Since the characters after the ^M are spaces, that makes the beginning of the lines appear blank.
    If you want to see the output you expect, you need to pipe it through "tr -d '\015'", or you need to make the Fortran program itself delete the ^M characters. For example, you could write "myline(1:len_trim(myline)-1)" to always strip the last character of the line.
    We should consider making formatted reads strip the ^M by default. I don't know whether any program would actually want them.

  • Where can I store my VI's so I can use them in other programs

    When I write a VI where can I store this VI to use in other programs as sub-VI's and how do I retreave them.
    (Example) I build a special timing program and want to use this timing in other programs. So iI don't have to re-write this program over and over. I am using LabView 6i with some revisions. (Older cards)

    You can store them where ever you want. To retrieve them you can drag and drop them to the diagram or use "Select a VI..." from the function palette. The later will open a file dialog that will allow you to navigate to where you stored the vi. Another way to do it is to store your vi in the LabVIEW\user.lib directory, then you can retrieve your vi from "User Libraries" in the function palette.
    Hope this helps
    Brian

Maybe you are looking for

  • Error: No authorization to display the message

    Hello Users are getting error : No authorization to display the message, when they are trying to view the content of the message. When checked in the error logs, I see teh below log: Message: Failed (javax.management.MBeanPermission,*,DISPLAY)java.la

  • Applicatio​n Builder and Student Edition

    In Labview 8, student edition where do I go to install application builder?  I suppose its not part of a standard install because I don't think I have it. Message Edited by Adma on 02-18-2006 10:12 PM

  • Quicktime player screen recording prefs

    Hi, Since the upgrade to Mavericks I noticed the screen recording file size has increased by a factor of at least 5. In the Lion, I had the option to set the Quality from High to Medium, that option is missing now from the Screen Recording drop down

  • Howto execute java jar file via html ?

    hi howto execute java jar file via html ? could someone pls post a html code ? kind regards upiter77

  • Using WD APIs in Java Programming

    Hi,      First let me explain my scenario:           I have to get the <b>attachments in a PDF document</b>, using a <b>java program</b>. I am using Java perspective of NWDS. I am using the APIs ->IWDPDFDocumentHandler ->IWDPDFDocumentAccessibleConte