Changeset 12 for trunk/pbs_drmaa
- Timestamp:
- 04/20/11 17:20:29 (14 years ago)
- Location:
- trunk/pbs_drmaa
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pbs_drmaa/.gitignore
- Property svn:keywords set to Id
-
trunk/pbs_drmaa/CHANGELOG
- Property svn:keywords set to Id
-
trunk/pbs_drmaa/Makefile.am
- Property svn:keywords set to Id
r7 r12 1 # $Id : Makefile.am 2420 2009-06-24 14:40:21Z lukasz$1 # $Id$ 2 2 # 3 3 # FedStage DRMAA for PBS Professional -
trunk/pbs_drmaa/drmaa.c
- Property svn:keywords set to Id
r1 r12 1 /* $Id : drmaa.c 353 2010-10-18 13:45:14Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/job.c
- Property svn:keywords set to Id
r10 r12 1 /* $Id : job.c 370 2010-11-16 09:51:00Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro … … 43 43 __attribute__ ((unused)) 44 44 # endif 45 = "$Id : job.c 370 2010-11-16 09:51:00Z mamonski$";45 = "$Id$"; 46 46 #endif 47 47 … … 385 385 int hours, minutes, seconds; 386 386 long mem; 387 if( cpu_usage && sscanf( cpu_usage, "%d:%d:%d", 388 &hours, &minutes, &seconds ) == 3 ) 387 if( cpu_usage && sscanf( cpu_usage, "%d:%d:%d", &hours, &minutes, &seconds ) == 3 ) 389 388 { 390 389 self->cpu_usage = 60*( 60*hours + minutes ) + seconds; … … 401 400 fsd_log_debug(( "vmem_usage: %s=%ldB", vmem_usage, self->vmem_usage )); 402 401 } 403 if( walltime && sscanf( walltime, "%d:%d:%d", 404 &hours, &minutes, &seconds ) == 3 ) 402 if( walltime && sscanf( walltime, "%d:%d:%d", &hours, &minutes, &seconds ) == 3 ) 405 403 { 406 404 self->walltime = 60*( 60*hours + minutes ) + seconds; … … 414 412 { 415 413 pbsdrmaa_session_t *pbssession = (pbsdrmaa_session_t*)self->session; 416 414 417 415 if( pbssession->pbs_home == NULL ) 418 416 pbsdrmaa_job_on_missing_standard( self ); … … 429 427 430 428 fsd_log_enter(( "({job_id=%s})", self->job_id )); 431 fsd_log_warning(( " self%s missing from DRM queue", self->job_id ));429 fsd_log_warning(( "Job %s missing from DRM queue", self->job_id )); 432 430 433 431 switch( session->missing_jobs ) … … 465 463 } 466 464 465 fsd_cond_broadcast( &self->status_cond); 466 467 467 fsd_log_return(( "; job_ps=%s, exit_status=%d", 468 468 drmaa_job_ps_to_str(self->state), self->exit_status )); … … 476 476 477 477 fsd_log_enter(( "({job_id=%s})", self->job_id )); 478 fsd_log_ warning(( "self%s missing from DRM queue", self->job_id ));478 fsd_log_info(( "Job %s missing from DRM queue", self->job_id )); 479 479 480 480 TRY -
trunk/pbs_drmaa/job.h
- Property svn:keywords set to Id
r8 r12 1 /* $Id : job.h 2 2009-10-12 09:51:22Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/log_reader.c
- Property svn:keywords set to Id
r8 r12 1 /* $Id : log_reader.c 323 2010-09-21 21:31:29Z mmatloka$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/log_reader.h
- Property svn:keywords set to Id
r8 r12 1 /* $Id : log_reader.h 323 2010-09-21 21:31:29Z mmatloka$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/pbs_attrib.gperf
- Property svn:keywords set to Id
r4 r12 1 1 %{ 2 /* $Id : pbs_attrib.gperf 2677 2009-09-08 14:32:22Z mmamonski$ */2 /* $Id$ */ 3 3 /* 4 4 * FedStage DRMAA for PBS Pro … … 31 31 __attribute__ ((unused)) 32 32 # endif 33 = "$Id : pbs_attrib.gperf 2677 2009-09-08 14:32:22Z mmamonski$";33 = "$Id$"; 34 34 #endif 35 35 -
trunk/pbs_drmaa/pbs_attrib.h
- Property svn:keywords set to Id
r4 r12 1 /* $Id : pbs_attrib.h 256 2010-08-10 16:31:35Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/pbs_drmaa.conf.example
- Property svn:keywords set to Id
r1 r12 1 # $Id : pbs_drmaa.conf.example 2420 2009-06-24 14:40:21Z lukasz$1 # $Id$ 2 2 # pbs_drmaa.conf - Sample pbs_drmaa configuration file. 3 3 -
trunk/pbs_drmaa/pbs_drmaa.h
- Property svn:keywords set to Id
r1 r12 1 /* $Id : pbs_drmaa.h 2 2009-10-12 09:51:22Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
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 } -
trunk/pbs_drmaa/session.h
- Property svn:keywords set to Id
r7 r12 1 /* $Id : session.h 323 2010-09-21 21:31:29Z mmatloka$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/submit.c
- Property svn:keywords set to Id
r10 r12 1 /* $Id : submit.c 386 2011-01-06 18:13:33Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro … … 46 46 __attribute__ ((unused)) 47 47 # endif 48 = "$Id : submit.c 386 2011-01-06 18:13:33Z mamonski$";48 = "$Id$"; 49 49 #endif 50 50 … … 546 546 else 547 547 { 548 fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, "Invalid native specification: %s (Invalid resource specification: %s)", resources, arg); 549 548 fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, "Invalid native specification: %s (Invalid resource specification: %s)", resources, arg); 550 549 } 551 550 } … … 569 568 TRY 570 569 { 571 for (arg = strtok_r(add_attr_copy, " ,", &ctxt); arg; arg = strtok_r(NULL, ":",&ctxt) )570 for (arg = strtok_r(add_attr_copy, ";", &ctxt); arg; arg = strtok_r(NULL, ";",&ctxt) ) 572 571 { 573 572 name = fsd_strdup(strtok_r(arg, "=", &ctxt2)); … … 606 605 607 606 TRY 608 {607 { 609 608 for (arg = strtok_r(native_spec_copy, " \t", &ctxt); arg; arg = strtok_r(NULL, " \t",&ctxt) ) { 610 if (!opt) { 611 if ( (arg[0] != '-') || ((strlen(arg) != 2) && arg[2] != ' ' && arg[1] !='-' ) ) 609 if (!opt) 610 { 611 if ( (arg[0] != '-') || (strlen(arg) != 2) ) 612 612 fsd_exc_raise_fmt(FSD_DRMAA_ERRNO_INVALID_ATTRIBUTE_VALUE, 613 "Invalid native specification: %s", 614 native_specification); 615 if(arg[1] == '-') { 616 parse_additional_attr(pbs_attr, arg+2); 613 "Invalid native specification: -o(ption) expected (arg=%s native=%s).", 614 arg, native_specification); 615 616 case 'h' : 617 pbs_attr->set_attr( pbs_attr, "Hold_Types" , arg ); 618 break; 619 620 opt = arg[1]; 621 622 /* handle NO-arg options */ 623 624 switch (opt) { 625 case 'h' : 626 pbs_attr->set_attr( pbs_attr, "Hold_Types" , "u" ); 627 break; 628 default : 629 continue; /*no NO-ARG option */ 617 630 } 618 else { 619 opt = arg[1];620 621 622 } else{631 632 opt = 0; 633 } 634 else 635 { 623 636 switch (opt) { 624 637 … … 644 657 pbs_attr->set_attr( pbs_attr, "Execution_Time" , arg ); 645 658 break; 646 case 'h' :647 pbs_attr->set_attr( pbs_attr, "Hold_Types" , arg );648 break;649 659 case 'A' : 650 660 pbs_attr->set_attr( pbs_attr, "Account_Name" , arg ); … … 672 682 break; 673 683 case 'v' : 674 case 'V' :675 684 pbs_attr->set_attr( pbs_attr, "Variable_List" , arg ); 676 685 break; … … 687 696 native_specification, opt); 688 697 } 689 690 698 opt = 0; 691 699 } -
trunk/pbs_drmaa/submit.h
- Property svn:keywords set to Id
r1 r12 1 /* $Id : submit.h 338 2010-09-28 14:48:45Z mamonski$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro -
trunk/pbs_drmaa/util.c
- Property svn:keywords set to Id
r8 r12 1 /* $Id : util.c 323 2010-09-21 21:31:29Z mmatloka$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro … … 41 41 __attribute__ ((unused)) 42 42 # endif 43 = "$Id : util.c 323 2010-09-21 21:31:29Z mmatloka$";43 = "$Id$"; 44 44 #endif 45 45 -
trunk/pbs_drmaa/util.h
- Property svn:keywords set to Id
r8 r12 1 /* $Id : util.h 323 2010-09-21 21:31:29Z mmatloka$ */1 /* $Id$ */ 2 2 /* 3 3 * FedStage DRMAA for PBS Pro
Note: See TracChangeset
for help on using the changeset viewer.