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.
- Loading branch information
Bryan J Lunt
committed
Jun 4, 2013
1 parent
c571b80
commit 5890cc8
Showing
6 changed files
with
148 additions
and
15 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,15 +1,22 @@ | ||
|
||
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 | ||
|
||
LIBNAME=libdrmaa.so | ||
LIBNAME=lib/libjdrmaa.so | ||
|
||
compile: drmaa_wrap.c drmaa.i | ||
$(CC) $(CFLAGS) -fPIC -c drmaa_wrap.c | ||
$(CC) -shared drmaa_wrap.o -o $(LIBNAME) | ||
all: clean lib javac | ||
|
||
drmaa_wrap.c: drmaa.i | ||
swig -java $(CFLAGS) -outdir swigjava drmaa.i | ||
javac: jdrmaa_wrap.c | ||
javac jdrmaa/*.java | ||
javac test/*.java | ||
|
||
lib: jdrmaa_wrap.c jdrmaa.i | ||
$(CC) $(CFLAGS) $(LIBS) -fPIC -c jdrmaa_wrap.c | ||
$(CC) $(LIBS) -shared jdrmaa_wrap.o -o $(LIBNAME) | ||
|
||
jdrmaa_wrap.c: jdrmaa.i | ||
swig -java -package jdrmaa -outdir jdrmaa $(CFLAGS) jdrmaa.i | ||
|
||
clean: | ||
rm drmaa_wrap.c drmaa_wrap.o *.so swigjava/* | ||
rm -f jdrmaa_wrap.c jdrmaa_wrap.o $(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
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,47 @@ | ||
#include <drmaa.h> | ||
|
||
class JobTemplate{ | ||
drmaa_job_template_t *jt; | ||
|
||
JobTemplate(){ | ||
drmaa_allocate_job_template(&jt,NULL,0); | ||
} | ||
|
||
~JobTemplate(){ | ||
drmaa_delete_job_template(jt,NULL,0); | ||
} | ||
|
||
int set_attribute(const char *name, const char *value){ | ||
return drmaa_set_attribute(jt, name, value, NULL, 0); | ||
} | ||
|
||
char *get_attribute(const char *name){ | ||
int reason; | ||
char *retval; | ||
retval = malloc(1024*sizeof(char)); | ||
reason = drmaa_get_attribute(jt,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; | ||
} | ||
|
||
|
||
}; |
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,72 @@ | ||
%module jdrmaa | ||
%include "typemaps.i" | ||
%{ | ||
#include "drmaa_impl_stolen.h" | ||
#include <drmaa.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 { | ||
} |
File renamed without changes.
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