[Gate-users] Patch for gjs: more readable openPBS jobnames

Hannes Hofmann opengate at f00f.de
Thu Nov 29 18:30:21 CET 2007


Ok, forget about it. Obviously jobnames must not start with a number.
Sorry for that one.

On 29/11 15:30, Hannes Hofmann wrote:
> Hi,
> 
> this patch places the job number at the beginning of the jobname,
> instead of at its end.
> My Q manager displays not all 15 chars, so I usually didn't see the
> number at all.
> 
> Regards,
> Hannes

> diff -rup gate_v3.1.1-orig/Cluster_Tools/jobsplitter/include/GateToPlatform.hh gate_v3.1.1/Cluster_Tools/jobsplitter/include/GateToPlatform.hh
> --- gate_v3.1.1-orig/Cluster_Tools/jobsplitter/include/GateToPlatform.hh	2007-03-20 16:18:41.000000000 +0100
> +++ gate_v3.1.1/Cluster_Tools/jobsplitter/include/GateToPlatform.hh	2007-11-29 15:24:49.000000000 +0100
> @@ -35,12 +35,15 @@ class GateToPlatform
>  {
>  public:
>    GateToPlatform();
>    GateToPlatform(G4int numberOfSplits, G4String thePlatform, G4String pbsscript,G4String theCondorScript,G4String outputMacName,G4int time);
>    ~GateToPlatform();
>    void SetVerboseLevel(G4int value) { m_verboseLevel = value; };
>    int GenerateSubmitfile(G4String outputMacDir);
>  
>  protected: 
> +  // job name in openPBS is limited to 15 characters
> +  static const unsigned int OPEN_PBS_MAX_JOBNAME_LENGTH = 15;
> +
>    int GenerateOpenMosixSubmitfile();
>    int GenerateOpenPBSSubmitfile();
>    int GenerateOpenPBSScriptfile();
> diff -rup gate_v3.1.1-orig/Cluster_Tools/jobsplitter/src/GateToPlatform.cc gate_v3.1.1/Cluster_Tools/jobsplitter/src/GateToPlatform.cc
> --- gate_v3.1.1-orig/Cluster_Tools/jobsplitter/src/GateToPlatform.cc	2007-03-20 16:18:41.000000000 +0100
> +++ gate_v3.1.1/Cluster_Tools/jobsplitter/src/GateToPlatform.cc	2007-11-29 15:25:16.000000000 +0100
> @@ -104,12 +104,11 @@ int GateToPlatform::GenerateOpenPBSScrip
>  				if(pos<buf.length())  buf=buf.substr(0,pos)+"log"+cnt.str()+buf.substr(pos+6);
>  				pos=buf.find("GC_ERR");
>  				if(pos<buf.length())  buf=buf.substr(0,pos)+"err"+cnt.str()+buf.substr(pos+6);
>  				pos=buf.find("GC_JOBNAME");
>  				if(pos<buf.length())  {
> -					//openPBS max_jobname_length=15
> -					char jobname[16]="";
> -					strncpy(jobname,outputMacfilename.c_str(),15-cnt.str().length());
> -					buf=buf.substr(0,pos)+jobname+cnt.str()+buf.substr(pos+10);
> +					char jobname[OPEN_PBS_MAX_JOBNAME_LENGTH + 1] = "";
> +					strncpy(jobname, outputMacfilename.c_str(), OPEN_PBS_MAX_JOBNAME_LENGTH - cnt.str().length());
> +					buf = buf.substr(0,pos) + cnt.str() + jobname + buf.substr(pos+10);
>  				}
>  				pos=buf.find("GC_GATE");
>  				G4String timestr="";

> _______________________________________________
> Gate-users mailing list
> Gate-users at lists.healthgrid.org
> http://lists.healthgrid.org/mailman/listinfo/gate-users




More information about the Gate-users mailing list