Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Extracting .mph files from recovery files folder

Please login with a confirmed email address before reporting spam

I am running Comsol 4.2 on Linux cluster. Comsol saves the recovery files in a specified directory (using option -recoverydir <path>) which saves data till last time step. However it is not in the .mph format but .mphbin files for mesh, sol1, geometry etc. All the data is there in the recovery folder but i do not know how to extract it into usable form.

Can we extract the full .mph model from these files? Please share your experience, thanks in advance. I am attaching the snapshot of how the recovery folder looks like and what it contains with this email.

I have tried contacting comsol support also but no reponse so far.


11 Replies Last Post Feb 15, 2017, 3:14 p.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 5, 2012, 5:27 a.m. EDT
Hi

I have so to say never neded to use the recovery feature (that does not mean that COMSOL does not crash time to time also for me ;) . But there is a File Open Recovery, have you tried that ?

On the other side most mph files are zipped ascii and binary xml files, but I have never seen the info about it's internal structure

--
Good luck
Ivar
Hi I have so to say never neded to use the recovery feature (that does not mean that COMSOL does not crash time to time also for me ;) . But there is a File Open Recovery, have you tried that ? On the other side most mph files are zipped ascii and binary xml files, but I have never seen the info about it's internal structure -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 5, 2012, 10:28 a.m. EDT
Thanks Ivar.

Yes, i tried open recovery file menu but it doesn't give me the last saved model on my desktop.

On linux cluster, i am running comsol in batch mode and all i get is the recovery folder with no .mph files but .mphbin files for mesh, solution, geom etc. The data is there and the size of sol1.mphbin increases dynamically as solver moves on but in the end, i can not extract the .mph models.

I will try few other things and post back, if i am successful. Thanks again for your reply.
Thanks Ivar. Yes, i tried open recovery file menu but it doesn't give me the last saved model on my desktop. On linux cluster, i am running comsol in batch mode and all i get is the recovery folder with no .mph files but .mphbin files for mesh, solution, geom etc. The data is there and the size of sol1.mphbin increases dynamically as solver moves on but in the end, i can not extract the .mph models. I will try few other things and post back, if i am successful. Thanks again for your reply.

Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 5, 2012, 11:05 p.m. EDT
The time/date on the recovery file menu is a little misleading. To find the actual time stamp of the last saved iteration/time step, you go look at the last-written file in the recover-file directory. When you know which recovery-file you want (probably the latest), then open that recovery "record". If it is an blank empty work space, the name of the model will be untitled.mph. At this point, you can verify what is there by plotting results, etc. Then just save-as just like you normally might save a model file to a different name. You now have your .mph file with all data recovered.

I do this routinely when I want need to actually manually kill a long-running job, but want to recovery what I can. It works well.
The time/date on the recovery file menu is a little misleading. To find the actual time stamp of the last saved iteration/time step, you go look at the last-written file in the recover-file directory. When you know which recovery-file you want (probably the latest), then open that recovery "record". If it is an blank empty work space, the name of the model will be untitled.mph. At this point, you can verify what is there by plotting results, etc. Then just save-as just like you normally might save a model file to a different name. You now have your .mph file with all data recovered. I do this routinely when I want need to actually manually kill a long-running job, but want to recovery what I can. It works well.

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 6, 2012, 8:55 a.m. EDT
Hi James

thanks for the tip, I had given up finding out how, so hat trick will gain me several hours nextt ime I need to abort a task ;)

--
Good luck
Ivar
Hi James thanks for the tip, I had given up finding out how, so hat trick will gain me several hours nextt ime I need to abort a task ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 7, 2012, 12:54 a.m. EDT
Thanks James. It would be very useful but i guess this is for windows system where i can access they 'open recovery files' from the 'file menu'.

I am unable to figure about how to extract data from the last saved recovery file on linux cluster.

Thanks for your reply.
Thanks James. It would be very useful but i guess this is for windows system where i can access they 'open recovery files' from the 'file menu'. I am unable to figure about how to extract data from the last saved recovery file on linux cluster. Thanks for your reply.

Jim Freels mechanical side of nuclear engineering, multiphysics analysis, COMSOL specialist

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 7, 2012, 9:32 a.m. EDT
Windows ? Not here. I am an exclusive Linux user (until I absolutely have to run windows which is rare these days).

Step 1. left click "file" in the upper left-hand corner of the COMSOL menu buttons.

Step 2. left click "open recovery file" (the third item down).

Step 3. left click the latest time step recovery file in the list; COMSOL reads in the data

Step 4. do what you want to this model (view, change, etc.)

Step 5. left click "file" again

Step 6. left click "save-as" (fifth item down the list)

Step 7 . well, I assume you can handle it from here.

If you don't have a file listed in Step 2, you have not set the preferences to save recovery files. Do that before you run a job.

Windows ? Not here. I am an exclusive Linux user (until I absolutely have to run windows which is rare these days). Step 1. left click "file" in the upper left-hand corner of the COMSOL menu buttons. Step 2. left click "open recovery file" (the third item down). Step 3. left click the latest time step recovery file in the list; COMSOL reads in the data Step 4. do what you want to this model (view, change, etc.) Step 5. left click "file" again Step 6. left click "save-as" (fifth item down the list) Step 7 . well, I assume you can handle it from here. If you don't have a file listed in Step 2, you have not set the preferences to save recovery files. Do that before you run a job.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago May 7, 2012, 10:33 a.m. EDT
Thanks James for detailed instructions. I will try that and hope it will work.

Thanks again.
Thanks James for detailed instructions. I will try that and hope it will work. Thanks again.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 11, 2013, 9:51 a.m. EST
I have a similar problem..I find the recovery file saved in the recovery folder...but that file (latest saved) does not show up in the open recovery file menu. I am using windows.
I have a similar problem..I find the recovery file saved in the recovery folder...but that file (latest saved) does not show up in the open recovery file menu. I am using windows.

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Dec 11, 2013, 10:01 a.m. EST
Ok figured it out...Like Ivar said the date stamp is all messed up! The date shown in the name and the date actually saved are not the same...
Ok figured it out...Like Ivar said the date stamp is all messed up! The date shown in the name and the date actually saved are not the same...

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Nov 23, 2016, 4:18 p.m. EST
Hi Mranal,

I encountered the same issue that I can locate the recovery file folder with multiple files as you showed in the pictures but it doesn't show in my "Open recovery file" list.
I am wondering did you figure out how to extract those files from the folder, if so, do you remember how you manage it.

Thanks in advance.
Yi
Hi Mranal, I encountered the same issue that I can locate the recovery file folder with multiple files as you showed in the pictures but it doesn't show in my "Open recovery file" list. I am wondering did you figure out how to extract those files from the folder, if so, do you remember how you manage it. Thanks in advance. Yi

Please login with a confirmed email address before reporting spam

Posted: 7 years ago Feb 15, 2017, 3:14 p.m. EST
Hi Yi,

If you can see the files in the folder then all you have to do is go into the C:/User/username/.comsol/version folder and edit the comsol.recoveries file. If you open it with notepad, just copy the location of the recovery file you are trying to open and paste it in the file. Then save the file. Open COMSOL GUI back up and go to the recovery feature and you should see the file that you want to open.

Hopefully this helps,
Martin
Hi Yi, If you can see the files in the folder then all you have to do is go into the C:/User/username/.comsol/version folder and edit the comsol.recoveries file. If you open it with notepad, just copy the location of the recovery file you are trying to open and paste it in the file. Then save the file. Open COMSOL GUI back up and go to the recovery feature and you should see the file that you want to open. Hopefully this helps, Martin

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.