Feature #1343

Let user-defined main() work for all execution environments

Added by Phil Miller over 2 years ago. Updated 3 months ago.

Target version:
Start date:
Due date:
% Done:


Related issues

Blocks Charm-NG - Feature #1333: Eliminate need for .ci files New 12/21/2016


#1 Updated by Phil Miller over 2 years ago

  • Parent task deleted (#1333)

This is necessary to eliminating .ci files because of the current arrangement with mainchares

#2 Updated by Phil Miller about 2 years ago

Revisiting this, are there situation where the desired outcome of this issue isn't satisfied?

Maybe readonly variables need some new treatment? What else would get in the way.

I'm going to have some of the Charmworks interns and new hires explore conversion from mainchare to user main() to flesh this out further.

#3 Updated by Eric Bohm over 1 year ago

  • Assignee set to Sam White

#4 Updated by Sam White over 1 year ago

  • Assignee changed from Sam White to Eric Mikida

I think Eric M is already working on this and is a user of its functionality to some extent already.

#5 Updated by Eric Mikida over 1 year ago

  • Status changed from New to In Progress

#6 Updated by Sam White over 1 year ago

  • Target version deleted (6.9.0)

#7 Updated by Eric Mikida 3 months ago

  • Target version set to 6.10.0

I've updated Justin Szaday's patch ( to allow user driven interop to work without mainchares. This allows any charm program to use user-defined main, and removes the need for mainchares as well. It also addresses Phil's above point of still allowing readonlies by splitting the CharmInit into two steps. The old CharmInit is preserved for backwards compatibility.

It does fundamentally change semantics of user driven startup, in that CharmInit returns automatically after charm initialization is done. Previously, it only returned after the charm code called CkExit. However, that meant a mainchare was required. I'm pretty sure Charades is currently the only user of this API, so the breaking changes are not an issue.

#8 Updated by Eric Mikida 3 months ago

  • Status changed from In Progress to Merged

Also available in: Atom PDF