Products

The Merge Men: A Simcenter Amesim Tale

From Integration Nightmares to Three-way Merge Magic

Today’s the day.

Weeks of intense work on Simcenter Amesim models culminate here. Two teams of simulation engineers – the electric drive (Peggy and Sal) and passenger comfort (Ken and Pete) teams – have been hard at work to reach performance goals. Now is the time for their work to be merged, and for the air conditioning system designed by our PASCOM whizzes to be integrated into the overall model. That’s where I come in – I’m tasked with combining the work of both teams into one final model.

It's 9:15 AM, I'm locked in for what I know will be an intense day. The familiar bong of my email client announces the arrival of a new message – could this be it? Palms slightly damp, I alt-tab to the client and mouse over the message. 

Subject: RE: RE: FW: AirCon Loop model for integration

This is starting well, looks like it's passed through a few pairs of hands already...
Ugh. A file attachment:

EVDrivetrain_ACLoop_forIntegration_attempt2_v3_final.piz

So many iterations. An extension rename to hoodwink the email client? A bead of sweat forms at the back of my head and starts making its way down my spine.
I start reading the email, then skip to the interesting bit:

“All you have to do is:” [...]

followed by a thousand intricate and easy-to-fudge changes to make to the combined model. What the...
In a frenzy, I read down the list and reach the last item:

“Say a quick prayer because combining these models rarely goes as expected at the first attempt. Good luck!”

How did we get here? Is this really how this has to be? I feel trapped. It gets harder to breathe as I start getting overwhelmed by the difficulty of what I'm about to attempt...
The nightmare of model merging

…GASP! I wake up, drenched in a cold sweat. I grab my phone off my bedside table – it’s 5:47 AM, integration day. Deep calming breaths slow my heart down – it was just a nightmare. With 45 minutes to go before the day starts, I fall back asleep, with the quiet hope that things are going to go well today.

9:15 AM – Integration Day at the Agency

I’m locked in for what I know will be an intense day. A freshly brewed coffee sits in front of me – but no email chimes come this time. I go straight to Simcenter Amesim and open up Simcenter Client for Git. I have a game plan for today.
You see, the nightmare I had this morning wasn’t just a nightmare, it’s an echo of the past. A past I’m glad I’ve left behind.
This time around, we started versioning everything in System Simulation Client for Git, and used the same model as a basis for both teams’ work. We then split the activities into two branches, focused on their own goals and with their own constraints.
Each of the teams has worked on its own version of the model, with System Simulation Client for Git’s role-based access management feature. We have been able to independently work on models, data files and user libraries, since Client for Git automatically manages these dependencies for us. This has given us freedom to make big changes without fear of stepping on other departments’ toes.
The key to us being able to collaborate effectively together lies in how everything can come together in the end. Both the Passenger Comfort department’s model and that of my fellow electric drive systems colleagues’ have changed quite significantly from that shared initial point. Let’s see how System Simulation Client for Git can handle this historically messy bit of model integration…

Just as I have this thought pinging through my mind, my colleague Roger rushes in, clearly panicked.

“Which version of Simcenter Amesim are the drivetrain folks running??”
“Let me see... It's Simcenter Amesim 2504 - why?”

Rogers’s shoulders relax, and a slow happy smile spreads across his face.

“Did you hear about the new-”
“Yep, I just finished checking out this nice blog post about it!”
“Yeah, looks pretty promising. Go ahead with the merge then, let me know if you need help!”

Roger ambles out, clearly showing scars of a similar past experience to mine. I guess sooner or later we all become hardened veterans when it comes to collaborating on complex projects.

9:45 AM – The Version History

Coffee in hand, I open my own model in Simcenter Amesim. Since it is managed in System Simulation Client for Git, I automatically get a bird’s-eye view of the history of my model collection.

First on the list is to go through my collection’s version history and ensure that my model is ready to be merged.

Both teams have been very busy, advancing their Electrical Vehicle simulation models in separate branches, responding to new needs and challenges

My versioning comments seem in order, but I know Simcenter Amesim 2504 has a couple of tricks up its sleeve. I multiple-select my latest and initial versions, and right click – there it is: the new Model Comparison baked right into Simcenter Amesim, and fully integrated into System Simulation Client for Git.

Sal compares his work with earlier iterations made by his colleague Peggy, early on in the design process.

The nifty new sketch preview in Simcenter Amesim 2504 helps me keep my finger on the pulse of all the differences – I click a difference, and up pops the component it corresponds to. The days of manually cross-referencing parameter values and component names are left behind me in the dust. 

I’m in the zone now, running down the checklist of changes between the two models, to make sure that the work we’ve all been doing can finally be merged.

I can’t miss a single thing here – every single connection, submodel and parameter value needs to be just right, otherwise I might really be in trouble once I try to combine the two models. Thankfully, Model Comparison allows me to dive deep into the detail, so I have control of everything.

10:15 AM – The Comparison

Okay, final checks done. It’s time to finally do this. My old copy/paste/pray techniques long abandoned, I go back to the version history for this collection. Luckily, it also shows me the evolutions that my e-Drive colleagues have been working on.

My friend Peggy from the EV drivetrain department has just informed me that the final checks on her side are a go as well – the time has come: I pull up the contextual menu for the model with the thermal cooling loop and click “Merge from”.

Tense seconds go by while System Simulation Client for Git attempts an automatic merge – if we are extremely lucky, the changes I’ve made to the model are to different parts compared to Peggy’s model. Let’s not kid ourselves though…

Sure enough, System Simulation Client for Git dutifully tells me that my collection is in a state of conflict, and I’m prepared: I pull out my fine model-versioning scalpel and open Three-way Merge to manual resolve the merge conflicts.

Slightly overwhelmed with the sheer amount of difference rows, I quickly get the hang of this thing: Three-way Merge is showing me a simultaneous comparison between the latest versions of both e-Drive and AC loop models, and the initial model which both projects are based on.

Both design branches are ready to be merged into a single integrated model

Now it’s just a matter of picking and choosing – every single conflict where Peggy and Ken’s teams have both made concurrent changes to the model is a decision to be made. I can easily see where our modeling assumptions have differed, and how that affects the structure and parameterization of our models.

Merging the models goes by in a breeze: conflicts are highlighted, choices are clear, and the models will be merged into their final state automatically by Three-way Merge

Since I oversee the final integration, things are flowing, not a hitch in sight. I hop on a quick call with Sal and Pete at one point, since I was stumped by one of the conflicts, and we were able to quickly make the right choice – both teams messed up a parameter value, and should have left it as it was initially set. With the right choice settled, the change is as easy as a simple button press.

10:55 AM – The Resolution

I reach the bottom of the conflict list – I’ve made a choice for every single item, and I haven’t even broken a sweat.

My experience of past troubles rears its head one last time just as I’m about to click “Save and quit” to finalize the merge – but it’s gone as quickly as it came. Once that’s done, my model in Simcenter Amesim is refreshed with all the changes I’ve made.

I quickly go through it, making tweaks to connections and ensuring that everything is as I had set it. It all looks good.

My work here is done. Or as Don would say: “Get out of here and move forward. This never happened. It will shock you how much it never happened”

That beautiful moment has arrived: Resolve conflict -> mark as resolved áááánd upload.

11:00 AM – This Is My Moment

Job done. And to think that this would have taken me multiple days in the past. HA!

Merge completed before lunch
Who’s up for a mid-morning drink snack?

[As our hero walks to his office door he abruptly turns and looks straight into the camera]: Next time you’re faced with a model-merging nightmare in your collaborative projects with Simcenter Amesim, remember: with the right tools, integrating systems models is less like bomb-defusal and more like… snapping together bricks – modular, intuitive, and oddly satisfying.

This feature is part of the Simcenter Amesim 2504 release:

Read Simcenter Amesim reviews on G2
Karim Nassar
Chiel Verhoeven

I'm a technology enthusiast for advanced engineering technologies within the Siemens Simcenter portfolio

More from this author

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/simcenter/the-merge-men/