File tree Expand file tree Collapse file tree 12 files changed +25
-20
lines changed Expand file tree Collapse file tree 12 files changed +25
-20
lines changed Original file line number Diff line number Diff line change @@ -2135,7 +2135,7 @@ CCS: Client-Side
21352135A CCS client connects to a CCS server, asks a server PE to execute a
21362136pre-registered handler, and receives the response data. The CCS client
21372137may be written in any language (see CCS network protocol, below), but a
2138- C interface (files “ ccs-client.c” and “ ccs-client.h” ) and Java interface
2138+ C interface (files " ccs-client.C" and " ccs-client.h" ) and Java interface
21392139(file “CcsServer.java”) are available in the charm include directory.
21402140
21412141The C routines use the skt_abort error-reporting strategy; see
Original file line number Diff line number Diff line change 2727//#include "queueing.h"
2828#include <unistd.h>
2929
30-
30+ #include "ck.h"
31+ CkpvDeclare (DebugEntryTable , _debugEntryTable );
3132
3233#if CMK_CHARMDEBUG && CMK_CCS_AVAILABLE && !defined(_WIN32 )
3334
34- #include "ck.h"
35-
3635CkpvDeclare (int , skipBreakpoint ); /* This is a counter of how many breakpoints we should skip */
37- CkpvDeclare (DebugEntryTable , _debugEntryTable );
3836CpdPersistentChecker persistentCheckerUselessClass ;
3937
4038void resetAllCRC ();
Original file line number Diff line number Diff line change 55#ifndef __CCS_CLIENT_H_
66#define __CCS_CLIENT_H_
77
8+ #define CMK_NOT_USE_CONVERSE 1
89#include "sockRoutines.h"
910#include "ccs-auth.h"
1011
Original file line number Diff line number Diff line change 11
22add_library (ccs-client ../conv-ccs/ccs-client.C ../conv-ccs/ccs-client.h)
33target_include_directories (ccs-client PRIVATE ../util)
4+ configure_file (../conv-ccs/ccs-client.h ${CMAKE_BINARY_DIR} /include / COPYONLY )
45
56add_library (memory-default memory.C)
67target_compile_definitions (memory-default PRIVATE -DCMK_MEMORY_BUILD_DEFAULT)
Original file line number Diff line number Diff line change 1- CDIR = ../../../..
1+ include ../common.mk
22-include $(CDIR ) /include/conv-mach-opt.mak
33OPTS =-g -Wall
44CHARMC =$(CDIR ) /bin/charmc $(OPTS )
@@ -33,7 +33,7 @@ PythonCCS.o: PythonCCS.C $(HEADDEP)
3333 $(CHARMC ) -c $(FLAGS ) PythonCCS.C
3434
3535PythonCCS-client.o : PythonCCS-client.C $(HEADDEP )
36- $(CHARMC ) -c $(FLAGS ) PythonCCS-client.C
36+ $(CHARMC ) -seq - c $(FLAGS ) PythonCCS-client.C
3737
3838PythonCCS.decl.h PythonCCS.def.h : PythonCCS.ci
3939 $(CHARMXI ) PythonCCS.ci
Original file line number Diff line number Diff line change 1414 PythonIterator needs to be coherent across client and server.
1515*/
1616
17- #include " converse.h "
17+ #include < stdint.h >
1818#include < stdlib.h>
1919#include < string.h>
2020#include < stdio.h>
2121#include < netinet/in.h>
2222
23+ typedef uint32_t CmiUInt4;
24+
2325/* This class is empty, and should be reimplemented by the user */
2426class PythonIterator {
2527 /* _It is strongly suggested to avoid pointers_, in which case none of the
Original file line number Diff line number Diff line change 26842684fi
26852685
26862686# ### test if Python headers are installed ####
2687- PYTHON_VERSION=`python -V 2>&1 | awk {'print $2'} | awk -F. {'print $1"."$2'}`
2687+ PYTHON_VERSION=`python2 -V 2>&1 | awk {'print $2'} | awk -F. {'print $1"."$2'}`
26882688cat > $t <<EOT
26892689# include "python${PYTHON_VERSION}/Python.h"
26902690# include "python${PYTHON_VERSION}/compile.h"
Original file line number Diff line number Diff line change 11-include ../../common.mk
22CHARMDIR = ../../..
3+ -include $(CHARMDIR ) /include/conv-mach-opt.mak
34CHARMC = $(CHARMDIR ) /bin/charmc $(OPTS )
45INCL = -I/usr/include/python/
5- LIBS = -lpthread -lutil -ldl -lm -lpython2.5
6+ LIBS = -lpthread -lutil -ldl -lm -lpython $( CMK_BUILD_PYTHON )
67INCLC = -I$(CHARMDIR ) /include/
78MODULES = -module PythonCCS -module charmdebug_python
89PYMODULE = $(CHARMDIR ) /lib/libmodulePythonCCS.a
@@ -19,7 +20,7 @@ server.decl.h: server.ci $(PYMODULE) $(CHARMDIR)/bin/charmxi
1920 $(CHARMC ) $<
2021
2122client : client.C
22- g++ $(INCLC ) $(OPTS ) -o $@ $^ $(PYMODULE )
23+ $( CHARMC ) -seq $(INCLC ) $(OPTS ) -o $@ $^ $(PYMODULE ) -lccs-client
2324
2425clean :
2526 rm -f * .decl.h * .def.h * .o server client charmrun * ~
Original file line number Diff line number Diff line change 11#include <stdlib.h>
22#include "ccs-client.h"
3- #include "ccs-client.c"
43#include "PythonCCS-client.h"
54#include <string.h>
65#include <string>
@@ -60,12 +59,15 @@ int main (int argc, char** argv) {
6059
6160 if (useGroups > 0 ) {
6261 MyIterator * myIter = new MyIterator (htonl (4 ));
63- printf ("size: %d (%d)\n" ,myIter -> size (),sizeof (* myIter ));
64- wrapper = new PythonExecute ((char * )code .c_str (), "metodo" , myIter );
65- pythonString = "CpdPythonGroup" ;
62+ printf ("size: %d (%zu)\n" ,myIter -> size (),sizeof (* myIter ));
63+ static char s_metodo [] = "metodo" ;
64+ wrapper = new PythonExecute (const_cast < char * > (code .c_str ()), s_metodo , myIter );
65+ static char s_CpdPythonGroup [] = "CpdPythonGroup" ;
66+ pythonString = s_CpdPythonGroup ;
6667 } else {
67- wrapper = new PythonExecute ((char * )code .c_str ());
68- pythonString = "pyCode" ;
68+ wrapper = new PythonExecute (const_cast < char * > (code .c_str ()));
69+ static char s_pyCode [] = "pyCode" ;
70+ pythonString = s_pyCode ;
6971 }
7072
7173 wrapper -> setHighLevel (true);
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ MyArray::MyArray () {mynumber = thisIndex+1000;}
7272
7373MyArray ::MyArray (CkMigrateMessage * msg ) {}
7474
75- void MyArray ::run (CkCallback & cb ) {
75+ void MyArray ::run (const CkCallback & cb ) {
7676// CkPrintf("[%d] in run %d\n",thisIndex,mynumber);
7777 double _startTime = CmiWallTimer ();
7878
You can’t perform that action at this time.
0 commit comments