<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Tomasz,<br>
    That's pretty interesting.<br>
    <br>
    Are you aware of the EmbeddedC Actor in Ptolemy?<br>
    See <a class="moz-txt-link-freetext" href="http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#CodeGen">http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#CodeGen</a><br>
    In Ptolemy II 8.0, we have<br>
<a class="moz-txt-link-freetext" href="http://sisyphus:8079/hudson/job/ptII/javadoc/ptolemy/actor/lib/jni/EmbeddedCActor.html#in_browser">http://sisyphus:8079/hudson/job/ptII/javadoc/ptolemy/actor/lib/jni/EmbeddedCActor.html#in_browser</a><br>
    In Ptolemy II devel tree we have<br>
<a class="moz-txt-link-freetext" href="http://sisyphus:8079/hudson/job/ptII/javadoc/ptolemy/cg/lib/EmbeddedCodeActor.html#in_browser">http://sisyphus:8079/hudson/job/ptII/javadoc/ptolemy/cg/lib/EmbeddedCodeActor.html#in_browser</a><br>
    <br>
    I've attached a screenshot.<br>
    <br>
    What the EmbeddedCodeActor does is provide a way to write C code,
    compile it and at run time get and set values. <br>
    <br>
    I may be misunderstanding this, but it seems like your system
    provides a way to wrap main() functions and pass in command line
    arguments and presumably read values.  One nice thing about this is
    that the main() method presumably gets invoked each time fire() is
    called instead of execing an entire separate process with the Exec
    actor.<br>
    <br>
    A slightly different way to do this is to use the bcvtb system and
    connect to a binary via sockets and set and get data that way.<br>
    <br>
    There are many ways to do somewhat similar, but slightly different
    things.<br>
    <br>
    _Christopher<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 3/13/13 6:15 AM, Tomasz Żok wrote:<br>
    </div>
    <blockquote cite="mid:20130313131556.GB19433@thinkpad" type="cite">
      <pre wrap="">Dear Kepler contributors and users,

we are glad to announce availibility of a tool which automates the process of
actor creation from an arbitrary C code.

The idea is to generate Kepler actor from any code that runs as a standalone
executable. It is however a real integration, not a replacement for Exec actor
which runs binaries. As a result of running presented tool you will get an
actor with ports mapped to code arguments and working directly on typed Kepler
tokens (eg. DoubleToken). Technically, your code becomes (fully automatically)
a shared library loaded by the actor when requested.

The principle is that you take an existing code (with "int main()" function,
normally compilable to an executable), use this tool and you get an equivalent
in form of Kepler actor. The only extra effort is to prepare a short XML of
this form:
        <actor>
            <inputs>
                <in type="String" name="myArgument1"/>
                <in type="Integer" name="myArgument2"/>
                <in type="Double" name="myArgument3"/>
            </inputs>
        </actor>

As you can see, it only defines the type and name of the expected inputs


Let's say you have a program used like this:
    ./my_app test 123 1.0

Then you could use the XML as above and will get an actor with three typed
ports. The above program execution would be equal to passing StringToken 
"test" to port myArgument1, IntToken 123 to myArgument2 and DoubleToken 1.0
to myArgument3


The attached archive contains README file with step by step guide. It also
presents an example ready to run by anybody. Additionally I attach a simple
workflow making use of this example and its screenshot.


Some additional notes:
- A common practice in C codes is to explicitly call "void exit(int status)"
  instead of making "int main()" return the exit code. This situation is
  handled, there is no need to change your code if it does this.
- There is also one thing you must be aware of. If your code assumes that some
  files are present in the *current directory* then remember that they will be
  searched for from Kepler's perspective. It is advisable to remove this
  assumption and pass absolute paths as additional code arguments.

Regards,
Tomek, Piotrek and Marcin

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kepler-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kepler-dev@kepler-project.org">Kepler-dev@kepler-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev">http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Christopher Brooks, PMP                       University of California
Academic Program Manager & Software Engineer  US Mail: 337 Cory Hall
CHESS/iCyPhy/Ptolemy/TerraSwarm/TRUST         Berkeley, CA 94720-1774
<a class="moz-txt-link-abbreviated" href="mailto:cxh@eecs.berkeley.edu">cxh@eecs.berkeley.edu</a>, 707.332.0670           (Office: 545Q Cory)
</pre>
  </body>
</html>