MolFlow, scripts

Hallo,

Is there any way to run MolFlow in cycles changing parameters specified in a model by command script?

The idea is to change a parameter and run it either for exising model or through the set of .xml files.

Can you please advise.
Thanks in advance

SEMuser.

Hello,

allowing for a change of parameters directly from Molflow is one of the current priorities for development. Ultimately we plan to provide a console application with advanced scripting capability. No ETA for this though, but we know this is a highly requested feature!
If you are interested in a short term solution, I’d recommend looking into writing your own python, bash or batch script, which will surely need more work on your end for now.

Best regards,
Pascal

Hello Pascal

Excellent news!
Would you be able to provide short HowTo or point to the manuals in which I can find scripting example?
Have a great weekend ahead.

Mike

No, unfortunately scripting is not something official or supported, threfore we didn’t include it in the manuals.
What Pascal meant is that several users created “parameter sweeps” by using - for example - a Python script to generate Molflow-readable XML files that only differ in one paramter value. They were then running them manually, by using the graphical interface.
Before official script support will arrive, one feature that will ease this process will be simple command-line launching of Molflow, so that you can write your own script, load your files (generated on your own), and simply instruct Molflow to run them for a predefined time or hits.
If you decide to do such a parameter sweep on your own, save by GEO or XML extensions, which are human-readable (as opposed to the default .zip format).

Hallo Marton,

Well, thats exactly the point!
I can generate *.xml but then should send it to MolFlow in somehow, i.e.
molflowSub.exe -command-line_with_filename.
Thats the essential minimum.

Would you be able to advise about such a command?
Thanks
MIke

upd.

p.s. That brings us to the point of having documentation about command line for molflowSub.exe?

Currently there is no documentation to be discussed for the “molflowSub.exe”.
All commands are currently forwarded from the main GUI. The subprocesses are – as of now – “stupid” processes with the sole purpose of running simulations. There is minimal preprocessing involved.

For a decent command-line experience we first need to bring several of these preprocessing commands over, otherwise using the GUI opposed to the command-line will demand different sets of files etc.

If there is a larger demand, we would investigate the possibility of launching a short term solution. But for now the focus lies on releasing polished and stable features. And rest assured, first behind the scene steps have already been taken :wink:

Thanks for prompt reply.

I am new to molflow. That may mean I simply dont know yet how to setup such cycles in Molflow.exe via GUI. If thats the case, tell me to RTFM. For example, I could not file _sub.exe file anymore :).

The demand for this is always here, compensating the brain power (i.e., old classic calculus on the paper!) by long boring running through the model.

I am not a professional programmer so, i apologize for my limited knowledge of programmers vocabularly and syntax.

Actually if there is an old.exe (original one) I can program input redirect file.txt>molflow.exe and/or i.e, ,,…<,.
In worst case scenario, one can of course do input redirect for molflow gui, but it looks kind of not optimal.

In other words, You would be willing to give a text example, i.e, set of lines for command.com, of sending the xml file in molflow with a stop trigger, that would be great. I understand this is a subproject, nevertheless, may be worth as preparation of the python API or so.

Warmest Regards
Mike

Dear Mike,

Until we implement what you ask for (similar to molflow.exe input.xml --runtime 1h, there is a hack that doesn’t require any programming.

If the parameter you’d sweep is either opacity, sticking factor or outgassing, and your system’s time constant is small (i.e. it stabilizes to a constant pressure after a few seconds for a constant input, like most systems), you can “hack” the time-dependent mode to do a parameter sweep.

For this, you have to create a step function as parameter (Time/Parameter editor), taking all values of your parameter sweep:

Then you can use the pressure evolution plotter to view the system’s pressure response. Ideally, you would see the pressure quickly converge after each parameter change, thus - in reality - yielding the outcome for every parameter. Using the Time/Time Settings dialog, you can “select” any time moment to visualize the system state (profiles, textures, pressures) at that moment.

Therefore you “hack” Molflow’s time-dependent mode to do one long simulation that does a parameter sweep.

Dear Marton Ady,
Thank you for the advise. I will try go this way. If there is any update coming from you side, please feel free to update the topic.
Thank you and your colleques for the prompt and fruitful responce!
Mikhail

Dear Marton,

Here’s another vote for a scripting interface. I’m glad to hear it’s in the works!

Best,
Alec

1 Like

Dear Marton.

Thanks for replies.

Hereby just wonder is there any advantage of using Linux, OSX over Windows version of MolFlow in relevance to scripting?

Best Regards
Mikhail

Since we can’t make any promises about the full scripting capability within Molflow right now, I can only go with a personal recommendation.
While we try our best to maintain cross-plattform support for all features, it can always be helpful to build local scripts for yourself.
With Linux you have most powerful tools at hand, which is also true for OSX to some degree. My recommendation is to stick with one of the two, as it will make life easier if you have access to a HPC cluster (these are usually Unix based).