Index: trunk/slurm_drmaa/util.c
===================================================================
--- trunk/slurm_drmaa/util.c	(revision 24)
+++ trunk/slurm_drmaa/util.c	(revision 28)
@@ -81,4 +81,27 @@
 	return 60*dt.hour+dt.minute;
 }
+
+/* taken from SLURM src/common/proc_args.c */
+static int slurmdrmaa_mail_type_parse(const char *mail_type_str)
+{
+	int rc = 0;
+
+
+	if (strcasecmp(mail_type_str, "BEGIN") == 0)
+		rc = MAIL_JOB_BEGIN;
+	else if (strcasecmp(mail_type_str, "END") == 0)
+		rc = MAIL_JOB_END;
+	else if (strcasecmp(mail_type_str, "FAIL") == 0)
+		rc = MAIL_JOB_FAIL;
+	else if (strcasecmp(mail_type_str, "REQUEUE") == 0)
+		rc = MAIL_JOB_REQUEUE;
+	else if (strcasecmp(mail_type_str, "ALL") == 0)
+		rc = MAIL_JOB_BEGIN | MAIL_JOB_END | MAIL_JOB_FAIL | MAIL_JOB_REQUEUE;
+	else
+		rc = 0; /* failure */
+
+	return rc;
+}
+
 
 enum slurm_native {
@@ -102,5 +125,11 @@
 	SLURM_NATIVE_JOB_NAME,
 	SLURM_NATIVE_TIME_LIMIT,
-	SLURM_NATIVE_NTASKS
+	SLURM_NATIVE_NTASKS,
+	SLURM_NATIVE_GRES,
+	SLURM_NATIVE_NO_KILL,
+	SLURM_NATIVE_LICENSES,
+	SLURM_NATIVE_MAIL_TYPE,
+	SLURM_NATIVE_NO_REQUEUE,
+	SLURM_NATIVE_EXCLUDE
 };
 
@@ -129,5 +158,4 @@
 	fsd_free(job_desc->partition);
 	fsd_free(job_desc->qos);
-
 	fsd_free(job_desc->script);
 	fsd_free(job_desc->std_in);
@@ -135,4 +163,7 @@
 	fsd_free(job_desc->std_err);	
 	fsd_free(job_desc->work_dir);
+	fsd_free(job_desc->gres);
+	fsd_free(job_desc->exc_nodes);
+
 	
 	fsd_log_return(( "" ));
@@ -277,4 +308,28 @@
 			job_desc->time_limit = slurmdrmaa_datetime_parse(value); 
 			break;	
+		case SLURM_NATIVE_GRES:
+			fsd_log_debug(("# gres = %s",value));
+			job_desc->gres = fsd_strdup(value);
+			break;
+		case SLURM_NATIVE_NO_KILL:
+			fsd_log_debug(("# no_kill = 1"));
+			job_desc->kill_on_node_fail = 0;
+			break;
+		case SLURM_NATIVE_LICENSES:
+			fsd_log_debug(("# licenses = %s", value));
+			job_desc->licenses = fsd_strdup(value);
+			break;
+		case SLURM_NATIVE_MAIL_TYPE:
+			fsd_log_debug(("# mail_type = %s", value));
+			job_desc->mail_type = slurmdrmaa_mail_type_parse(value);
+			break;
+		case SLURM_NATIVE_NO_REQUEUE:
+			fsd_log_debug(("# requeue = 0"));
+			job_desc->requeue = 0;
+			break;
+		case SLURM_NATIVE_EXCLUDE:
+			fsd_log_debug(("# exclude = %s", value));
+			job_desc->exc_nodes = fsd_strdup(value);
+			break;
 	
 		default:
@@ -295,8 +350,10 @@
 		name = fsd_strdup(strtok_r(add_attr_copy, "=", &ctxt));
 		value = strtok_r(NULL, "=", &ctxt);
-		if (value == NULL) {
+		/*
+		 * TODO: move it to slurmdrmaa_add_attribute
+		 if (value == NULL) {
 			fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, 
 				"Invalid native specification: %s Missing '='.", add_attr_copy);
-		}
+		} */
 
 		if(strcmp(name,"account") == 0) {
@@ -351,15 +408,35 @@
 			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_SHARE,NULL);
 		}		
-                else if(strcmp(name,"job_name") == 0) {
-                        slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_JOB_NAME,value);
-                }
-                else if(strcmp(name,"time_limit") == 0) {
-                        slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_TIME_LIMIT,value);
-                } 
+		else if(strcmp(name,"job_name") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_JOB_NAME,value);
+		}
+		else if(strcmp(name,"time_limit") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_TIME_LIMIT,value);
+		}
 		else if(strcmp(name,"time") == 0) {
-                        slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_TIME_LIMIT,value);
-                } else if(strcmp(name,"ntasks") == 0) {
-                        slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_NTASKS,value);
-                } else {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_TIME_LIMIT,value);
+		}
+		else if(strcmp(name,"ntasks") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_NTASKS,value);
+		}
+		else if(strcmp(name,"gres") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_GRES,value);
+		}
+		else if(strcmp(name,"no-kill") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_NO_KILL,NULL);
+		}
+		else if(strcmp(name,"licenses") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_LICENSES,value);
+		}
+		else if(strcmp(name,"mail-type") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_MAIL_TYPE,value);
+		}
+		else if(strcmp(name,"no-requeue") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_NO_REQUEUE,NULL);
+		}
+		else if(strcmp(name,"exclude") == 0) {
+			slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_EXCLUDE,value);
+		}
+		else {
 			fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE,
 					"Invalid native specification: %s (Unsupported option: --%s)",
@@ -367,5 +444,4 @@
 		}
 	
-		/*}*/
 	  }
 	FINALLY
@@ -403,5 +479,5 @@
 				}		
 			} else {
-				switch (opt) {			
+				switch (opt) {
 					case 'A' :
 						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_ACCOUNT, arg);
@@ -418,5 +494,5 @@
 					case 's' :
 						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_SHARE, NULL);
-						break;	
+						break;
 					case 'w' :
 						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_NODELIST, arg);
@@ -424,5 +500,5 @@
 					case 'J' :
 						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_JOB_NAME, arg);
-						break;		
+						break;
 					case 't' :
 						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_TIME_LIMIT, arg);
@@ -431,5 +507,8 @@
 						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_NTASKS, arg);
 						break;  
-					default :								
+					case 'x' :
+						slurmdrmaa_add_attribute(job_desc,SLURM_NATIVE_EXCLUDE, arg);
+						break;
+					default :
 							fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE,
 									"Invalid native specification: %s (Unsupported option: -%c)",
