Researxh Computing Technologies
UCLA Academic Technology Services
Home Services Classes Contact Jobs
Search
 

Compiling and running on the Hoffman Cluster

Compile:

In order to compile the code do as follows:
mpif77 program.f -o program
                                            (for Fortran code)
mpicc  program.c -o program
                                            (for C code)

Run:

Test run interactively : mpirun -np n executable
                                               ( will run your executable with n tasks)
Batch mode using mpi.queue after testing
                                              (typing mpi.queue on the command line will give you the self explanatory menu).

Excercises:

As a last resort you may look the Answer files.

1. Copy few of the following codes to your work directory and compile/run them on 2, 4 processors using mpirun as well as mpi.queue command.

pstruct: Fortran C
ptopb: Fortran C
ptopnb: Fortran C
barrier: Fortran C
bcast: Fortran C
scatter: Fortran C
gather: Fortran C
reduction: Fortran C
allreduction: Fortran C
derived: Fortran C
pack: Fortran C
group: Fortran C
poisson: Fortran C
 

2. Take the allreduction( Fortran C) code and do the reduction operation using  point to point calls

    (Answer: allreductionptop- Fortran C )

3. Take the following serial algorithm and implement it in parallel.

    (You may copy the serial version from dotproduct- Fortran C)

        Dot product of two arrays B(1000000) in to C(1000000)

                                                 DOT=SUM(B(i)*C(i)), i=1,1000000

       (Answer: pardotproduct - Fortran C)

4. Copy poisson (Fortran C) to your work directory and do the following:

Use MPI_SENDRECV function in place of send/recv separate calls  (Answer: poissonsendrecv-Fortran C )
Convert the non blocking send/recv calls in poisson: Fortran C to blocking send recv calls, and write down your experience.
Correct the code poisson- Fortran C with blocking calls in order it to work   (Answer: poissonblock- Fortran C )
Compare the timings for all these versions of runs for poisson and suggest the best one (timing comes in the output of batch job)

 

Universal Accessiblity IconAccessibility Information
Please send comments about this site to webmaster at ats.ucla.edu.