Skip to content

Commit

Permalink
- Implemented libmodparomc.a (the stub version of modpar)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7107 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Nov 19, 2010
1 parent d70d44e commit dbdf0f4
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 20 deletions.
36 changes: 18 additions & 18 deletions Compiler/TaskGraphExt.mo
Expand Up @@ -42,7 +42,7 @@ public function newTask
input String inString;
output Integer outInteger;

external "C" ;
external "C" outInteger=TaskGraphExt_newTask(inString) annotation(Library = {"modparomc"});
end newTask;

public function addEdge
Expand All @@ -51,14 +51,14 @@ public function addEdge
input String inString3;
input Integer inInteger4;

external "C" ;
external "C" TaskGraphExt_addEdge(inInteger1,inInteger2,inString3,inInteger4) annotation(Library = {"modparomc"});
end addEdge;

public function getTask
input String inString;
output Integer outInteger;

external "C" ;
external "C" outInteger=TaskGraphExt_getTask(inString) annotation(Library = {"modparomc"});
end getTask;

public function storeResult
Expand All @@ -67,105 +67,105 @@ public function storeResult
input Boolean inBoolean3;
input String inString4;

external "C" ;
external "C" TaskGraphExt_storeResult(inString1,inInteger2,inBoolean3,inString4) annotation(Library = {"modparomc"});
end storeResult;

public function dumpGraph
input String inString;

external "C" ;
external "C" TaskGraphExt_dumpGraph(inString) annotation(Library = {"modparomc"});
end dumpGraph;

public function dumpMergedGraph
input String inString;

external "C" ;
external "C" TaskGraphExt_dumpMergedGraph(inString) annotation(Library = {"modparomc"});
end dumpMergedGraph;

public function registerStartStop
input Integer inInteger1;
input Integer inInteger2;

external "C" ;
external "C" TaskGraphExt_registerStartStop(inInteger1,inInteger2) annotation(Library = {"modparomc"});
end registerStartStop;

public function getStartTask
output Integer outInteger;

external "C" ;
external "C" outInteger=TaskGraphExt_getStartTask() annotation(Library = {"modparomc"});
end getStartTask;

public function getStopTask
output Integer outInteger;

external "C" ;
external "C" outInteger=TaskGraphExt_getStopTask() annotation(Library = {"modparomc"});
end getStopTask;

public function mergeTasks
input Real inReal1;
input Real inReal2;

external "C" ;
external "C" TaskGraphExt_mergeTasks(inReal1,inReal2) annotation(Library = {"modparomc"});
end mergeTasks;

public function schedule
input Integer inInteger;

external "C" ;
external "C" TaskGraphExt_schedule(inInteger) annotation(Library = {"modparomc"});
end schedule;

public function generateCode
input Integer inInteger1;
input Integer inInteger2;
input Integer inInteger3;

external "C" ;
external "C" TaskGraphExt_generateCode(inInteger1,inInteger2,inInteger3) annotation(Library = {"modparomc"});
end generateCode;

public function setExecCost
input Integer inInteger;
input Real inReal;

external "C" ;
external "C" TaskGraphExt_setExecCost(inInteger,inReal) annotation(Library = {"modparomc"});
end setExecCost;

public function setTaskType
input Integer inInteger1;
input Integer inInteger2;

external "C" ;
external "C" TaskGraphExt_setTaskType(inInteger1,inInteger2) annotation(Library = {"modparomc"});
end setTaskType;

public function setCommCost
input Integer inInteger1;
input Integer inInteger2;
input Integer inInteger3;

external "C" ;
external "C" TaskGraphExt_setCommCost(inInteger1,inInteger2,inInteger3) annotation(Library = {"modparomc"});
end setCommCost;

public function addInitVar
input Integer inInteger1;
input String inString2;
input String inString3;

external "C" ;
external "C" TaskGraphExt_addInitVar(inInteger1,inString2,inString3) annotation(Library = {"modparomc"});
end addInitVar;

public function addInitState
input Integer inInteger1;
input String inString2;
input String inString3;

external "C" ;
external "C" TaskGraphExt_addInitState(inInteger1,inString2,inString3) annotation(Library = {"modparomc"});
end addInitState;

public function addInitParam
input Integer inInteger1;
input String inString2;
input String inString3;

external "C" ;
external "C" TaskGraphExt_addInitParam(inInteger1,inString2,inString3) annotation(Library = {"modparomc"});
end addInitParam;
end TaskGraphExt;

8 changes: 6 additions & 2 deletions Compiler/modpar/Makefile.in
Expand Up @@ -26,11 +26,15 @@ OBJECTS = Codegen.o \
else
OBJECTS = TaskGraphExt_stub.o
endif
all: libmodpar.a
all: libmodpar.a libmodparomc.a

libmodpar.a: $(OBJECTS)
ar -sr $@ $(OBJECTS)

libmodparomc.a: TaskGraphExt_stub_omc.o
ar -sr $@ $<
cp $@ $(builddir_lib)/omc

INCFLAGS =-I$(RMLINCLUDE) -I$(BOOST_HOME) -I$(top_builddir)/mosh/src

CFLAGS = $(INCFLAGS) -g -Wall -DUNIX=1
Expand All @@ -56,4 +60,4 @@ reallyclean: clean
.PRECIOUS: Makefile

Makefile: Makefile.in
$(top_builddir)/config.status Makefile
(cd $(top_builddir); ./config.status)
130 changes: 130 additions & 0 deletions Compiler/modpar/TaskGraphExt_stub_omc.cpp
@@ -0,0 +1,130 @@
#include <iostream>
#include <fstream>
#include <map>
#include <set>
#include <string>
#include <vector>


using namespace std;


extern "C"
{
#include <assert.h>

static void errormsg()
{
cerr << "MODPAR disabled. Configure with --with-BOOST=boostdir and --with-MODPAR and recompile for enabling." << endl;
}

extern int TaskGraphExt_newTask(const char* _inString)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_addEdge(int _inInteger1, int _inInteger2, const char* _inString3, int _inInteger4)

{
errormsg();
throw 1;
}

extern int TaskGraphExt_getTask(const char* _inString)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_storeResult(const char* _inString1, int _inInteger2, int _inBoolean3, const char* _inString4)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_dumpGraph(const char* _inString)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_dumpMergedGraph(const char* _inString)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_registerStartStop(int _inInteger1, int _inInteger2)
{
errormsg();
throw 1;
}

extern int TaskGraphExt__getStartTask()
{
errormsg();
throw 1;
}

extern int TaskGraphExt__getStopTask()
{
errormsg();
throw 1;
}

extern void TaskGraphExt_mergeTasks(double _inReal1, double _inReal2)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_setExecCost(int _inInteger, double _inReal)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_setCommCost(int _inInteger, double _inReal)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_schedule(int _inInteger)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_generateCode(int _inInteger1, int _inInteger2, int _inInteger3)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_addInitState(int _inInteger1, const char* _inString2, const char* _inString3)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_addInitParam(int _inInteger1, const char* _inString2, const char* _inString3)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_addInitVar(int _inInteger1, const char* _inString2, const char* _inString3)
{
errormsg();
throw 1;
}

extern void TaskGraphExt_setTaskType(int _inInteger1, int _inInteger2)
{
errormsg();
throw 1;
}

} // extern "C"

0 comments on commit dbdf0f4

Please sign in to comment.