Warwick-Plasma / epoch

Particle-in-cell code for plasma physics simulations
https://epochpic.github.io
GNU General Public License v3.0
186 stars 59 forks source link

Not able to compile the code in Scarf cluster. #465

Closed Hnair13 closed 1 year ago

Hnair13 commented 1 year ago

Hello, I have been trying to use EPOCH in the SCARF cluster but unfortunately the code itself is not compiling I tried to troubleshoot it but its still not happening. Hope you could help me resolve this. $ make COMPILER=intel make[1]: Entering directory/work4/clf/hnair/epoch1/epoch1d' make MAKEFLAGS= COMPILER=intel -C ../SDF/FORTRAN make[2]: Entering directory /work4/clf/hnair/epoch1/SDF/FORTRAN' mpif90 -I/usr/include -Iinclude -Iobj -module include -o obj/MPI_CHECK src/mpi_version.f90 src/mpi_version.f90(3): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [MPI] USE mpi ------^ compilation aborted for src/mpi_version.f90 (code 1) make[2]: *** [MPI_CHECK] Error 1 make[2]: Leaving directory/work4/clf/hnair/epoch1/SDF/FORTRAN' make[1]: [../SDF/FORTRAN/include/sdf.mod] Error 2 make[1]: Leaving directory `/work4/clf/hnair/epoch1/epoch1d' make: [commit] Error 2 `

Status-Mirror commented 1 year ago

Can you try the commands:

make cleanall
make COMPILER=intel

Also, did you copy EPOCH over to SCARF using the git clone --recursive https://github.com/Warwick-Plasma/epoch.git?

On clusters, there are often modules you need to load before you can compile EPOCH. Can you confirm the mpif90 module has been loaded by typing mpif90 --version?

Hnair13 commented 1 year ago

Hello, I tried compiling but its still showing error. I have attached the screenshots of the errors. image) unnamed

Status-Mirror commented 1 year ago

Okay, so it looks like SCARF recognises mpif90. I haven't seen an error thrown up with -module before - maybe SCARF doesn't recognise the intel compiler? Could you try:

make cleanall
make COMPILER=gfortran

And also, I'm assuming you're running this command from either the epoch1d, epoch2d, or epoch3d directories. Could you show me the output to:

cd ../SDF/FORTRAN 
ls

where you start from the same directory you're running the Makefile in.

Hnair13 commented 1 year ago

Hello, I tried doing what was mentioned by you earlier and here are the screenshots of the output recieved. sc1 sc2

Also, I would like to point out the previous issue which was closed, where my colleague also had the same issue. I have shared the link as well hoping that could help to sort this out. https://github.com/Warwick-Plasma/epoch/issues/419

Status-Mirror commented 1 year ago

In Ratul's solution, it sounds like he got it to work by restarting the installation process.

I'm guessing the issue may be related to the modules you have loaded. If you start the compilation with one module set-up, then switch to another, then previously generated files will be incompatible with the new module set-up.

Unfortunately I do not have a SCARF account, so I can't assist you directly with module instructions. I would advise you restart the installation process from the beginning.

In a new directory, run:

git clone --recursive https://github.com/Warwick-Plasma/epoch.git
cd epoch/epoch1d

Next, load the mpi modules needed for compilation. This will be different for each cluster system - you'll know it has worked when the command: mpif90 --version returns a description of the mpif90 command. Remember the versions of the modules you're currently using, as you will need the same modules loaded when you come to run the script. You may need to run module purge first to clear out pre-loaded modules which may be interfering with the compilation.

Only when you have the modules loaded, attempt to compile EPOCH using the command:

make COMPILER=gfortran -j4

I'm guessing this is only SCARF which is causing the issue - can you compile EPOCH on your local machine?

Cheers, Stuart

Hnair13 commented 1 year ago

Hello Stuart, Update on the issue the code seemed compiling but then in the end it showed an error. I have attached the screenshot of the error. error

Status-Mirror commented 1 year ago

I am currently able to compile the most recent version of EPOCH on my local machine and a few clusters (Archer2 and Avon at Warwick), so I'm not sure if there's much more support I can give here. Unfortunately I don't have access to SCARF - I think the issue may be on their end?

If you're able to compile the code on other machines, and if you still get an error when you follow my "begin from scratch with a git clone in a new directory" method, then I'd try raising this issue with the SCARF team themselves.

Sorry we couldn't be more helpful, Stuart

Hnair13 commented 1 year ago

Hello Stuart, Thank you for your input. But we finally got the code compiled. It was the MPI issue. The code is now compiling and we are able to work with it again.

Status-Mirror commented 1 year ago

Did you have to change the EPOCH source code, or was this from changing settings on SCARF?

I'd just like to make sure these isn't a bug in the code before I close this issue.

Hnair13 commented 1 year ago

No. There was no requirement for changing the source code. It was resolved by loading AMD module in Scarf. It was the MPI issue in the SCARF.