RRA in OpenSim 2.4

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Rebecca Routson
Posts: 25
Joined: Thu Jul 30, 2009 10:19 am

RRA in OpenSim 2.4

Post by Rebecca Routson » Thu May 31, 2012 11:20 am

Hi,

It's been a while since I last ran RRA in OpenSim. I know that two years ago my longest trials were maybe 15 sec. I am now trying to run 50 sec trials in RRA and I cannot get past 20-30 sec (max) of processing before the execution stops.

If I use different timing windows, I can get other sections of the data processed, just not all together. I have plotted the GRF and the COP and they look good. I am certain I am applying the forces correctly as the model is not contorting, flying or falling through the floor. I am using the .mot files created by visual3d in addition to the pipeline they have suggested for RRA. I have also tried running the simulation with Debug = 3 and have not seen any error messages in the messages window. So I am thinking that RRA is unhappy with processing several gait cycles over the 50 sec trial.

So, if you agree with my assessment, I was wondering if you have any suggestions for getting RRA to run for long trials. And I suppose, looking forward, getting CMC to do the same. Apart from that, I am open to any and all other suggestions you may have.

Thank you,
Becca

User avatar
Ayman Habib
Posts: 2235
Joined: Fri Apr 01, 2005 12:24 pm

Re: RRA in OpenSim 2.4

Post by Ayman Habib » Thu May 31, 2012 2:45 pm

Hi Rebecca,

It's possible that what you're seeing is due to the large amount of data you're processing, in many cases the results are kept in memory and written only at the end, so the application runs out of memory. If that's the issue then there're a couple different solutions you can try:
1. Run from the command line: this puts less overhead on the machine you're using and if it takes hours to run then I don't think the rest of the GUI would be useful anyway. Please consult the support site http://opensim.stanford.edu/support/index.html
regarding running RRA from the command line and let us know if you have any questions.

2. Increase the size of heap memory that can be used by the GUI. This can be done following the steps described on this forum thread
https://simtk.org/forums/viewtopic.php? ... 239&p=4477

As a side note, running with Debug = 3 slows down the execution. I'd use it only if there's a crash that you're digging into or you're troubleshooting but I wouldn't leave it on for extended time.

Please let us know how that works for you and best regards,
-Ayman

User avatar
Rebecca Routson
Posts: 25
Joined: Thu Jul 30, 2009 10:19 am

Re: RRA in OpenSim 2.4

Post by Rebecca Routson » Thu May 31, 2012 5:06 pm

Ayman,

Thank you for your quick response.

I tried to run RRA from the cmd line today and I have now gotten OpenSim to process RRA for 30 sec of the trial. Tomorrow I will try for the full 50 sec and let you know, but I think it is going to work.

Thank you again.

Becca

User avatar
Rebecca Routson
Posts: 25
Joined: Thu Jul 30, 2009 10:19 am

Re: RRA in OpenSim 2.4

Post by Rebecca Routson » Mon Jun 04, 2012 12:51 pm

Ayman,

When running RRA from the command line I have experienced the following issue.

After the program runs the full duration it says Printing results to ResultsRRA then:
"This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information."

Then some of the results are printed to ResultsRRA, but I do not get an adjusted OSIM file. Also I do not get an avgResiduals TXT file or an RRA controls XML file. Any idea what I may have wrong in my setup file to be making the command line time out like that before all of the results are written?

Thanks,
Becca

User avatar
Ayman Habib
Posts: 2235
Joined: Fri Apr 01, 2005 12:24 pm

Re: RRA in OpenSim 2.4

Post by Ayman Habib » Mon Jun 04, 2012 3:10 pm

Hi Rebecca,

If I want to guess about what might be wrong it'd be that the RRA Tool doesn't know where to write the adjusted model. Did you specify the path for the adjusted model (under <output_model_files>). If you do and use relative-path/no-path then the adjusted model would be created in the same directory as your pre-adjusted model. We have test codes that do these exact steps. I'd also make sure that the <results_directory> is specified as well as the <adjusted_com_body>.

Hope this helps and please let us know how it goes.

-Ayman

User avatar
Rebecca Routson
Posts: 25
Joined: Thu Jul 30, 2009 10:19 am

Re: RRA in OpenSim 2.4

Post by Rebecca Routson » Tue Jun 05, 2012 8:31 am

Ayman,

I have tried all of these things. I have even specified the exact directory in each of these lines, and still the command line gives me the same error. Also a message pops up telling me there is a runtime error in rra and the program must close. I have changed the directory I am using as well so there are now longer spaces in folder names, but with no alleviation of the problem. I get partial results written in ResultsRRA, but the tool fails while writing the results. I cannot figure out why it gets through 40 sec of RRA but cannot print the results. If I run the same XML files for less time in the Gui it prints all of the results just fine. Any thoughts or suggestions you have would be greatly appreciated.

Thanks,
Becca

User avatar
Ajay Seth
Posts: 136
Joined: Thu Mar 15, 2007 10:39 am

Re: RRA in OpenSim 2.4

Post by Ajay Seth » Tue Jun 05, 2012 12:25 pm

There is a limit on the maximum number of integration steps (under Integrator Settings) which helps to kill very stiff or bad simulations that are taking very tiny steps and would run forever. For long duration simulation like yours, it might be necessary to increase it to 100,000 or more.

User avatar
Rebecca Routson
Posts: 25
Joined: Thu Jul 30, 2009 10:19 am

Re: RRA in OpenSim 2.4

Post by Rebecca Routson » Tue Jun 05, 2012 3:18 pm

Ajay,

That was a good suggestion. I tried it in the command line and unfortunately it did not help. I still have the same problem. Currently I am trying to figure out what the biggest window for which OpenSim will print the results from RRA using the command line and it looks to be about 20 sec. I think it may be an issue with the amount of memory that it is using. I have been running it with the task manager open today. The interesting thing about the gui is that it crashes when it takes up just about 94% of the physical memory on my computer, but even running RRA from the command line after so much analysis time starts to approach 90% of the physical memory. One thing I was wondering is if I can change the frequency for which the RRA is analyzed. I think the strangest thing though is that the results will finish analyzing even for 40 sec trials, but the results will not print. Thanks for your continued support on this issue.

Becca

User avatar
Ayman Habib
Posts: 2235
Joined: Fri Apr 01, 2005 12:24 pm

Re: RRA in OpenSim 2.4

Post by Ayman Habib » Mon Jun 11, 2012 11:10 am

Hi Rebecca,

The GUI has to allocate more resources for visualization and user interaction so it has a bigger footprint as expected, that's why I suggested the command line. I think the problem with the command line lies in locating and or creating the directory where to print the results/adjusted model etc. and would reproduce with a very short analysis window as well (please verify).

The directory handling/assumptions is the main difference between the command line and GUI. If you can reproduce the problem with a small test then please package the model, data and setup files in a bug report and we'll look into it. In the meantime you can increase the allowable memory footprint for the GUI following the instructions on the forum thread
https://simtk.org/forums/viewtopic.php? ... 239&p=4477

Best of luck and please let us know how it goes,
-Ayman

User avatar
Rebecca Routson
Posts: 25
Joined: Thu Jul 30, 2009 10:19 am

Re: RRA in OpenSim 2.4

Post by Rebecca Routson » Tue Jun 12, 2012 2:54 pm

Ayman,

I have submitted a bug report. Please let me know if you get a chance to look at it.

Becca

POST REPLY