Jump to content

XMDF Error = -4002

Recommended Posts

We have been using the output XMDF command and we have had quite a few model failures as a result. The error message that is given is as follows:

ERROR - Could not open XMDF output file.

XMDF File = Porlock_001_240_10_Q75ww.xmdf; XMDF Error = -4002

We had one failure whilst trying to view the XMDF file in SMS during the model run which interrupted the output but most other failures have been through the night, presumably due to network glitches. Our models are running in batch and when one of these failures occurs the DOS window remains open so the next run in the batch does not start. Does the flag you can add to the batch file to force the next simulation to commence also work with this error message? Also is there any other way to reduce these errors other than running on a local drive?


Share this post

Link to post
Share on other sites

Hi Matt

I've had a couple of replies from the XMDF coders regarding Error -4002 which I've summarised at the end below. I suspect the problem has arisen due to the network glitches with TUFLOW unable to open the xmdf file for writing. FYI, TUFLOW closes off and reopens the file between output times, primarily so that you can view results as TUFLOW is running. If you are having network glitches, output using any format will have problems (for example, if using .dat files TUFLOW will just crash).

I like your suggestion about pausing or going into a holding pattern until the file can be opened/accessed. This would have to be coded into TUFLOW and will add to the list. In the meantime you may have to redirect the output to the local drive (this is what we always do) using the .tcf and .ecf "Output Folder ==" in case you're not familiar with that command. This will also be faster and won't clog up your network.

If you wanted to move the .xmdf file(s) from your local drive to the network at the end of the simulation you could use the copy or move commands like the below in your .bat file (use quotes if there are spaces in the pathnames).

copy /Y c:\tuflow\results\my_run.xmdf n:\tuflow\results


move /Y c:\tuflow\results\my_run.xmdf n:\tuflow\results

The /Y above suppresses asking if you want to replace an existing file by the same name. Enter "help copy" or "help move" on a DOS prompt and you'll get more info on the various options for these commands. You can also use wildcards to move more than one file, for example:

move /Y c:\tuflow\results\*.xmdf n:\tuflow\results

Comments on XMDF Error -4002 from the XMDF coders:

The error code -4002 happens when we try to open a file and aren't able to read the filetype string indicating that it is an XMDF file. It can also happen if it's not possible to open the file for writing. The latter seems the most likely culprit if network glitches are occurring.



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...