@Helena.Bach
Make a little effort, I’m not in your head, nor are the other readers.
Here the code block interest us:
Stata code:
#/home/users/b/bachh/ddml_baobab.do
ssc install ddml, replace
ssc install pystacked, replace
*python query
*python which numpy
*python which sklearn
[...]
sbatch:
#/home/users/b/bachh/a.sh
#!/bin/sh
#SBATCH --time=12:00:00
#SBATCH --ntasks=1
#SBATCH --mem=120G
#SBATCH -J job
#SBATCH -e job-error.e%j
#SBATCH -o job-out.o%j
#SBATCH --mail-user=xxxx
#SBATCH --mail-type=ALL
#SBATCH --partition=shared-bigmem
module load Stata/18
srun stata-mp ddml_baobab.do
My answer:
From what I can see, your sbatch script doesn’t load the required modules that are mentioned in your code. Here’s an example of my setup that works:
Stata Code:
(baobab)-[alberta@login1 stata]$ cat bachh.do
ssc install ddml, replace
ssc install pystacked, replace
*python query
*python which numpy
*python which sklearn
Sbatch script:
(baobab)-[alberta@login1 stata]$ cat bachh.sh
#!/bin/sh
#SBATCH --time=00:15:00
#SBATCH --ntasks=1
#SBATCH --mem=120G
#SBATCH -J job
#SBATCH -e job-error.e%j
#SBATCH -o job-out.o%j
#SBATCH --partition=shared-bigmem
ml GCC/12.3.0 scikit-learn/1.3.1 Stata/18
srun stata-mp bachh.do
Here’s the output from my job (everything is working correctly):
(baobab)-[alberta@login1 stata]$ cat job-out.o11895037
___ ____ ____ ____ ____ ®
/__ / ____/ / ____/ 18.0
___/ / /___/ / /___/ MP—Parallel Edition
Statistics and Data Science Copyright 1985-2023 StataCorp LLC
StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC https://www.stata.com
979-696-4600 stata@stata.com
Stata license: 2-user 32-core network perpetual
Serial number: 501806302009
Licensed to: University of Geneva
Geneva
Notes:
1. Stata is running in batch mode.
2. Unicode is supported; see help unicode_advice.
3. More than 2 billion observations are allowed; see help obs_advice.
4. Maximum number of variables is set to 5,000 but can be increased;
see help set_maxvar.
. do "bachh.do"
. ssc install ddml, replace
checking ddml consistency and verifying not already installed...
installing into /home/users/a/alberta/ado/plus/...
installation complete.
. ssc install pystacked, replace
checking pystacked consistency and verifying not already installed...
installing into /home/users/a/alberta/ado/plus/...
installation complete.
.
. *python query
. *python which numpy
. *python which sklearn
.
end of do-file
You need to make sure that you load all the necessary modules into your sbatch script. This is why your job doesn’t run as expected.
Let me know how it goes with this correction.