Date Posted: November 14, 2005
Update: September 24, 2008 Version 10.1 adds UPC-specific optimization capabilities to the XL UPC compiler for AIX and Linux, as well as numerous functionality improvements.
Tab navigation
- 1. What is Unified Parallel C (UPC)?
- 2. What does "Hello World" look like in UPC?
- 3. I've downloaded the IBM® XL UPC Alpha Edition packages, but I cannot install them. What could be missing?
- 4. I get a configuration file not found error message when I tried using the XL UPC for Linux compiler. What could be wrong?
- 5. I get an error when I try to generate the configuration file using the new_install tool for XL UPC Alpha Edition for Linux. What should I do now?
- 6. How do I invoke the IBM XL UPC compilers?
- 7. How do I specify the number of threads?
- 8. How do I compile UPC source files with a .c file extension?
- 9. Can I compile and link UPC and C source files together?
- 10. Can I link XL UPC object files with those generated by GCC?
- 11. What is the largest number of threads that XL UPC supports? What is the largest blocking factor?
- 12. Why does the compiler tell me my license has expired?
1. What is Unified Parallel C (UPC)?
UPC is an extension to the C programming language that allows users to express parallelism in their code.
2. What does "Hello World" look like in UPC?
#include <stdio.h>
#include <upc.h>
int main()
{
printf ("thread %d: Hello World!\n", MYTHREAD);
return 0;
}
3. I've downloaded the IBM® XL UPC Alpha Edition packages, but I cannot install them. What could be missing?
In order to use the IBM XL UPC for AIX®, you must first install the IBM XL C/C++ Enterprise Edition 10.1 for AIX compiler.
In order to use the IBM XL UPC for Linux®, you must first install the IBM XL C/C++ Advanced Edition 10.1 for Linux compiler. In order to use the IBM XL UPC for Blue Gene®/L, you must first install the IBM XL C/C++ Advanced Edition 9.0 for Blue Gene/L compiler.4. I get a configuration file not found error message when I tried using the XL UPC for Linux compiler. What could be wrong?
After installation, you must generate a configuration file for UPC using the new_install utility. Ensure that this step has been done (refer to Step 3c in the "Installation instructions" found in the README file).
Note: The IBM XL UPC compiler uses a different configuration file than the IBM XL C/C++ compiler. The UPC configuration file contains additional information required for compiling UPC programs.5. I get an error when I try to generate the configuration file using the new_install tool for XL UPC Alpha Edition for Linux. What should I do now?
The new_install utility gathers the required system information, constructs the appropriate configuration command, and invokes it. If the utility cannot gather all of the information automatically, you may have to perform this step manually using the vac_configure utility provided with the IBM XL C/C++ Advanced Edition 10.1 for Linux compilers.
Before proceeding to try and configure the compiler manually, you should first go through the following checklist:- Ensure you are using the XL UPC new_install utility and not the XL C/C++ new_install utility.
- See if you can determine the cause of the errors reported by the new_install utility (such as missing GCC, insufficient permissions, etc.).
- Use /opt/ibmcmp/upc/1.0/etc/upc.base.cfg as the <template_config_file>.
- Use /opt/ibmcmp/upc/10.1/etc/upc.cfg as the argument to the -o option.
% /opt/ibmcmp/vac/10.1/bin/vac_configure -ibmcmp /opt/ibmcmp -gcc /usr -gcc64 /usr -o /opt/ibmcmp/upc/1.0/etc/upc.cfg /opt/ibmcmp/upc/1.0/etc/upc.base.cfgFor further information regarding the vac_configure utility, please refer to the "IBM XL C/C++ Advanced Edition 9.0 for Linux Installation Guide."
6. How do I invoke the IBM XL UPC compilers?
Invoke the IBM XL UPC for AIX compiler by using the following command:
/usr/upc/bin/xlupc |
/opt/ibmcmp/upc/1.0/bin/xlupc |
/opt/ibmcmp/upc/bg/1.0/bin/bgxlupc |
7. How do I specify the number of threads?
At compilation time, the number of threads can be specified using the -qupc=threads=<n> compiler option. At run time, the number of threads can be specified by setting the environment variable UPC_NTHREADS=n. The default number of threads is 1.
8. How do I compile UPC source files with a .c file extension?
In order to instruct the compiler to treat files with a .c extension as UPC source files, please specify the compiler option -qsourcetype=upc before the source file on the compilation command.
9. Can I compile and link UPC and C source files together?
Yes, UPC and C source files can be compiled and linked together using the xlupc compiler invocation. For example:
xlupc foo.upc bar.c -o foobar |
10. Can I link XL UPC object files with those generated by GCC?
You cannot mix XL UPC object files with the GCC object files if the latter contains UPC language features. The framework for allocating and accessing shared objects is different in different UPC implementations. UPC code in a XL UPC object file will not operate correctly if the program is initialized to run under the GCC run time, and vice versa.
11. What is the largest number of threads that XL UPC supports? What is the largest blocking factor?
The code generated by the compiler allows a value range of up to 2**31 for UPC_NTHREADS. Since the IBM XL UPC Alpha Edition for AIX is a Pthread implementation, the actual number of threads that a program can create is also limited by the run-time environment. The largest blocking factor that you can specify in a shared variable declaration is 2**31.
12. Why does the compiler tell me my license has expired?
The IBM XL UPC Alpha Edition Compilers are available for a 365-day trial period. If you wish to continue using the package after the trial period has expired, you must download it again and reinstall it on your system.
