Changeset 12 for trunk/pbs_drmaa/session.c
- Timestamp:
- 04/20/11 17:20:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pbs_drmaa/session.c
- Property svn:keywords set to Id
r10 r12 1 /* $Id : session.c 385 2011-01-04 18:24:05Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro … … 53 53 __attribute__ ((unused)) 54 54 # endif 55 = "$Id : session.c 385 2011-01-04 18:24:05Z mamonski$";55 = "$Id$"; 56 56 #endif 57 57 … … 213 213 fsd_conf_option_t *pbs_home; 214 214 pbs_home = fsd_conf_dict_get(self->configuration, "pbs_home" ); 215 if( pbs_home ) 216 { 217 if( pbs_home->type == FSD_CONF_STRING ) 218 { 215 216 if( pbs_home && pbs_home->type == FSD_CONF_STRING ) 217 { 219 218 struct stat statbuf; 220 219 char * volatile log_path; … … 222 221 223 222 pbsself->pbs_home = pbs_home->val.string; 224 fsd_log_ debug(("pbs_home: %s",pbsself->pbs_home));223 fsd_log_info(("pbs_home: %s",pbsself->pbs_home)); 225 224 pbsself->super_wait_thread = pbsself->super.wait_thread; 226 225 pbsself->super.wait_thread = pbsdrmaa_session_wait_thread; … … 230 229 localtime_r(&pbsself->log_file_initial_time,&tm); 231 230 232 if((log_path = fsd_asprintf("%s/server_logs/%04d%02d%02d", 233 pbsself->pbs_home, 234 tm.tm_year + 1900, 235 tm.tm_mon + 1, 236 tm.tm_mday)) == NULL) { 237 fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"WT - Memory allocation wasn't possible"); 238 } 239 240 if(stat(log_path,&statbuf) == -1) { 231 log_path = fsd_asprintf("%s/server_logs/%04d%02d%02d", 232 pbsself->pbs_home, 233 tm.tm_year + 1900, 234 tm.tm_mon + 1, 235 tm.tm_mday); 236 237 if(stat(log_path,&statbuf) == -1) 238 { 241 239 char errbuf[256] = "InternalError"; 242 (void)strerror_r(errno, errbuf, 256);240 (void)strerror_r(errno, errbuf, sizeof(errbuf)); 243 241 fsd_exc_raise_fmt(FSD_ERRNO_INTERNAL_ERROR,"stat error: %s",errbuf); 244 }242 } 245 243 246 244 fsd_log_debug(("Log file %s size %d",log_path,(int) statbuf.st_size)); 247 245 pbsself->log_file_initial_size = statbuf.st_size; 248 246 fsd_free(log_path); 249 } 250 else 251 { 252 pbsself->super.enable_wait_thread = false; 253 pbsself->wait_thread_log = false; 254 fsd_log_debug(("pbs_home not configured. Running standard wait_thread (pooling).")); 255 } 256 } 257 258 247 } 259 248 260 249 pbsself->super_apply_configuration(self); /* call method from the superclass */ … … 277 266 conn_lock = fsd_mutex_lock( &self->drm_connection_mutex ); 278 267 retry: 279 268 /* TODO: query only for user's jobs pbs_selstat + ATTR_u */ 280 269 #ifdef PBS_PROFESSIONAL 281 270 status = pbs_statjob( pbsself->pbs_conn, NULL, NULL, NULL ); … … 494 483 fsd_log_warning(( "no default queue set on PBS server" )); 495 484 else if( keep_completed == NULL && self->pbs_home == NULL ) 496 fsd_log_warning(( " PBSserver is not configured to keep completed jobs\n"485 fsd_log_warning(( "Torque server is not configured to keep completed jobs\n" 497 486 "in Torque: set keep_completed parameter of default queue\n" 498 487 " $ qmgr -c 'set queue batch keep_completed = 60'\n" … … 513 502 } 514 503 END_TRY 504 505 return result; 515 506 #endif 507 fsd_log_warning(( "PBS Professional does not keep information about the completed jobs\n" 508 " You must configure DRMAA to utilize log files in order to always get valid job exit status" 509 )); 516 510 return false; 517 511 }
Note: See TracChangeset
for help on using the changeset viewer.