Commit 007a94c7 authored by Francois Tessier's avatar Francois Tessier

Simple write in Fortran to develop a first version of F90 bindings

parent 0d88635f
MPIF90 = mpixlf90
FLAGS = -g
LDFLAGS =
all: simple_array
simple_array:simple_array.f90
$(MPIF90) $(FLAGS) $? -o $@ $(LDFLAGS)
clean:
rm simple_array
MPIF90 = mpixlf90
FLAGS = -g
LDFLAGS =
all: simple_array
simple_array:simple_array.f90
$(MPIF90) $(FLAGS) $? -o $@ $(LDFLAGS)
clean:
rm simple_array
#!/bin/bash
NODES=2
PPN=16
NPROCS=$((NODES*PPN))
TARGET="/projects/visualization/ftessier/debug"
cd $HOME/TAPIOCA/examples/Fortran
function updateSettings()
{
SETTINGS="PAMID_VERBOSE=1"
SETTINGS="$SETTINGS PAMID_COLLECTIVES_MEMORY_OPTIMIZED=1"
SETTINGS="$SETTINGS PAMID_COLLECTIVES=1"
SETTINGS="$SETTINGS BG_SHAREDMEMSIZE=64"
SETTINGS="$SETTINGS BGLOCKLESSMPIO_F_TYPE=0x47504653"
SETTINGS="$SETTINGS GPFSMPIO_BALANCECONTIG=1"
SETTINGS="$SETTINGS GPFSMPIO_P2PCONTIG=1"
}
rm $TARGET/*
updateSettings
runjob --block $COBALT_PARTNAME --envs $SETTINGS -p $PPN --np $NPROCS : ./simple_array
! http://www.mcs.anl.gov/research/projects/mpi/usingmpi2/examples/starting/io3f_f90.htm
PROGRAM main
use mpi
integer ierr, i, myrank, BUFSIZE, filehandle
character(*), parameter :: filepath = "/projects/visualization/ftessier/debug/"
parameter (BUFSIZE=100)
integer buf(BUFSIZE)
integer(kind=MPI_OFFSET_KIND) disp
call MPI_INIT(ierr)
call MPI_COMM_RANK(MPI_COMM_WORLD, myrank, ierr)
do i = 0, BUFSIZE
buf(i) = myrank * BUFSIZE + i
enddo
! filepath//"f90_HACC.dat"
call MPI_FILE_OPEN(MPI_COMM_WORLD, "f90HACC", &
MPI_MODE_WRONLY + MPI_MODE_CREATE, &
MPI_INFO_NULL, filehandle, ierr)
disp = myrank * BUFSIZE * 4
call MPI_FILE_WRITE_AT(filehandle, disp, buf, BUFSIZE, MPI_INTEGER, &
MPI_STATUS_IGNORE, ierr)
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
call MPI_FILE_CLOSE(filehandle, ierr)
call MPI_FINALIZE(ierr)
END PROGRAM main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment