@@ -237,9 +237,14 @@ private async Task WriteHpcgRunShellAsync(CancellationToken cancellationToken)
237
237
// . spack/share/spack/setup-env.sh
238
238
string spackSetupCommand = $ ". { this . spackDirectory } /share/spack/setup-env.sh";
239
239
240
+ // Giving permissions to the required files
241
+ string createSpackDbDirCmd = $ "mkdir -p { this . spackDirectory } /opt/spack/.spack-db";
242
+ string chownSpackDirCmd = $ "sudo chown -R $(whoami):$(whoami) { this . spackDirectory } ";
243
+ string chmodSpackDirCmd = $ "chmod -R u+rwx { this . spackDirectory } ";
244
+
240
245
// If gcc>= 9, use zen2. if <=8, use zen.
241
- // spack install -n -y hpcg %gcc@10.3.0 +openmp target=zen2 ^openmpi@4.1.1
242
- string installCommand = $ "spack install --reuse -n -y hpcg@{ this . HpcgVersion } %gcc +openmp ^openmpi@{ this . OpenMpiVersion } ";
246
+ // spack install -n -y hpcg %gcc@10.3.0 target=zen2 ^openmpi@4.1.1
247
+ string installCommand = $ "spack install --reuse -n -y hpcg@{ this . HpcgVersion } %gcc ^openmpi@{ this . OpenMpiVersion } ";
243
248
244
249
// spack load hpcg %gcc@10.3.0
245
250
string loadCommand = $ "spack load hpcg@{ this . HpcgVersion } %gcc ^openmpi@{ this . OpenMpiVersion } ";
@@ -249,7 +254,7 @@ private async Task WriteHpcgRunShellAsync(CancellationToken cancellationToken)
249
254
int coreCount = cpuInfo . PhysicalCoreCount ;
250
255
string mpirunCommand = $ "mpirun --np { coreCount } --use-hwthread-cpus --allow-run-as-root xhpcg";
251
256
252
- this . runShellText = string . Join ( Environment . NewLine , spackSetupCommand , installCommand , loadCommand , mpirunCommand ) ;
257
+ this . runShellText = string . Join ( Environment . NewLine , spackSetupCommand , createSpackDbDirCmd , chownSpackDirCmd , chmodSpackDirCmd , installCommand , loadCommand , mpirunCommand ) ;
253
258
254
259
await this . systemManagement . FileSystem . File . WriteAllTextAsync ( this . hpcgRunShellPath , this . runShellText , cancellationToken ) . ConfigureAwait ( false ) ;
255
260
}
0 commit comments