Skip to content

Commit

Permalink
Merge pull request #9 from dgruber/loveshack
Browse files Browse the repository at this point in the history
Added support for Son of Grid Engine drmaa.h
  • Loading branch information
dgruber authored May 26, 2020
2 parents 1503c7e + 65d7cb8 commit cd73795
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ First download the package:

Next, we need to compile the code.

For Univa Grid Engine:
For Univa Grid Engine and original SGE:

~~~
source /path/to/grid/engine/installation/default/settings.sh
Expand All @@ -50,6 +50,18 @@ For Univa Grid Engine:
./simplesubmit
~~~

For Son of Grid Engine ("loveshack"):

~~~
source /path/to/grid/engine/installation/default/settings.sh
./build.sh --sog
cd examples/simplesubmit
go build
export LD_LIBRARY_PATH=$SGE_ROOT/lib/lx-amd64
./simplesubmit
~~~


For [Torque](https://github.com/adaptivecomputing/torque/tree/master/src/drmaa):

If your Torque drmaa.h header file is not located under /usr/include/torque,
Expand Down
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,14 @@ else

export CGO_LDFLAGS="-L$SGE_ROOT/lib/$ARCH/"
export CGO_CFLAGS="-I$SGE_ROOT/include"

# adapt to Son of Grid Engine's header file changes
if [ "$1" = "--sog" ]; then
echo "SOG"
export CGO_CFLAGS="-DSOG -I$SGE_ROOT/include"
fi
fi

go test -v
go build -a
go install
13 changes: 11 additions & 2 deletions drmaa.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2012, 2013, 2014, 2015, 2016 Daniel Gruber, [email protected]
Copyright 2012, 2013, 2014, 2015, 2016, 2020 Daniel Gruber, [email protected]
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -112,6 +112,15 @@ static int _drmaa_get_num_attr_names(drmaa_attr_names_t* names, int *size) {
return drmaa_get_num_attr_names(names, size);
#endif
}
static int _drmaa_run_bulk_jobs(drmaa_job_ids_t **jobids, const drmaa_job_template_t *jt, int start, int end, int incr, char *diag, size_t diag_len) {
#if defined(SOG)
return drmaa_run_bulk_jobs(jobids, jt, (unsigned) start, (unsigned) end, incr, diag, diag_len);
#else
return drmaa_run_bulk_jobs(jobids, jt, start, end, incr, diag, diag_len);
#endif
}
*/
import "C"

Expand Down Expand Up @@ -663,7 +672,7 @@ func (s *Session) RunBulkJobs(jt *JobTemplate, start, end, incr int) ([]string,
diag := C.makeString(stringSize)
defer C.free(unsafe.Pointer(diag))

errNumber := C.drmaa_run_bulk_jobs(&ids, jt.jt, C.int(start), C.int(end), C.int(incr),
errNumber := C._drmaa_run_bulk_jobs(&ids, jt.jt, C.int(start), C.int(end), C.int(incr),
diag, stringSize)

if errNumber != C.DRMAA_ERRNO_SUCCESS && diag != nil {
Expand Down
16 changes: 0 additions & 16 deletions examples/simplewait/simplewait.go

This file was deleted.

0 comments on commit cd73795

Please sign in to comment.