- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good afternoon,
I would like to use the pardiso unsymmetric procedure in C.
I am using a HPC Linux 64 bits Redhat 7.9, with OneAPI 2021 installed.
Could someone please provide a simple C example of pardiso unsym .c algorithm, as well as the compilation instructions (setting the environment, compilation instruction, etc).
That would be greatly appreciated!
thanks in advance for your help,
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel Communities.
>>Could someone please provide a simple C example of pardiso unsym .c algorithm
Yes, as you are using Intel MKL on a Linux machine, you can find all the MKL sample codes in this /opt/intel/oneapi/mkl/latest/examples directory path you can untar and keep these examples in another folder( as Intel oneAPI path is a readable folder)
As you want to run the pardiso unsym.c example, you can go to the path where you have untared the file and go to c/sparse_directsolvers/source then you can find the example pardiso_unsym.c
>>as well as the compilation instructions (setting the environment, compilation instruction, etc).
At first, we need to initialize the Intel oneAPI environment for Intel MKL and Intel Compilers(C, C++, Fortran)
source /opt/intel/oneapi/setvars.sh
Now, for compiling you can use the Intel link line advisor for proper linking of your code. And also, please find this documentation for other linking options.
Compiling : icpx -DMKL_ILP64 -I"${MKLROOT}/include" pardiso_unsym.c -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--en d-group -lpthread -lm -ldl
Running : ./a.out
Please find the below screenshot where we tried for pardiso_unsym.c code,
For more details, regarding getting started for Intel MKL, please find the below links:
https://www.intel.com/content/www/us/en/docs/onemkl/get-started-guide/2023-0/overview.html
https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-linux/2023-1/overview.html
Could you please let us know if you have any other queries?
Thanks & Regards,
Varsha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Varsha,
Thanks a lot for your support!
Since my message posted yesterday, I managed to successfully compile using the "mkl link tool" to give me the compilation options :
icc pardiso_unsym_c.c -DMKL_ILP64 -I"${MKLROOT}/include" -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_ilp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl -o pardiso_unsym_c
Unfortunately, during execution, I add an error message with libiomp5.so!
I was stuck again, and your reply came handy:
I first initialised the environment variables as you recommended :
source /opt/cluster/tools/intel/2021.4/setvars.sh
then I tried to compile using your command :
icpx -DMKL_ILP64 -I"${MKLROOT}/include" pardiso_unsym.c -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--en d-group -lpthread -lm -ldl
Unfortunately it gave an error regarding d-group...
However I tried to recompile the code using my command above (icc ...) after initialising the environment variables using your command, and it successfully compiled... and ran!
In conclusion, I found out that:
my compilation command is OK
the environment variables need to be set before execution, using source /opt/cluster/tools/intel/2021.4/setvars.sh
Thanks to you, I also found out that I add the tgz examples installed in the directories, which I did not know (I did not install OneApi myself). I had recovered a pardiso_unsym.c version from the internet which might be a little older that the one officially provided with OneApi 2021. I will then use the OneAPI 2021 version from now on.
Thanks again for the support, that helped me get the algorithm working and get the recent version!
Best Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>> and it successfully compiled... and ran!
>>Thanks again for the support, that helped me get the algorithm working and get the recent version!
It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.
Have a Good Day!
Thanks & Regards,
Varsha
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page