Ignore:
Timestamp:
Oct 11, 2018, 4:30:46 PM (6 years ago)
Author:
djay
Message:

Check for md5sum of any file in the cache to avoid sending the same file on HPC server twice. Add the multiple LiteralData? inputs support for HPC services. Remove condition for defining SCALE for every band in the outputed MapServer? mapfile.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c

    r877 r886  
    299299  // then, set the configId key in the lenv section
    300300  char *serviceType;
    301   map* mServiceType=getMap(s->content,"serviceType");
     301  map* mServiceType=getMap(s->content,"confId");
    302302  if(mServiceType!=NULL)
    303303    serviceType=mServiceType->value;
     
    334334  while(input!=NULL && input->content!=NULL){
    335335    map* isInRequest=getMap(input->content,"inRequest");
    336     map* minNb=getMap(input->content,"minoccurs");
     336    map* minNb=getMap(input->content,"minOccurs");
    337337    if(getMaps(*real_outputs,input->name)==NULL &&
    338338       ( (isInRequest!=NULL && strncasecmp(isInRequest->value,"true",4)==0)
     
    397397        if(getMap(input->content,"dataType")!=NULL){
    398398          // For LitteralData, simply pass the value
    399           map* val=getMap(input->content,"value");
    400           parameters[parameters_cnt-1]=(char*)malloc((strlen(input->name)+strlen(val->value)+3)*sizeof(char));
    401           sprintf(parameters[parameters_cnt-1],"-%s %s",input->name,val->value);
     399          map* length=getMap(input->content,"length");
     400          if(length!=NULL){
     401            char* value=NULL;
     402            int len=atoi(length->value);
     403            int i=0;
     404            for(i=0;i<len;i++){
     405              map* val=getMapArray(input->content,"value",i);
     406              if(val!=NULL){
     407                if(value==NULL){
     408                  value=(char*)malloc((strlen(val->value)+3)*sizeof(char));
     409                  sprintf(value,"\"%s\"",val->value);
     410                }
     411                else{
     412                  value=(char*)realloc(value,(strlen(value)+strlen(val->value)+4)*sizeof(char));
     413                  sprintf(value,"%s \"%s\"",value,val->value);
     414                }
     415              }
     416            }
     417            if(value!=NULL){
     418              parameters[parameters_cnt-1]=(char*)malloc((strlen(input->name)+strlen(value)+3)*sizeof(char));
     419              sprintf(parameters[parameters_cnt-1],"-%s %s",input->name,value);
     420            }
     421          }else{
     422            map* val=getMap(input->content,"value");
     423            parameters[parameters_cnt-1]=(char*)malloc((strlen(input->name)+strlen(val->value)+5)*sizeof(char));
     424            sprintf(parameters[parameters_cnt-1],"-%s \"%s\"",input->name,val->value);
     425          }
    402426        }
    403427      }
     
    888912        dup2 (fileno (stderr), fileno (stdout));
    889913        conf_read(filePath,m);
     914        //dumpMaps(m);
    890915        fflush(stdout);
    891916        dup2 (saved_stdout, fileno (stdout));
     
    910935                free(targetPath);
    911936              }else{
    912                 map* hpcStdErr=getMapFromMaps(*main_conf,"henv","StdErr");
    913                 if(hpcStdErr!=NULL && ssh_fetch(*main_conf,targetPath,hpcStdErr->value,ssh_get_cnt(m))==0){
     937                map* hpcStdErr=getMapFromMaps(*main_conf,"henv","StdErr");
     938                // Added for using sacct in place of scontrol
     939                char *sourcePath=NULL;
     940                if(hpcStdErr!=NULL){
     941                  sourcePath=(char*)malloc((strlen(targetPathMap->value)+strlen(hpcStdErr->value)+2)*sizeof(char));
     942                  sprintf(sourcePath,"%s/%s",targetPathMap->value,hpcStdErr->value);
     943                }
     944                if(hpcStdErr!=NULL && sourcePath!=NULL && ssh_fetch(*main_conf,targetPath,sourcePath,ssh_get_cnt(m))==0){
     945                  free(sourcePath);
    914946                  struct stat f_status;
    915947                  int ts=stat(targetPath, &f_status);
     
    925957                    free(fcontent);
    926958                  }else{
    927                     char *tmpStr=(char*)malloc((strlen(filename)+strlen(_("Unable to fetch the remote file for %s"))+1)*sizeof(char));
    928                     sprintf(tmpStr,_("Unable to fetch the remote file for %s"),filename);
     959                    char *tmpStr=(char*)malloc((strlen(targetPath)+strlen(_("Unable to fetch the remote file for %s"))+1)*sizeof(char));
     960                    sprintf(tmpStr,_("Unable to fetch the remote file for %s"),targetPath);
    929961                    setMapInMaps(*main_conf,"lenv","message",tmpStr);
    930962                    free(tmpStr);
     
    939971                return SERVICE_FAILED;
    940972              }
    941             }       
     973            }
    942974          }else{
    943975            map* generatedFile=getMap(input->content,"generated_file");
     
    9811013              }else{
    9821014                map* hpcStdErr=getMapFromMaps(*main_conf,"henv","StdErr");
    983                 if(hpcStdErr!=NULL && ssh_fetch(*main_conf,targetPath,hpcStdErr->value,ssh_get_cnt(m))==0){
     1015                char *sourcePath=NULL;
     1016                if(hpcStdErr!=NULL){
     1017                  dumpMap(hpcStdErr);
     1018                  sourcePath=(char*)malloc((strlen(targetPathMap->value)+strlen(hpcStdErr->value)+2)*sizeof(char));
     1019                  sprintf(sourcePath,"%s/%s",targetPathMap->value,hpcStdErr->value);
     1020                }
     1021                if(hpcStdErr!=NULL && sourcePath!=NULL && ssh_fetch(*main_conf,targetPath,sourcePath,ssh_get_cnt(m))==0){
     1022                  free(sourcePath);
    9841023                  struct stat f_status;
    9851024                  int ts=stat(targetPath, &f_status);
     
    9951034                    free(fcontent);
    9961035                  }else{
    997                     char *tmpStr=(char*)malloc((strlen(filename)+strlen(_("Unable to fetch the remote file for %s"))+1)*sizeof(char));
    998                     sprintf(tmpStr,_("Unable to fetch the remote file for %s"),filename);
     1036                    char *tmpStr=(char*)malloc((strlen(targetPath)+strlen(_("Unable to fetch the remote file for %s"))+1)*sizeof(char));
     1037                    sprintf(tmpStr,_("Unable to fetch the remote file for %s"),targetPath);
    9991038                    setMapInMaps(*main_conf,"lenv","message",tmpStr);
    10001039                    free(tmpStr);
    10011040                  }
    10021041                }else{
    1003                   char *tmpStr=(char*)malloc((strlen(filename)+strlen(_("Unable to fetch the remote file for %s"))+1)*sizeof(char));
    1004                   sprintf(tmpStr,_("Unable to fetch the remote file for %s"),filename);
     1042                  char *tmpStr=(char*)malloc((strlen(sourcePath)+strlen(_("Unable to fetch the remote file for %s"))+1)*sizeof(char));
     1043                  sprintf(tmpStr,_("Unable to fetch the remote file for %s"),sourcePath);
    10051044                  setMapInMaps(*main_conf,"lenv","message",tmpStr);
    10061045                  free(tmpStr);
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png