This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic Implementation... Probably Broken in some way.
- Loading branch information
Bryan J Lunt
committed
Jun 4, 2013
1 parent
5890cc8
commit 6596e7b
Showing
7 changed files
with
106 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
|
||
CPP=g++ | ||
CC=gcc | ||
|
||
CFLAGS=$(shell pbs-config --cflags) -I/usr/lib/jvm/java-1.7.0-openjdk.x86_64/include/ -I/usr/lib/jvm/java-1.7.0-openjdk.x86_64/include/linux | ||
LIBS=$(shell pbs-config --libs) -ldrmaa | ||
LIBS=$(shell pbs-config --libs) -ldrmaa -lstdc++ | ||
|
||
LIBNAME=lib/libjdrmaa.so | ||
|
||
all: clean lib javac | ||
|
||
javac: jdrmaa_wrap.c | ||
javac: jdrmaa_wrap.cxx | ||
javac jdrmaa/*.java | ||
javac test/*.java | ||
|
||
lib: jdrmaa_wrap.c jdrmaa.i | ||
$(CC) $(CFLAGS) $(LIBS) -fPIC -c jdrmaa_wrap.c | ||
lib: jdrmaa_wrap.cxx jdrmaa.i | ||
$(CPP) $(CFLAGS) $(LIBS) -fPIC -c jdrmaa_wrap.cxx | ||
$(CC) $(LIBS) -shared jdrmaa_wrap.o -o $(LIBNAME) | ||
|
||
jdrmaa_wrap.c: jdrmaa.i | ||
swig -java -package jdrmaa -outdir jdrmaa $(CFLAGS) jdrmaa.i | ||
jdrmaa_wrap.cxx: jdrmaa.i | ||
swig -c++ -java -package jdrmaa -outdir jdrmaa $(CFLAGS) jdrmaa.i | ||
|
||
clean: | ||
rm -f jdrmaa_wrap.c jdrmaa_wrap.o $(LIBNAME) jdrmaa/* test/*.class | ||
rm -f jdrmaa_wrap.* $(LIBNAME) jdrmaa/* test/*.class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef STOLEN_CONSTS | ||
#define STOLEN_CONSTS | ||
|
||
#define DRMAA_TIMEOUT_NO_WAIT 0 | ||
#define DRMAA_TIMEOUT_WAIT_FOREVER -1 | ||
#define DRMAA_PS_UNDETERMINED 0x00 | ||
#define DRMAA_PS_QUEUED_ACTIVE 0x10 | ||
#define DRMAA_PS_SYSTEM_ON_HOLD 0x11 | ||
#define DRMAA_PS_USER_ON_HOLD 0x12 | ||
#define DRMAA_PS_USER_SYSTEM_ON_HOLD 0x13 | ||
#define DRMAA_PS_RUNNING 0x20 | ||
#define DRMAA_PS_SYSTEM_SUSPENDED 0x21 | ||
#define DRMAA_PS_USER_SUSPENDED 0x22 | ||
#define DRMAA_PS_USER_SYSTEM_SUSPENDED 0x23 | ||
#define DRMAA_PS_DONE 0x30 | ||
#define DRMAA_PS_FAILED 0x40 | ||
#define DRMAA_CONTROL_SUSPEND 0 | ||
#define DRMAA_CONTROL_RESUME 1 | ||
#define DRMAA_CONTROL_HOLD 2 | ||
#define DRMAA_CONTROL_RELEASE 3 | ||
#define DRMAA_CONTROL_TERMINATE 4 | ||
#define DRMAA_JOB_IDS_SESSION_ALL "DRMAA_JOB_IDS_SESSION_ALL" | ||
#define DRMAA_JOB_IDS_SESSION_ANY "DRMAA_JOB_IDS_SESSION_ANY" | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,8 @@ | ||
%module jdrmaa | ||
%include "typemaps.i" | ||
%{ | ||
#include "drmaa_impl_stolen.h" | ||
#include <drmaa.h> | ||
#include "jdrmaa.h" | ||
%} | ||
|
||
|
||
|
||
%ignore drmaa_allocate_job_template; | ||
%ignore drmaa_delete_job_template; | ||
%ignore drmaa_set_attribute; | ||
%ignore drmaa_get_attribute; | ||
%ignore drmaa_set_vector_attribute; | ||
%ignore drmaa_get_vector_attribute; | ||
%ignore drmaa_run_job; | ||
|
||
%include "drmaa_impl_stolen.h" | ||
%include <drmaa.h> | ||
|
||
%extend drmaa_job_template_s { | ||
drmaa_job_template_s(){ | ||
drmaa_job_template_t *jt; | ||
drmaa_allocate_job_template(&jt,NULL,0); | ||
return jt; | ||
} | ||
|
||
~drmma_job_template_s(){ | ||
drmaa_delete_job_template($self,NULL,0); | ||
} | ||
|
||
int set_attribute(const char *name, const char *value){ | ||
return drmaa_set_attribute($self, name, value, NULL, 0); | ||
} | ||
|
||
|
||
char *get_attribute(const char *name){ | ||
int reason; | ||
char *retval; | ||
retval = malloc(1024*sizeof(char)); | ||
reason = drmaa_get_attribute($self,name,retval,1024,NULL,0); | ||
return retval; | ||
} | ||
|
||
int set_vector_attribute(const char *name, const char *value[]){ | ||
return drmaa_set_vector_attribute($self,name,value,NULL,0); | ||
} | ||
|
||
drmaa_attr_values_t *get_vector_attribute(const char *name){ | ||
drmaa_attr_values_t *values; | ||
drmaa_get_vector_attribute($self,name,&values,NULL,0); | ||
return values; | ||
} | ||
|
||
char *start(){ | ||
int reason; | ||
char *retval; | ||
retval = malloc(256*sizeof(char)); | ||
reason = drmaa_run_job(retval, 256, $self, NULL, 0); | ||
return retval; | ||
} | ||
}; | ||
|
||
drmaa_attr_names_t foo_get_attribute_names(){ | ||
int reason; | ||
drmaa_attr_names_t *retval; | ||
reason = drmaa_get_attribute_names(&retval,NULL,0); | ||
return retval; | ||
} | ||
|
||
%extend drmaa_attr_names_s { | ||
} | ||
%include "jdrmaa.h" | ||
%include "constants.h" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters