Index: /trunk/pbs_drmaa/log_reader.c
===================================================================
--- /trunk/pbs_drmaa/log_reader.c	(revision 25)
+++ /trunk/pbs_drmaa/log_reader.c	(revision 26)
@@ -260,5 +260,5 @@
 pbsdrmaa_read_log( pbsdrmaa_log_reader_t * self )
 {
-	pbsdrmaa_job_t *pbsjob = (pbsdrmaa_job_t*) self->job;	
+	pbsdrmaa_job_t *pbsjob = (pbsdrmaa_job_t*) self->job;
 	fsd_job_t *volatile temp_job = NULL;
 		
@@ -279,5 +279,5 @@
 			self->select_file(self);
 
-			while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0) 			
+			while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0)
 			{
 				const char *volatile ptr = line;
@@ -349,5 +349,5 @@
 									self->run_flag = false;
 									job_id_match = true; 
-									status.name = fsd_strdup(self->job->job_id);									
+									status.name = fsd_strdup(self->job->job_id);
 								}
 								else if ( !job_found && diff >= 1)
@@ -379,5 +379,7 @@
 							struct_mtime,
 							struct_queue,
-							struct_account_name;
+							struct_account_name,
+							struct_exec_vnode;
+						struct attrl *last_attr = NULL;
 						
 						bool state_running = false;
@@ -393,4 +395,5 @@
 						memset(&struct_queue,0,sizeof(struct attrl));
 						memset(&struct_account_name,0,sizeof(struct attrl));
+						memset(&struct_exec_vnode,0,sizeof(struct attrl));
 								
 						if (strcmp(event,FLD_MSG_STATE) == 0) 
@@ -401,4 +404,6 @@
 							struct_state.next = NULL;
 							struct_state.name = "job_state";
+							last_attr = &struct_state;
+
 							if(field[0] == 'J') /* Job Queued, Job Modified, Job Run*/
 							 {
@@ -424,5 +429,6 @@
 									 {
 										time_t temp_time = mktime(&temp_time_tm);
-										status.attribs = &struct_mtime;
+										last_attr->next = &struct_mtime;
+										last_attr = &struct_mtime;
 										struct_mtime.name = "mtime";
 										struct_mtime.next = NULL;
@@ -434,17 +440,32 @@
 							/* != Job deleted and Job to be deleted*/
 #ifdef PBS_PROFESSIONAL
-							else if	(field[4] != 't' && field[10] != 'd') {
+							else if	(field[4] != 't' && field[10] != 'd')
+							 {
 #else
-							else if(field[4] != 'd') {
+							else if (field[4] != 'd')
+							 {
 #endif
-
-								if ((struct_state.value = fsd_asprintf("%c",field[n]) ) == NULL ) { /* 4 first letter of state */
-									fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"%s - Memory allocation wasn't possible",self->name);
-								}
-								if(struct_state.value[0] == 'R'){
+								struct_state.value = fsd_asprintf("%c",field[n]);
+
+								if(struct_state.value[0] == 'R')
+								 {
 									state_running = true;
-								}
-							}
-							else { /* job terminated - pbs drmaa detects failed as completed with exit_status !=0, aborted with status -1*/
+#ifdef PBS_PROFESSIONAL
+									{
+										char *p_vnode = NULL;
+										if (p_vnode = strstr(field, "exec_vnode"))
+										 {
+											last_attr->next = &struct_exec_vnode;
+											last_attr =  &struct_exec_vnode;
+											struct_exec_vnode.name = "exec_vnode";
+											struct_exec_vnode.next = NULL;
+											struct_exec_vnode.value = fsd_strdup(p + 11);
+										 }
+									}
+#endif
+								 }
+							 }
+							else
+							 { /* job terminated - pbs drmaa detects failed as completed with exit_status !=0, aborted with status -1*/
 								struct_status.name = "exit_status";
 								struct_status.value = fsd_strdup("-1");
@@ -452,5 +473,5 @@
 								struct_state.next = &struct_status;
 								struct_state.value = fsd_strdup("C");
-							}
+							 }
 						}
 						else /*if (strcmp(event,FLD_MSG_STATUS) == 0 )*/
@@ -534,5 +555,5 @@
 							else
 							{
-								fsd_log_debug(("%s - updating job: %s",self->name, temp_job->job_id ));							
+								fsd_log_debug(("%s - updating job: %s",self->name, temp_job->job_id ));
 								pbsjob->update( temp_job, &status );
 							}
@@ -540,5 +561,5 @@
 						else if( job_found ) /* job_on_missing */
 						{
-							fsd_log_debug(("Job_on_missing - updating job: %s", self->job->job_id ));							
+							fsd_log_debug(("Job_on_missing - updating job: %s", self->job->job_id ));
 							pbsjob->update( self->job, &status );
 						}
@@ -575,5 +596,5 @@
 						log_event = false;
 					}
-					else if( self->job == NULL && log_match && field_n == FLD_MSG && strncmp(field,"Log closed",10) == 0) 
+					else if( self->job == NULL && log_match && field_n == FLD_MSG && strncmp(field,"Log closed",10) == 0)
 					{
 						fsd_log_debug(("%s - Date changed. Closing log file",self->name));
@@ -591,6 +612,6 @@
 				}		
 
-				fsd_free(temp_date);			
-			} /* end of while getline loop */			
+				fsd_free(temp_date);
+			} /* end of while getline loop */
 			
 			if(self->job == NULL)
@@ -599,5 +620,5 @@
 				fd_set log_fds;
 	
-				fsd_mutex_unlock( &self->session->mutex );			
+				fsd_mutex_unlock( &self->session->mutex );
 				
 				FD_ZERO(&log_fds);
@@ -874,5 +895,5 @@
 		close(self->fd);
 
-	fsd_log_debug(("Accounting Log file: %s",log_path));				
+	fsd_log_debug(("Accounting Log file: %s",log_path));
 
 	if((self->fd = open(log_path,O_RDONLY) ) == -1 )
@@ -926,5 +947,5 @@
 			
 			if(self->fd != -1) 					
-			while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0) 			
+			while ((self->read_line(self, line,buffer, sizeof(line), &idx,&end_idx,&line_idx)) > 0)
 			{
 				const char *volatile ptr = line;
@@ -965,5 +986,5 @@
 									job_found = true;
 									job_id_match = true; 
-									status.name = fsd_strdup(self->job->job_id);									
+									status.name = fsd_strdup(self->job->job_id);
 								}	
 						}
@@ -973,5 +994,6 @@
 					{					
 						struct attrl * struct_attrl = calloc(10,sizeof(struct attrl));
-											     
+						int i;
+
 						if(field[0] == 'q')
 						{
@@ -987,5 +1009,5 @@
 							char  msg[ 256 ] = "";
 							int n2 = 0;
-							int msg_field_n = 0;	
+							int msg_field_n = 0;
 				
 							status.attribs = &struct_attrl[0];
@@ -996,5 +1018,5 @@
 								{
 									case FLD_MSG_ACC_USER:
-										struct_attrl[msg_field_n].name = ATTR_euser;									
+										struct_attrl[msg_field_n].name = ATTR_euser;
 										break;
 
@@ -1061,5 +1083,5 @@
 						if( job_found && status.attribs != NULL)
 						{
-							fsd_log_debug(("Accounting file - updating job: %s", self->job->job_id ));					
+							fsd_log_debug(("Accounting file - updating job: %s", self->job->job_id ));
 							pbsjob->update( self->job, &status );
 							res = true;
@@ -1074,5 +1096,4 @@
 							temp_job->release( temp_job );
 	
-						int i = 0;
 						for(i = 0; i < 10; i++)
 						{
Index: /trunk/pbs_drmaa/job.c
===================================================================
--- /trunk/pbs_drmaa/job.c	(revision 25)
+++ /trunk/pbs_drmaa/job.c	(revision 26)
@@ -247,6 +247,4 @@
 		conn_lock = fsd_mutex_unlock( &self->session->drm_connection_mutex );
 
-		if(pbsdrmaa_job_update_status_accounting(self) == false)
-
 
 		if( status != NULL )
@@ -327,4 +325,5 @@
 					self->project = fsd_strdup(i->value);
 				break;
+#ifndef PBS_PROFESSIONAL
 			case PBSDRMAA_ATTR_EXECUTION_HOST:
 				if (!self->execution_hosts) {
@@ -333,4 +332,12 @@
 				}
 				break;
+#else
+			case PBSDRMAA_ATTR_EXECUTION_VNODE:
+				if (!self->execution_hosts) {
+					fsd_log_debug(("execution_hosts = %s", i->value));
+					self->execution_hosts = fsd_strdup(i->value);
+				}
+				break;
+#endif
 			case PBSDRMAA_ATTR_START_TIME:
 				{
Index: /trunk/pbs_drmaa/pbs_attrib.gperf
===================================================================
--- /trunk/pbs_drmaa/pbs_attrib.gperf	(revision 12)
+++ /trunk/pbs_drmaa/pbs_attrib.gperf	(revision 26)
@@ -4,5 +4,5 @@
  *  FedStage DRMAA for PBS Pro
  *  Copyright (C) 2006-2009  FedStage Systems
- *
+ *  Copyright (C) 2011 Poznan Supercomputing and Networking Center
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -88,4 +88,5 @@
 # additional job and general attribute names
 exec_host, t(PBSDRMAA_ATTR_EXECUTION_HOST)
+exec_vnode, t(PBSDRMAA_ATTR_EXECUTION_VNODE)
 Job_Owner, t(PBSDRMAA_ATTR_JOB_OWNER)
 resources_used, t(PBSDRMAA_ATTR_RESOURCES_USED)
@@ -202,4 +203,5 @@
 	{ "stageout", PBSDRMAA_ATTR_STAGEOUT, false },
 	{ "exec_host", PBSDRMAA_ATTR_EXECUTION_HOST, false },
+	{ "exec_vnode", PBSDRMAA_ATTR_EXECUTION_VNODE, false },
 	{ "Job_Owner", PBSDRMAA_ATTR_JOB_OWNER, false },
 	{ "resources_used", PBSDRMAA_ATTR_RESOURCES_USED, false },
Index: /trunk/pbs_drmaa/pbs_attrib.h
===================================================================
--- /trunk/pbs_drmaa/pbs_attrib.h	(revision 12)
+++ /trunk/pbs_drmaa/pbs_attrib.h	(revision 26)
@@ -70,4 +70,5 @@
 /* additional job and general attribute names */
 #define PBSDRMAA_EXECUTION_HOST         "exec_host"
+#define PBSDRMAA_EXECUTION_VNODE        "exec_vnode" /* PBS PRO */
 #define PBSDRMAA_JOB_OWNER              "Job_Owner"
 #define PBSDRMAA_RESOURCES_USED         "resources_used"
@@ -79,5 +80,5 @@
 #define PBSDRMAA_START_TIME             "start_time"
 #define PBSDRMAA_EXTENSION              "extension"
-#define PBSDRMAA_SUBMIT_ARGS		"submit_args"
+#define PBSDRMAA_SUBMIT_ARGS            "submit_args"
 
 
@@ -123,4 +124,5 @@
 	/* additional job and general attribute names */
 	PBSDRMAA_ATTR_EXECUTION_HOST,
+	PBSDRMAA_ATTR_EXECUTION_VNODE, /* PBS PRO */
 	PBSDRMAA_ATTR_JOB_OWNER,
 	PBSDRMAA_ATTR_RESOURCES_USED,
@@ -135,61 +137,4 @@
 	PBSDRMAA_ATTR_MTIME,
 
-#if 0
-	/* Additional Torque/OpenPBS attribs (not in DRMAA specification): */
-	/* Used by OpenPBS user commands: */
-	PBSDRMAA_ATTR_CHECKPOINT = DRMAA_N_ATTRIBUTES, /* MAX_DRMAA_ATTR+1, */
-	PBSDRMAA_ATTR_GROUP_LIST,
-	PBSDRMAA_ATTR_HOLD_TYPES,
-	PBSDRMAA_ATTR_KEEP_FILES,
-	PBSDRMAA_ATTR_RESOURCES,
-	PBSDRMAA_ATTR_MAIL_POINTS,
-	PBSDRMAA_ATTR_PRIORITY,
-	PBSDRMAA_ATTR_DESTINATION_QUEUE,
-	PBSDRMAA_ATTR_RERUNABLE,
-	PBSDRMAA_ATTR_USER_LIST,
-	PBSDRMAA_ATTR_ACCOUNT_NAME,
-	PBSDRMAA_ATTR_SHELL,
-	PBSDRMAA_ATTR_DEPENDENCIES,
-	PBSDRMAA_ATTR_INTERACTIVE,
-	PBSDRMAA_ATTR_STAGEIN,
-	PBSDRMAA_ATTR_STAGEOUT,
-
-	/* Additional job and general attribute names: */
-	PBSDRMAA_ATTR_JOB_STATE,
-	PBSDRMAA_ATTR_CTIME,
-	/* PBSDRMAA_ATTR_MTIME, moved to basic attributes - needed to determine job end time*/
-	PBSDRMAA_ATTR_QTIME,
-	PBSDRMAA_ATTR_ETIME,
-	PBSDRMAA_ATTR_RESOURCES_USED,
-	PBSDRMAA_ATTR_EXIT_STATUS,
-	PBSDRMAA_ATTR_JOB_OWNER,
-	PBSDRMAA_ATTR_EUSER,
-	PBSDRMAA_ATTR_EGROUP,
-	PBSDRMAA_ATTR_HOP_COUNT,
-	PBSDRMAA_ATTR_SECURITY,
-	PBSDRMAA_ATTR_SCHEDULER_HINT,
-	PBSDRMAA_ATTR_SERVER,
-	PBSDRMAA_ATTR_QUEUE,
-	PBSDRMAA_ATTR_QUEUE_RANK,
-	PBSDRMAA_ATTR_EXECUTION_HOST,
-	PBSDRMAA_ATTR_TOTAL_JOBS,
-	PBSDRMAA_ATTR_MAX_RUNNING,
-	PBSDRMAA_ATTR_COMMENT,
-	PBSDRMAA_ATTR_JOB_COOKIE,
-	PBSDRMAA_ATTR_HASHNAME,
-	PBSDRMAA_ATTR_SESSION_ID,
-	PBSDRMAA_ATTR_ALT_ID,
-
-	/* Reservation attributes */
-	PBSDRMAA_ATTR_RESERVATION_START,
-	PBSDRMAA_ATTR_RESERVATION_END,
-	PBSDRMAA_ATTR_RESERVATION_DURATION,
-	PBSDRMAA_ATTR_RESERVATION_STATE,
-	PBSDRMAA_ATTR_RESERVATION_SUBSTATE,
-
-	/* Pseudo PBS attributes */
-	PBSDRMAA_ATTR_RESERVATION_ID,
-#endif
-
 	PBSDRMAA_N_PBS_ATTRIBUTES
 } pbs_attribute_t;
