Problem when working with several femm instances

Hey,

I try to simulate a big task in the femm tool with octave. In order to decrease the calculation time I tried to parallelize the program. I’m still working on the correct usage of the parallel package, but tried first to parallelize the program “manually”. I wrote several m-scripts to call the longest loop only once with different arguments and ran all the m-scripts so my pc could decide which core to use.
This means I have to work with several instances of femm and I’m not sure, if I treated the handles right, because I got following error:

error: com_invoke: property/method invocation on the COM object failed with error 0x80020009

I don’t know where to search for my error or if there are better ways to achieve a solution. Maybe someone can help me with this?

Does it work if you don’t work with several instances of femm? I.e., does it also fail if you call one script after the other?

I tried the first script for about an hour and in this time it worked perfectly. The total calculation time (of all scripts afterwards) is about 150h so I didn’t try it for all the scripts.

To my surprise at a closer look, I saw that one of the 20 scripts succeeded while it seems that all the others canceled short after the start.

Are all of these scripts similar? Meaning: Is it possible some use different COM calls than the one succeeding?

The are using all the same code. It’s a for-loop with 20 iterations, with about 1 day per iteration. That’s why I split these and call the loop 20 times out of an own Octave instance each.

So I have a main script where I set all the parameters and then call the function for the femm script with only the value of the for-loop different. In the function I set the iteration index to this value. so all the 20 scripts call the same function with the similar femm-code.

Does that spawn 20 femm instances? Or does that connect to the same femm instance 20 times?

It spawns 20 femm instances.

I think I found a solution. It seems like I saved the geometry of the femm model with the identical name for all instances, so many of them were overwritten. If I copy the code in own folders, so that in every folder are all necessary scripts, it works perfectly. Then the geometry is saved in the dedicated folder and the instances can work independent.