Changeset 907 for branches/prototype-v0/zoo-project/zoo-services/utils
- Timestamp:
- May 4, 2019, 3:36:37 PM (6 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-services/utils
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-services/utils/hpc/Makefile
r854 r907 3 3 CFLAGS=-I${INST_INCLUDE} ${ZOO_CFLAGS} ${XML2CFLAGS} ${GDAL_CFLAGS} ${PYTHONCFLAGS} -DLINUX_FREE_ISSUE #-DDEBUG 4 4 5 cgi-env/wps_hpc.zo: service.c 5 cgi-env/wps_hpc.zo: service.c service2.c 6 6 g++ ${CFLAGS} -shared -fpic -o cgi-env/wps_hpc.zo service.c service2.c ${GDAL_LIBS} ${XML2LDFLAGS} ${MACOS_LD_FLAGS} ${ZOO_LDFLAGS} ${MACOS_LD_NET_FLAGS} ${XSLT_LDFLAGS} ${FCGI_LDFLAGS} -L${ZRPATH}/zoo-kernel/ -lzoo_service ${ZRPATH}/zoo-kernel/sshapi.o ${HPCLDFLAGS} 7 7 -
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)); -
branches/prototype-v0/zoo-project/zoo-services/utils/hpc/service2.c
r862 r907 133 133 if(unlink(fullpath)==0){ 134 134 // TODO store the filename_full in the deletedfiles 135 fprintf(stderr,"#### DeleteData #### %s %d %s has been successfully deleted\n",__FILE__,__LINE__,( strlen(filename)>0?filename:fullpath));135 fprintf(stderr,"#### DeleteData #### %s %d %s has been successfully deleted\n",__FILE__,__LINE__,(filename!=NULL && strlen(filename)>0?filename:fullpath)); 136 136 }else{ 137 137 fprintf(stderr,"#### DeleteData #### unable to delete %s %s \n",fullpath,fetchErrno(errno)); … … 155 155 map* ioname=getMapFromMaps(inputs,"ioname","value"); 156 156 char tmp0[4]; 157 sprintf(tmp0,"%c%c%c",filename->value[strlen(filename->value)- 4],filename->value[strlen(filename->value)-3],filename->value[strlen(filename->value)-2]);157 sprintf(tmp0,"%c%c%c",filename->value[strlen(filename->value)-3],filename->value[strlen(filename->value)-2],filename->value[strlen(filename->value)-1]); 158 158 char *cfilename=NULL; 159 159 if(strcasecmp(tmp0,"zca")==0){ … … 208 208 char tmp1[8]; 209 209 snprintf(tmp1,7,"%s",filename->value); 210 if(strcasecmp(tmp1,"output")==0 || str casecmp(tmp1,"input_")==0){211 try deletedatafile(tmppath->value,filename->value);210 if(strcasecmp(tmp1,"output")==0 || strstr(filename->value,".zca")!=NULL || strcasecmp(tmp1,"input_")==0){ 211 tryDeleteDataFile(tmpPath->value,filename->value); 212 212 char *tmp=zStrdup(filename->value); 213 213 tmp[strlen(tmp)-strlen(strrchr(tmp,'.'))]=0; … … 254 254 setMapInMaps(outputs,"Result","value",_ss("The output data has been correclty removed")); 255 255 }else{ 256 setMapInMaps(conf,"lenv","message",_ss("The file you try to delete is nor an input, nor an doutput."));256 setMapInMaps(conf,"lenv","message",_ss("The file you try to delete is nor an input, nor an output.")); 257 257 unlockFile(conf,lck); 258 258 return SERVICE_FAILED; -
branches/prototype-v0/zoo-project/zoo-services/utils/status/service.c
r839 r907 72 72 return SERVICE_FAILED; 73 73 } 74 map tmpMap1=getMapFromMaps(conf,"lenv","semaphore") 75 if(tmpMap1!=NULL && strcasecmp(tmpMap1->value,"Created")==0) 76 removeShmLock(conf,1); 74 77 sprintf(xslFileName,"%s/updateStatus.xsl",tmpMmap->value); 75 78 xmlSubstituteEntitiesDefault(1);
Note: See TracChangeset
for help on using the changeset viewer.