Index: trunk/pbs_drmaa/submit.c
===================================================================
--- trunk/pbs_drmaa/submit.c	(revision 10)
+++ trunk/pbs_drmaa/submit.c	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: submit.c 386 2011-01-06 18:13:33Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
@@ -46,5 +46,5 @@
 		__attribute__ ((unused))
 #	endif
-	= "$Id: submit.c 386 2011-01-06 18:13:33Z mamonski $";
+	= "$Id$";
 #endif
 
@@ -546,6 +546,5 @@
 			else
 			{
-                                fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, "Invalid native specification: %s (Invalid resource specification: %s)", resources, arg);
-
+				fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, "Invalid native specification: %s (Invalid resource specification: %s)", resources, arg);
 			}
 		}
@@ -569,5 +568,5 @@
 	TRY
 	  {
-		for (arg = strtok_r(add_attr_copy, ",", &ctxt); arg; arg = strtok_r(NULL, ":",&ctxt) )
+		for (arg = strtok_r(add_attr_copy, ";", &ctxt); arg; arg = strtok_r(NULL, ";",&ctxt) )
 		{
 			name = fsd_strdup(strtok_r(arg, "=", &ctxt2));
@@ -606,19 +605,33 @@
 
 		TRY
-		 {
+		  {
 			for (arg = strtok_r(native_spec_copy, " \t", &ctxt); arg; arg = strtok_r(NULL, " \t",&ctxt) ) {
-				if (!opt) {
-					if ( (arg[0] != '-') || ((strlen(arg) != 2) &&  arg[2] != ' ' && arg[1] !='-' ) )
+				if (!opt)
+				  {
+					if ( (arg[0] != '-') || (strlen(arg) != 2) )
 						fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE,
-								"Invalid native specification: %s",
-								native_specification);
-					if(arg[1] == '-') {
-						parse_additional_attr(pbs_attr, arg+2);
+							"Invalid native specification: -o(ption) expected (arg=%s native=%s).",
+							arg, native_specification);
+
+						case 'h' :
+							pbs_attr->set_attr( pbs_attr, "Hold_Types" , arg );
+							break;
+
+					opt = arg[1];
+
+					/* handle NO-arg options */
+
+					switch (opt) {
+						case 'h' :
+							pbs_attr->set_attr( pbs_attr, "Hold_Types" , "u" );
+							break;
+						default :
+							continue; /*no NO-ARG option */
 					}
-					else {
-						opt = arg[1];
-					}
-					
-				} else {
+
+					opt = 0;
+				  }
+				else
+				  {
 					switch (opt) {
 						
@@ -644,7 +657,4 @@
 							pbs_attr->set_attr( pbs_attr, "Execution_Time" , arg );
 							break;
-						case 'h' :
-							pbs_attr->set_attr( pbs_attr, "Hold_Types" , arg );
-							break;
 						case 'A' :
 							pbs_attr->set_attr( pbs_attr, "Account_Name" , arg );
@@ -672,5 +682,4 @@
 							break;
 						case 'v' :
-						case 'V' :
 							pbs_attr->set_attr( pbs_attr, "Variable_List" , arg );
 							break;
@@ -687,5 +696,4 @@
 									native_specification, opt);
 					}
-
 					opt = 0;
 				}
Index: trunk/pbs_drmaa/log_reader.c
===================================================================
--- trunk/pbs_drmaa/log_reader.c	(revision 8)
+++ trunk/pbs_drmaa/log_reader.c	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: log_reader.c 323 2010-09-21 21:31:29Z mmatloka $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/log_reader.h
===================================================================
--- trunk/pbs_drmaa/log_reader.h	(revision 8)
+++ trunk/pbs_drmaa/log_reader.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: log_reader.h 323 2010-09-21 21:31:29Z mmatloka $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/submit.h
===================================================================
--- trunk/pbs_drmaa/submit.h	(revision 1)
+++ trunk/pbs_drmaa/submit.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: submit.h 338 2010-09-28 14:48:45Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/job.c
===================================================================
--- trunk/pbs_drmaa/job.c	(revision 10)
+++ trunk/pbs_drmaa/job.c	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: job.c 370 2010-11-16 09:51:00Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
@@ -43,5 +43,5 @@
 		__attribute__ ((unused))
 #	endif
-	= "$Id: job.c 370 2010-11-16 09:51:00Z mamonski $";
+	= "$Id$";
 #endif
 
@@ -385,6 +385,5 @@
 		int hours, minutes, seconds;
 		long mem;
-		if( cpu_usage && sscanf( cpu_usage, "%d:%d:%d",
-				&hours, &minutes, &seconds ) == 3 )
+		if( cpu_usage && sscanf( cpu_usage, "%d:%d:%d", &hours, &minutes, &seconds ) == 3 )
 		 {
 			self->cpu_usage = 60*( 60*hours + minutes ) + seconds;
@@ -401,6 +400,5 @@
 			fsd_log_debug(( "vmem_usage: %s=%ldB", vmem_usage, self->vmem_usage ));
 		 }
-		if( walltime && sscanf( walltime, "%d:%d:%d",
-					&hours, &minutes, &seconds ) == 3 )
+		if( walltime && sscanf( walltime, "%d:%d:%d", &hours, &minutes, &seconds ) == 3 )
 		 {
 			self->walltime = 60*( 60*hours + minutes ) + seconds;
@@ -414,5 +412,5 @@
 {
 	pbsdrmaa_session_t *pbssession = (pbsdrmaa_session_t*)self->session;
-	
+
 	if( pbssession->pbs_home == NULL )
 		pbsdrmaa_job_on_missing_standard( self );	
@@ -429,5 +427,5 @@
 
 	fsd_log_enter(( "({job_id=%s})", self->job_id ));
-	fsd_log_warning(( "self %s missing from DRM queue", self->job_id ));
+	fsd_log_warning(( "Job %s missing from DRM queue", self->job_id ));
 
 	switch( session->missing_jobs )
@@ -465,4 +463,6 @@
 	}
 
+	fsd_cond_broadcast( &self->status_cond);
+
 	fsd_log_return(( "; job_ps=%s, exit_status=%d",
 				drmaa_job_ps_to_str(self->state), self->exit_status ));
@@ -476,5 +476,5 @@
 	
 	fsd_log_enter(( "({job_id=%s})", self->job_id ));
-	fsd_log_warning(( "self %s missing from DRM queue", self->job_id ));
+	fsd_log_info(( "Job %s missing from DRM queue", self->job_id ));
 	
 	TRY
Index: trunk/pbs_drmaa/pbs_attrib.gperf
===================================================================
--- trunk/pbs_drmaa/pbs_attrib.gperf	(revision 4)
+++ trunk/pbs_drmaa/pbs_attrib.gperf	(revision 12)
@@ -1,4 +1,4 @@
 %{
-/* $Id: pbs_attrib.gperf 2677 2009-09-08 14:32:22Z mmamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
@@ -31,5 +31,5 @@
 		__attribute__ ((unused))
 #	endif
-	= "$Id: pbs_attrib.gperf 2677 2009-09-08 14:32:22Z mmamonski $";
+	= "$Id$";
 #endif
 
Index: trunk/pbs_drmaa/util.c
===================================================================
--- trunk/pbs_drmaa/util.c	(revision 8)
+++ trunk/pbs_drmaa/util.c	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: util.c 323 2010-09-21 21:31:29Z mmatloka $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
@@ -41,5 +41,5 @@
 		__attribute__ ((unused))
 #	endif
-	= "$Id: util.c 323 2010-09-21 21:31:29Z mmatloka $";
+	= "$Id$";
 #endif
 
Index: trunk/pbs_drmaa/job.h
===================================================================
--- trunk/pbs_drmaa/job.h	(revision 8)
+++ trunk/pbs_drmaa/job.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: job.h 2 2009-10-12 09:51:22Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/util.h
===================================================================
--- trunk/pbs_drmaa/util.h	(revision 8)
+++ trunk/pbs_drmaa/util.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: util.h 323 2010-09-21 21:31:29Z mmatloka $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/session.c
===================================================================
--- trunk/pbs_drmaa/session.c	(revision 10)
+++ trunk/pbs_drmaa/session.c	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: session.c 385 2011-01-04 18:24:05Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
@@ -53,5 +53,5 @@
 		__attribute__ ((unused))
 #	endif
-	= "$Id: session.c 385 2011-01-04 18:24:05Z mamonski $";
+	= "$Id$";
 #endif
 
@@ -213,8 +213,7 @@
 	fsd_conf_option_t *pbs_home;
 	pbs_home = fsd_conf_dict_get(self->configuration, "pbs_home" );
-	if( pbs_home )
-	 {
-		if( pbs_home->type == FSD_CONF_STRING )
-		 {
+
+	if( pbs_home && pbs_home->type == FSD_CONF_STRING )
+	  {
 			struct stat statbuf;
 			char * volatile log_path;
@@ -222,5 +221,5 @@
 			
 			pbsself->pbs_home = pbs_home->val.string;
-			fsd_log_debug(("pbs_home: %s",pbsself->pbs_home));
+			fsd_log_info(("pbs_home: %s",pbsself->pbs_home));
 			pbsself->super_wait_thread = pbsself->super.wait_thread;
 			pbsself->super.wait_thread = pbsdrmaa_session_wait_thread;		
@@ -230,31 +229,21 @@
 			localtime_r(&pbsself->log_file_initial_time,&tm);
 
-			if((log_path = fsd_asprintf("%s/server_logs/%04d%02d%02d",
-    		  		pbsself->pbs_home,	 
-  		    		tm.tm_year + 1900,
-   		    		tm.tm_mon + 1,
-					tm.tm_mday)) == NULL) {
-				fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"WT - Memory allocation wasn't possible");
-			}
-
-			if(stat(log_path,&statbuf) == -1) {
+			log_path = fsd_asprintf("%s/server_logs/%04d%02d%02d",
+					pbsself->pbs_home,
+					tm.tm_year + 1900,
+					tm.tm_mon + 1,
+					tm.tm_mday);
+
+			if(stat(log_path,&statbuf) == -1)
+			  {
 				char errbuf[256] = "InternalError";
-				(void)strerror_r(errno, errbuf, 256);
+				(void)strerror_r(errno, errbuf, sizeof(errbuf));
 				fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"stat error: %s",errbuf);
-			}
+			  }
 	
 			fsd_log_debug(("Log file %s size %d",log_path,(int) statbuf.st_size));
 			pbsself->log_file_initial_size = statbuf.st_size;
 			fsd_free(log_path);
-		 }
-		else
-		{
-			pbsself->super.enable_wait_thread = false;
-			pbsself->wait_thread_log = false;
-			fsd_log_debug(("pbs_home not configured. Running standard wait_thread (pooling)."));
-		}
-	 }
-
-
+	  }
 
 	pbsself->super_apply_configuration(self); /* call method from the superclass */
@@ -277,5 +266,5 @@
 		conn_lock = fsd_mutex_lock( &self->drm_connection_mutex );
 retry:
-
+/* TODO: query only for user's jobs pbs_selstat + ATTR_u */
 #ifdef PBS_PROFESSIONAL
 		status = pbs_statjob( pbsself->pbs_conn, NULL, NULL, NULL );
@@ -494,5 +483,5 @@
 			fsd_log_warning(( "no default queue set on PBS server" ));
 		else if( keep_completed == NULL && self->pbs_home == NULL )
-			fsd_log_warning(( "PBS server is not configured to keep completed jobs\n"
+			fsd_log_warning(( "Torque server is not configured to keep completed jobs\n"
 						"in Torque: set keep_completed parameter of default queue\n"
 						"  $ qmgr -c 'set queue batch keep_completed = 60'\n"
@@ -513,5 +502,10 @@
 	 }
 	END_TRY
+
+	return result;
 #endif
+	fsd_log_warning(( "PBS Professional does not keep information about the completed jobs\n"
+				" You must configure DRMAA to utilize log files in order to always get valid job exit status"
+				));
 	return false;
 }
Index: trunk/pbs_drmaa/drmaa.c
===================================================================
--- trunk/pbs_drmaa/drmaa.c	(revision 1)
+++ trunk/pbs_drmaa/drmaa.c	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: drmaa.c 353 2010-10-18 13:45:14Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/pbs_drmaa.conf.example
===================================================================
--- trunk/pbs_drmaa/pbs_drmaa.conf.example	(revision 1)
+++ trunk/pbs_drmaa/pbs_drmaa.conf.example	(revision 12)
@@ -1,3 +1,3 @@
-# $Id: pbs_drmaa.conf.example 2420 2009-06-24 14:40:21Z lukasz $
+# $Id$
 # pbs_drmaa.conf - Sample pbs_drmaa configuration file.
 
Index: trunk/pbs_drmaa/Makefile.am
===================================================================
--- trunk/pbs_drmaa/Makefile.am	(revision 7)
+++ trunk/pbs_drmaa/Makefile.am	(revision 12)
@@ -1,3 +1,3 @@
-# $Id: Makefile.am 2420 2009-06-24 14:40:21Z lukasz $
+# $Id$
 # 
 # FedStage DRMAA for PBS Professional
Index: trunk/pbs_drmaa/session.h
===================================================================
--- trunk/pbs_drmaa/session.h	(revision 7)
+++ trunk/pbs_drmaa/session.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: session.h 323 2010-09-21 21:31:29Z mmatloka $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/pbs_drmaa.h
===================================================================
--- trunk/pbs_drmaa/pbs_drmaa.h	(revision 1)
+++ trunk/pbs_drmaa/pbs_drmaa.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: pbs_drmaa.h 2 2009-10-12 09:51:22Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
Index: trunk/pbs_drmaa/pbs_attrib.h
===================================================================
--- trunk/pbs_drmaa/pbs_attrib.h	(revision 4)
+++ trunk/pbs_drmaa/pbs_attrib.h	(revision 12)
@@ -1,3 +1,3 @@
-/* $Id: pbs_attrib.h 256 2010-08-10 16:31:35Z mamonski $ */
+/* $Id$ */
 /*
  *  FedStage DRMAA for PBS Pro
