Skip to content

Instantly share code, notes, and snippets.

View Glow Accounting Example
package main
import (
"flag"
"fmt"
"github.com/chrislusf/glow/flow"
"github.com/dgruber/ugego/pkg/accounting"
"os"
"strings"
)
@dgruber
dgruber / main.go
Created Sep 21, 2015
Submitting jobs on behalf of other users with Go DRMAA
View main.go
package main
import (
"fmt"
"github.com/dgruber/drmaa"
)
func main() {
session, errInit := drmaa.MakeSession()
@dgruber
dgruber / job.sh
Created Feb 22, 2015
Univa Grid Engine as a Job
View job.sh
#!/bin/sh
# we need to remember our original cluster
ORG_ROOT=$SGE_ROOT
UGEROOT=/vagrant/
UGEROOT+=$SGE_HGR_GLOBAL_MT_SGE_ROOT
QMASTER_PORT=$SGE_HGR_GLOBAL_MT_QMASTER_PORT
EXECD_PORT=`expr $QMASTER_PORT + 1`
CLUSTER_NAME="p$QMASTER_PORT"
@dgruber
dgruber / TrainingVM
Last active Jun 22, 2016
Training VM Autoinstall Template
View TrainingVM
SGE_ROOT="/opt/tools/uge"
SGE_QMASTER_PORT="802"
SGE_EXECD_PORT="803"
SGE_ENABLE_SMF="false"
SGE_CLUSTER_NAME="p802"
SGE_JMX_PORT="Please enter port"
SGE_JMX_SSL="false"
SGE_JMX_SSL_CLIENT="false"
SGE_JMX_SSL_KEYSTORE="Please enter absolute path of server keystore file"
SGE_JMX_SSL_KEYSTORE_PW="Please enter the server keystore password"
@dgruber
dgruber / gist:6837266
Last active Dec 24, 2015
DRMAA2 C open existing job session
View gist:6837266
long i, available = 0;
/* get a copy of the jsession names list */
drmaa2_string_list sessions = drmaa2_get_jsession_names();
drmaa2_jsession jsession;
for (i = 0; i < drmaa2_list_size(sessions); i++) {
const char* session = drmaa2_list_get(sessions, i);
if (strncmp(session, "mySession", sizeof("mySession")) == 0) {
available = 1;
break;
@dgruber
dgruber / gist:6830157
Last active Dec 24, 2015
DRMAA2 job session creation and destruction in C
View gist:6830157
/* creates and implicitly opens the newly created job session */
drmaa2_jsession js = drmaa2_create_jsession("user123_job_session", NULL);
/* if the return value is NULL an error happend */
if (js == NULL) {
/* the error text is stored in the threads context, for reading
it out the following function can be used */
drmaa2_string error = drmaa2_lasterror_text();
printf("Could not create jsession. %s\n", error);
/* the newly allocated string must be freed by the caller */