Solver error for SMP compilation

Hello developers,

Solver fails to compile in SMP compilation on windows, compiles up to 97% and then fails. I have attached the project files as well as the error message below. It is a case for pure DEM flow through a hopper. Works well with default solver.
ERROR MESSAGE "C:\Users\am4950.conda\envs\mfix-22.4.1\share\mfix\src\model\des\calc_force_dem.f:131:57:

!$omp fchain_fcmax,fc_mag_max,fc_max_index, mag_orient &
1
Error: Syntax error in OpenMP variable list at (1)
C:\Users\am4950.conda\envs\mfix-22.4.1\share\mfix\src\model\des\calc_force_dem.f:402:18:

!$omp end parallel
1
Error: Unexpected !$OMP END PARALLEL statement at (1)
[ 97%] Building Fortran object model/CMakeFiles/mfixcore.dir/des/sq_calc_force_superdem.f.obj
model\CMakeFiles\mfixcore.dir\build.make:2426: recipe for target ‘model/CMakeFiles/mfixcore.dir/des/calc_force_dem.f.obj’ failed
mingw32-make.exe[2]: *** [model/CMakeFiles/mfixcore.dir/des/calc_force_dem.f.obj] Error 1
mingw32-make.exe[2]: *** Waiting for unfinished jobs…
C:\Users\am4950.conda\envs\mfix-22.4.1\share\mfix\src\model\des\sq_calc_force_superdem.f:165:58:

!$omp fchain_fcmax,fc_mag_max, fc_max_index, mag_orient &
1
Error: Syntax error in OpenMP variable list at (1)
C:\Users\am4950.conda\envs\mfix-22.4.1\share\mfix\src\model\des\sq_calc_force_superdem.f:783:18:

!$omp end parallel
1
Error: Unexpected !$OMP END PARALLEL statement at (1)
model\CMakeFiles\mfixcore.dir\build.make:3966: recipe for target ‘model/CMakeFiles/mfixcore.dir/des/sq_calc_force_superdem.f.obj’ failed
mingw32-make.exe[2]: *** [model/CMakeFiles/mfixcore.dir/des/sq_calc_force_superdem.f.obj] Error 1
CMakeFiles\Makefile2:152: recipe for target ‘model/CMakeFiles/mfixcore.dir/all’ failed
mingw32-make.exe[1]: *** [model/CMakeFiles/mfixcore.dir/all] Error 2
Makefile:134: recipe for target ‘all’ failed
mingw32-make.exe: *** [all] Error 2

                 BUILD FAILED

=========================================================================="
hopper_dem_3d_2023-01-24T134449.635703.zip (8.4 MB)

Appreciate the help.

Regards,
Ashreet Mishra.

I can reproduce this problem for SMP build on Windows and Linux. A patch will be forthcoming shortly.

– Charles

1 Like

Oops, it looks like someone missed a few commas when adding force chains to the solver, and the SMP build did not get fully tested. Sorry for the inconvenience.

We will be issuing a 22.4.2 version soon (probably next week) to address this error.

In the meanwhile: you can edit the files calc_force_dem.f and calc_force_superdem.f to add the needed commas.

You can do this several different ways. If building in the GUI you should be able to click on the highligted line in the error popup:

Or use an editor of your choice to open the files which can be found in the director %CONDA_PREFIX%\share\mfix\src\model\des\

he lines that need to be edited are line 131 of calc_force_dem.f and line 165 of sq_calc_force_superdem.f. In both cases a final , is lacking:

Change

!$omp    fchain_fcmax,fc_mag_max,fc_max_index, mag_orient              &

to

!$omp    fchain_fcmax,fc_mag_max,fc_max_index, mag_orient,             &

in both files and try the compilation again.

Or, you can use the patch program if you are familiar with it -

diff --git a/model/des/calc_force_dem.f b/model/des/calc_force_dem.f
index 9db044e6a..5cb96ea1f 100644
--- a/model/des/calc_force_dem.f
+++ b/model/des/calc_force_dem.f
@@ -128,7 +128,7 @@ CONTAINS
 !$omp    tow, fc, energy_eq, grav_mag, postcohesive, pmass, q_source,  &
 !$omp    write_force_chain, des_col_force, iglobal_id,                 &
 !$omp    old_size,new_size,                                            &
-!$omp    fchain_fcmax,fc_mag_max,fc_max_index, mag_orient              &
+!$omp    fchain_fcmax,fc_mag_max,fc_max_index, mag_orient,             &
 !$omp    FCHAINC,FCHAINC_OLD,                                          &
 !$omp    FCHAIN_MIDPOINT,FCHAIN_ORIENT, FCHAIN_FN,FCHAIN_FT,           &
 !$omp    FCHAIN_LENGTH,FCHAIN_FN_MAG,FCHAIN_LOCAL_ID1,FCHAIN_LOCAL_ID2,&
diff --git a/model/des/sq_calc_force_superdem.f b/model/des/sq_calc_force_superdem.f
index 925e61963..cb717b06b 100644
--- a/model/des/sq_calc_force_superdem.f
+++ b/model/des/sq_calc_force_superdem.f
@@ -162,7 +162,7 @@ CONTAINS
 !$omp    tow, fc, energy_eq, grav_mag, postcohesive, pmass, q_source,  &
 !$omp    write_force_chain, des_col_force, iglobal_id,                 &
 !$omp    old_size,new_size,                                            &
-!$omp    fchain_fcmax,fc_mag_max, fc_max_index, mag_orient             &
+!$omp    fchain_fcmax,fc_mag_max, fc_max_index, mag_orient,            &
 !$omp    FCHAINC,FCHAINC_OLD,                                          &
 !$omp    FCHAIN_MIDPOINT,FCHAIN_ORIENT, FCHAIN_FN,FCHAIN_FT,           &
 !$omp    FCHAIN_LENGTH,FCHAIN_FN_MAG,FCHAIN_LOCAL_ID1,FCHAIN_LOCAL_ID2,&

Let me know how it goes!
– Charles

1 Like

Hello @cgw,

The above modifications fixed the compiler issue but when I go to run the solver I get a solver error which I have attached below.

Regards,
Ashreet Mishra.

It might be a problem with a space in the folder name. Try changing DEM flow to DEM_flow or similar. (It is often a problem to have spaces in folder/directory names, although it should be OK, it quite often isn’t. I’ll try to fix this for the next release.)

1 Like