Running Jobs¶
Basic Execution¶
from ngpb4py import NgpbConfig, NgpbRunner
config = NgpbConfig.from_prm("options.prm")
result = NgpbRunner(nproc=8).run(config=config)
Working Directories¶
workdir is treated as a scratch parent directory, not the final run directory.
Each call to run() creates a unique child directory inside it.
result = NgpbRunner().run(config=config, workdir="scratch", keep_files=True)
print(result.scratch_dir)
print(result.workdir)
This makes concurrent runs safer because they do not overwrite each other's files.
Verbosity¶
Wrapper logging can be controlled globally on the runner or per run:
runner = NgpbRunner(verbosity=1)
result = runner.run(config=config, verbose=3)
Verbosity levels:
0: warnings and errors only1: high-level progress messages2: debug logging from the wrapper3: debug logging plus streamed backend output
Container Options¶
You can customize the runtime invocation:
runner = NgpbRunner(
container_image="/data/images/NextGenPB.sif",
container_exec_args=["--containall"],
container_extra_args=["--silent"],
)
Use container_exec_args for flags passed to apptainer exec, and
container_extra_args for flags inserted immediately after the runtime command.