- Timestamp:
- May 4, 2019, 3:36:37 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service.c
r878 r907 269 269 } 270 270 free(logPath); 271 // Run s controlto check if the service execution ended.271 // Run sacct to check if the service execution ended. 272 272 // Store all the informations returned by scontrol command as a cfg file to 273 273 // be parsed back by the ZOO-Kernel waiting for the execution of the remote … … 277 277 map* tmpMap=getMapFromMaps(conf,configId->value,"remote_command_opt"); 278 278 char* command=(char*)malloc((126+strlen(tmpMap->value))*sizeof(char)); 279 sprintf(command,"sacct --format=%s -p | grep \"%s\" | sed \"s:||:|None|:g;s:||:| :g\"",tmpMap->value,jobid->value);279 sprintf(command,"sacct --format=%s -p | grep \"%s\" | sed \"s:||:|None|:g;s:||:|None|:g\"",tmpMap->value,jobid->value); 280 280 if(ssh_exec(conf,command,ssh_get_cnt(conf))==0){ 281 281 free(command); 282 setMapInMaps(conf,"lenv","message",_("Failed to run s controlremotely"));282 setMapInMaps(conf,"lenv","message",_("Failed to run sacct remotely")); 283 283 // TODO: check status in db and if available continue in other case return SERVICE_FAILED 284 284 return SERVICE_FAILED; … … 315 315 } 316 316 }else{ 317 free(logPath); 317 318 setMapInMaps(conf,"lenv","message",_("Unable to access the downloaded execution log file")); 318 319 return SERVICE_FAILED; 319 320 } 321 } 322 tmpMap=getMapFromMaps(tmpMaps,"henv","JobId"); 323 if(tmpMap!=NULL){ 324 char* tmpStr=(char*)malloc((32)*sizeof(char)); 325 sprintf(tmpStr,"slurm-%s.out",tmpMap->value); 326 addToMap(tmpMaps->content,"StdErr",tmpStr); 327 free(tmpStr); 320 328 } 321 329 logPath=(char*)malloc((strlen(tmpPath->value)+strlen(jobid->value)+15)*sizeof(char));
Note: See TracChangeset
for help on using the changeset viewer.