@@ -443,12 +443,12 @@ static char* chpl_launch_create_command(int argc, char* argv[],
443
443
snprintf (stdoutFileNoFmt , stdoutFileLen , "%s" , outputfn );
444
444
}
445
445
else {
446
- char * format = "%s.%s.out" ;
446
+ const char * format = "%s.%s.out" ;
447
447
int stdoutFileLen = strlen (format ) + strlen (argv [0 ]) + strlen ("%j" );
448
448
stdoutFile = (char * )chpl_mem_allocMany (stdoutFileLen , sizeof (char ),
449
449
CHPL_RT_MD_FILENAME , -1 , 0 );
450
450
snprintf (stdoutFile , stdoutFileLen , format , argv [0 ], "%j" );
451
- char * tempArg = "$SLURM_JOB_ID" ;
451
+ const char * tempArg = "$SLURM_JOB_ID" ;
452
452
int stdoutFileNoFmtLen =
453
453
strlen (format ) + strlen (argv [0 ]) + strlen (tempArg );
454
454
stdoutFileNoFmt = (char * )chpl_mem_allocMany (
@@ -466,8 +466,8 @@ static char* chpl_launch_create_command(int argc, char* argv[],
466
466
// If we're buffering the output, set the temp output file name.
467
467
// It's always <tmpDir>/binaryName.<jobID>.out.
468
468
if (bufferStdout != NULL ) {
469
- char * format = "%s/%s.%s.out" ;
470
- char * tempArg = "$SLURM_JOB_ID" ;
469
+ const char * format = "%s/%s.%s.out" ;
470
+ const char * tempArg = "$SLURM_JOB_ID" ;
471
471
int tmpStdoutFileNoFmtLen =
472
472
strlen (format ) + strlen (tmpDir ) + strlen (argv [0 ]) + strlen (tempArg );
473
473
tmpStdoutFileNoFmt = (char * )chpl_mem_allocMany (
@@ -521,7 +521,7 @@ static char* chpl_launch_create_command(int argc, char* argv[],
521
521
522
522
// the baseCommand is what will call the batch file
523
523
// that was just created
524
- char * format = "sbatch %s\n" ;
524
+ const char * format = "sbatch %s\n" ;
525
525
int baseCommandLen = strlen (slurmFilename ) + strlen (format );
526
526
baseCommand = (char * )chpl_mem_allocMany (baseCommandLen , sizeof (char ),
527
527
CHPL_RT_MD_COMMAND_BUFFER , -1 , 0 );
@@ -611,7 +611,7 @@ static char* chpl_launch_create_command(int argc, char* argv[],
611
611
}
612
612
613
613
// launch the job using srun
614
- char * format = "srun %s" ;
614
+ const char * format = "srun %s" ;
615
615
int baseCommandLen = strlen (format ) + len + 1 ;
616
616
baseCommand = (char * )chpl_mem_allocMany (baseCommandLen , sizeof (char ),
617
617
CHPL_RT_MD_COMMAND_BUFFER , -1 , 0 );
0 commit comments