Skip to content

Commit cd79aa7

Browse files
committed
fix the bug in os environ and add opengl path
1 parent fc1807c commit cd79aa7

1 file changed

Lines changed: 39 additions & 61 deletions

File tree

notebooks/run_model_in_notebook.ipynb

Lines changed: 39 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
{
5252
"cell_type": "code",
53-
"execution_count": 3,
53+
"execution_count": 16,
5454
"metadata": {},
5555
"outputs": [],
5656
"source": [
@@ -67,7 +67,7 @@
6767
},
6868
{
6969
"cell_type": "code",
70-
"execution_count": 4,
70+
"execution_count": 17,
7171
"metadata": {},
7272
"outputs": [
7373
{
@@ -82,7 +82,7 @@
8282
" 'DurationSize': '17520'}"
8383
]
8484
},
85-
"execution_count": 4,
85+
"execution_count": 17,
8686
"metadata": {},
8787
"output_type": "execute_result"
8888
}
@@ -93,7 +93,7 @@
9393
},
9494
{
9595
"cell_type": "code",
96-
"execution_count": 5,
96+
"execution_count": 18,
9797
"metadata": {},
9898
"outputs": [
9999
{
@@ -108,7 +108,7 @@
108108
" 'DurationSize': '5'}"
109109
]
110110
},
111-
"execution_count": 5,
111+
"execution_count": 18,
112112
"metadata": {},
113113
"output_type": "execute_result"
114114
}
@@ -128,7 +128,7 @@
128128
},
129129
{
130130
"cell_type": "code",
131-
"execution_count": 7,
131+
"execution_count": 9,
132132
"metadata": {},
133133
"outputs": [],
134134
"source": [
@@ -161,15 +161,15 @@
161161
},
162162
{
163163
"cell_type": "code",
164-
"execution_count": 8,
164+
"execution_count": 10,
165165
"metadata": {},
166166
"outputs": [
167167
{
168168
"name": "stdout",
169169
"output_type": "stream",
170170
"text": [
171-
"Prepare work directory /home/sarah/temp/ecoextreml/input/NL-Hor_20220517_1102 for the station: NL-Hor\n",
172-
"Prepare work directory /home/sarah/temp/ecoextreml/input/ZA-Kru_20220517_1102 for the station: ZA-Kru\n"
171+
"Prepare work directory /home/sarah/temp/ecoextreml/input/NL-Hor_20220519_1455 for the station: NL-Hor\n",
172+
"Prepare work directory /home/sarah/temp/ecoextreml/input/ZA-Kru_20220519_1455 for the station: ZA-Kru\n"
173173
]
174174
}
175175
],
@@ -201,67 +201,45 @@
201201
},
202202
{
203203
"cell_type": "code",
204-
"execution_count": 20,
204+
"execution_count": 13,
205205
"metadata": {},
206-
"outputs": [],
206+
"outputs": [
207+
{
208+
"name": "stdout",
209+
"output_type": "stream",
210+
"text": [
211+
"/usr/local/MATLAB/MATLAB_Runtime/v910/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/extern/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v910/sys/opengl/lib/glnxa64\n"
212+
]
213+
}
214+
],
207215
"source": [
208216
"# # Set LD_LIBRARY_PATH\n",
209-
"# matlab_path = !whereis MATLAB\n",
210-
"# matlab_path = matlab_path.s.split(\": \")[1]\n",
211-
"# os.environ['LD_LIBRARY_PATH'] = f\"{matlab_path}/MATLAB_Runtime/v910/runtime/glnxa64:f{matlab_path}/MATLAB_Runtime/v910/bin/glnxa64:{matlab_path}/MATLAB_Runtime/v910/sys/os/glnxa64:{matlab_path}/MATLAB_Runtime/v910/extern/bin/glnxa64\""
217+
"matlab_path = !whereis MATLAB\n",
218+
"matlab_path = matlab_path.s.split(\": \")[1]\n",
219+
"os.environ['LD_LIBRARY_PATH'] = (\n",
220+
" f\"{matlab_path}/MATLAB_Runtime/v910/runtime/glnxa64:\"\n",
221+
" f\"{matlab_path}/MATLAB_Runtime/v910/bin/glnxa64:\"\n",
222+
" f\"{matlab_path}/MATLAB_Runtime/v910/sys/os/glnxa64:\"\n",
223+
" f\"{matlab_path}/MATLAB_Runtime/v910/extern/bin/glnxa64:\"\n",
224+
" f\"{matlab_path}/MATLAB_Runtime/v910/sys/opengl/lib/glnxa64\")\n",
225+
"print(os.environ['LD_LIBRARY_PATH'])"
212226
]
213227
},
214228
{
215229
"cell_type": "code",
216-
"execution_count": 10,
230+
"execution_count": 14,
217231
"metadata": {},
218232
"outputs": [
219233
{
220234
"name": "stdout",
221235
"output_type": "stream",
222236
"text": [
223-
"Run STEMMUS-SCOPE with the forcing: NL-Hor_2008-2011_FLUXNET2015_Met.nc\n"
224-
]
225-
},
226-
{
227-
"name": "stderr",
228-
"output_type": "stream",
229-
"text": [
230-
"libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
231-
"libGL error: failed to load driver: iris\n",
232-
"libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
233-
"libGL error: failed to load driver: iris\n",
234-
"libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
235-
"libGL error: failed to load driver: swrast\n"
236-
]
237-
},
238-
{
239-
"name": "stdout",
240-
"output_type": "stream",
241-
"text": [
242-
"Reading config from /home/sarah/temp/ecoextreml/input/NL-Hor_20220517_1102/NL-Hor_20220517_1102_config.txt\n",
237+
"Run STEMMUS-SCOPE with the forcing: NL-Hor_2008-2011_FLUXNET2015_Met.nc\n",
238+
"Reading config from /home/sarah/temp/ecoextreml/input/NL-Hor_20220519_1455/NL-Hor_20220519_1455_config.txt\n",
243239
"\n",
244240
" The calculations start now \n",
245-
"Run STEMMUS-SCOPE with the forcing: ZA-Kru_2000-2002_FLUXNET2015_Met.nc\n"
246-
]
247-
},
248-
{
249-
"name": "stderr",
250-
"output_type": "stream",
251-
"text": [
252-
"libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
253-
"libGL error: failed to load driver: iris\n",
254-
"libGL error: MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
255-
"libGL error: failed to load driver: iris\n",
256-
"libGL error: MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:\\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)\n",
257-
"libGL error: failed to load driver: swrast\n"
258-
]
259-
},
260-
{
261-
"name": "stdout",
262-
"output_type": "stream",
263-
"text": [
264-
"Reading config from /home/sarah/temp/ecoextreml/input/ZA-Kru_20220517_1102/ZA-Kru_20220517_1102_config.txt\n",
241+
"Run STEMMUS-SCOPE with the forcing: ZA-Kru_2000-2002_FLUXNET2015_Met.nc\n",
242+
"Reading config from /home/sarah/temp/ecoextreml/input/ZA-Kru_20220519_1455/ZA-Kru_20220519_1455_config.txt\n",
265243
"\n",
266244
" The calculations start now \n",
267245
" The calculations end now \r"
@@ -296,28 +274,28 @@
296274
"name": "stdout",
297275
"output_type": "stream",
298276
"text": [
299-
"/home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-13-1436/ECdata.csv\n",
277+
"/home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-19-1457/ECdata.csv\n",
300278
"Reading variable metadata from /home/sarah/GitHub/STEMMUS_SCOPE/utils/csv_to_nc/Variables_will_be_in_NetCDF_file.csv\n",
301-
"Creating /home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-13-1436/NL-Hor_2022-05-13-1436_STEMMUS_SCOPE.nc \n",
279+
"Creating /home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-19-1457/NL-Hor_2022-05-19-1457_STEMMUS_SCOPE.nc \n",
302280
"Reading data from file: radiation.csv\n",
303281
"Reading data from file: fluxes.csv\n",
304282
"Reading data from file: surftemp.csv\n",
305283
"Reading data from file: Sim_Temp.csv\n",
306284
"Reading data from file: Sim_Theta.csv\n",
307285
"Reading data from file: aerodyn.csv\n",
308286
"Reading data from file: ECdata.csv\n",
309-
"Done writing /home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-13-1436/NL-Hor_2022-05-13-1436_STEMMUS_SCOPE.nc\n",
310-
"/home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-13-1436/ECdata.csv\n",
287+
"Done writing /home/sarah/temp/ecoextreml/output/NL-Hor_2022-05-19-1457/NL-Hor_2022-05-19-1457_STEMMUS_SCOPE.nc\n",
288+
"/home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-19-1458/ECdata.csv\n",
311289
"Reading variable metadata from /home/sarah/GitHub/STEMMUS_SCOPE/utils/csv_to_nc/Variables_will_be_in_NetCDF_file.csv\n",
312-
"Creating /home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-13-1436/ZA-Kru_2022-05-13-1436_STEMMUS_SCOPE.nc \n",
290+
"Creating /home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-19-1458/ZA-Kru_2022-05-19-1458_STEMMUS_SCOPE.nc \n",
313291
"Reading data from file: radiation.csv\n",
314292
"Reading data from file: fluxes.csv\n",
315293
"Reading data from file: surftemp.csv\n",
316294
"Reading data from file: Sim_Temp.csv\n",
317295
"Reading data from file: Sim_Theta.csv\n",
318296
"Reading data from file: aerodyn.csv\n",
319297
"Reading data from file: ECdata.csv\n",
320-
"Done writing /home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-13-1436/ZA-Kru_2022-05-13-1436_STEMMUS_SCOPE.nc\n"
298+
"Done writing /home/sarah/temp/ecoextreml/output/ZA-Kru_2022-05-19-1458/ZA-Kru_2022-05-19-1458_STEMMUS_SCOPE.nc\n"
321299
]
322300
}
323301
],

0 commit comments

Comments
 (0)