fixed merge conflicts in lbpm_random_pp

This commit is contained in:
James E McClure 2015-07-10 11:10:04 -04:00
commit e17593677a
6 changed files with 72 additions and 14 deletions

View File

@ -4,9 +4,10 @@ Checkout code and create a cmake script to compile plug-in.
Example commands for Rhea: Example commands for Rhea:
Load the proper modules Load the proper modules
module load visit module unload intel gcc
module load cmake
module load gcc/4.8.2 module load gcc/4.8.2
module load cmake
Configure cmake to build the plug-in Configure cmake to build the plug-in
cmake \ cmake \
@ -16,20 +17,21 @@ Configure cmake to build the plug-in
-D USE_MPI=false \ -D USE_MPI=false \
-D USE_CUDA=false \ -D USE_CUDA=false \
-D USE_VISIT=true \ -D USE_VISIT=true \
-D VISIT_ROOT_DIR=/sw/rhea/visit \ -D VISIT_ROOT_DIR=/sw/redhat6/visit \
-D USE_TIMER=false \ -D USE_TIMER=false \
../../LBPM-WIA ../../LBPM-WIA
Build the visit plug-in Build the visit plug-in
make install -j 8
make visit make visit
Check that the visit plug-in installed in ~/.visit/2.7.1/linux-x86_64/plugins/databases Check that the visit plug-in installed in ~/.visit/2.9.0/linux-x86_64/plugins/databases
where 2.9.0 is the current version of visit on rhea
It should have created several shared libraries: It should have created several shared libraries:
libELBMDatabase_par.so libELBMDatabase_ser.so libILBMDatabase.so libMLBMDatabase.so libELBMDatabase_par.so libELBMDatabase_ser.so libILBMDatabase.so libMLBMDatabase.so
Install visit on local machine (2.7.3) Install visit on local machine (2.9.0)
Start visit on local machine Start visit on local machine

View File

@ -45,7 +45,7 @@ MACRO( VISIT_PLUGIN SRC_DIR TARGET )
ENDFOREACH() ENDFOREACH()
ADD_CUSTOM_TARGET( ADD_CUSTOM_TARGET(
${SRC_DIR} ${SRC_DIR}
COMMAND ${VISIT_XML_CMAKE} ${TARGET}.xml COMMAND ${VISIT_XML_CMAKE} -clobber ${TARGET}.xml
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} . -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} .

View File

@ -162,11 +162,27 @@ int MPI_Waitall( int, MPI_Request[], MPI_Status[] )
{ {
return 0; return 0;
} }
int MPI_Wait( MPI_Request*, MPI_Status* )
{
return 0;
}
int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm ) int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm )
{ {
ERROR("Not implimented yet"); ERROR("Not implimented yet");
return 0; return 0;
} }
int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm)
{
ERROR("Not implimented yet");
return 0;
}
int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status)
{
ERROR("Not implimented yet");
return 0;
}
int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request) MPI_Comm comm, MPI_Request *request)
{ {
@ -185,6 +201,13 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
ERROR("Not implimented yet"); ERROR("Not implimented yet");
return 0; return 0;
} }
int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm)
{
ERROR("Not implimented yet");
return 0;
}
int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, int dest, int sendtag,
void *recvbuf, int recvcount, MPI_Datatype recvtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
@ -194,6 +217,16 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
ERROR("Not implimented yet"); ERROR("Not implimented yet");
return 0; return 0;
} }
int MPI_Comm_group(MPI_Comm comm, MPI_Group *group)
{
ERROR("Not implimented yet");
return 0;
}
int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
{
ERROR("Not implimented yet");
return 0;
}
double MPI_Wtime( void ) double MPI_Wtime( void )
{ {
return 0.0; return 0.0;

View File

@ -18,28 +18,40 @@
#define MPI_COMM_WORLD 0 #define MPI_COMM_WORLD 0
#define MPI_COMM_SELF 0 #define MPI_COMM_SELF 0
#define MPI_STATUS_IGNORE NULL #define MPI_STATUS_IGNORE NULL
enum MPI_Datatype { MPI_LOGICAL, MPI_CHAR, MPI_INT, MPI_DOUBLE }; enum MPI_Datatype { MPI_LOGICAL, MPI_CHAR, MPI_UNSIGNED_CHAR, MPI_INT,
enum MPI_Op { MPI_SUM }; MPI_UNSIGNED, MPI_LONG, MPI_UNSIGNED_LONG, MPI_LONG_LONG, MPI_FLOAT, MPI_DOUBLE };
enum MPI_Op { MPI_MIN, MPI_MAX, MPI_SUM };
enum MPI_Group { };
// Fake MPI functions // Fake MPI functions
int MPI_Init(int*,char***); int MPI_Init(int*,char***);
int MPI_Finalize(); int MPI_Finalize();
int MPI_Comm_size( MPI_Comm, int *size ); int MPI_Comm_size( MPI_Comm, int *size );
int MPI_Comm_rank( MPI_Comm, int *rank ); int MPI_Comm_rank( MPI_Comm, int *rank );
int MPI_Barrier(MPI_Comm); int MPI_Barrier(MPI_Comm);
int MPI_Wait(MPI_Request*,MPI_Status*);
int MPI_Waitall(int,MPI_Request[],MPI_Status[]); int MPI_Waitall(int,MPI_Request[],MPI_Status[]);
int MPI_Bcast(void*,int,MPI_Datatype,int,MPI_Comm); int MPI_Bcast(void*,int,MPI_Datatype,int,MPI_Comm);
int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm);
int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status);
int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request); MPI_Comm comm, MPI_Request *request);
int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
int tag, MPI_Comm comm, MPI_Request *request); int tag, MPI_Comm comm, MPI_Request *request);
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm);
int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, int dest, int sendtag,
void *recvbuf, int recvcount, MPI_Datatype recvtype, void *recvbuf, int recvcount, MPI_Datatype recvtype,
int source, int recvtag, int source, int recvtag,
MPI_Comm comm, MPI_Status *status); MPI_Comm comm, MPI_Status *status);
double MPI_Wtime( void ); double MPI_Wtime( void );
int MPI_Comm_group(MPI_Comm comm, MPI_Group *group);
int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm);
#endif #endif

View File

@ -5,11 +5,12 @@
#include <exception> #include <exception>
#include <stdexcept> #include <stdexcept>
#include <fstream> #include <fstream>
#include <mpi.h>
#include "pmmc.h" #include "pmmc.h"
#include "Domain.h" #include "Domain.h"
#include "Communication.h" #include "Communication.h"
#include "MPI_Helpers.h" // This includes mpi.h
/* /*
* Pre-Processor to generate signed distance function from disc packing * Pre-Processor to generate signed distance function from disc packing
@ -151,6 +152,8 @@ int main(int argc, char **argv)
MPI_Request req1[18],req2[18]; MPI_Request req1[18],req2[18];
MPI_Status stat1[18],stat2[18]; MPI_Status stat1[18],stat2[18];
int depth;
if (rank == 0){ if (rank == 0){
printf("********************************************************\n"); printf("********************************************************\n");
printf("Running Disc Packing Pre-Processor for LBPM-WIA \n"); printf("Running Disc Packing Pre-Processor for LBPM-WIA \n");
@ -200,8 +203,10 @@ int main(int argc, char **argv)
MPI_Bcast(&Lz,1,MPI_DOUBLE,0,MPI_COMM_WORLD); MPI_Bcast(&Lz,1,MPI_DOUBLE,0,MPI_COMM_WORLD);
//................................................. //.................................................
MPI_Barrier(MPI_COMM_WORLD); MPI_Barrier(MPI_COMM_WORLD);
// ************************************************************** // **************************************************************
if (argc > 1) depth=atoi(argv[1]);
else depth=Nz;
if (nprocs != nprocx*nprocy*nprocz){ if (nprocs != nprocx*nprocy*nprocz){
printf("nprocx = %i \n",nprocx); printf("nprocx = %i \n",nprocx);
@ -227,6 +232,7 @@ int main(int argc, char **argv)
printf("Process grid = %ix%ix%i \n", nprocx,nprocy,nprocz); printf("Process grid = %ix%ix%i \n", nprocx,nprocy,nprocz);
printf("Sub-domain size = %ix%ix%i \n", Nx,Ny,Nz); printf("Sub-domain size = %ix%ix%i \n", Nx,Ny,Nz);
printf("Physical domain size = %fx%fx%f \n",Lx,Ly,Lz); printf("Physical domain size = %fx%fx%f \n",Lx,Ly,Lz);
printf("Micromodel depth = %i voxels",depth);
} }
@ -284,6 +290,7 @@ int main(int argc, char **argv)
printf("************ \n"); printf("************ \n");
} }
if (nprocz > 1 && rank==0) printf("Disc packs are 2D -- are you sure you want nprocz > 1? \n");
//....................................................................... //.......................................................................
SignedDistanceDiscPack(SignDist.get(),ndiscs,cx,cy,rad,Lx,Ly,Lz,Nx,Ny,Nz, SignedDistanceDiscPack(SignDist.get(),ndiscs,cx,cy,rad,Lx,Ly,Lz,Nx,Ny,Nz,
iproc,jproc,kproc,nprocx,nprocy,nprocz); iproc,jproc,kproc,nprocx,nprocy,nprocz);
@ -293,8 +300,13 @@ int main(int argc, char **argv)
for (k=0;k<Nz;k++){ for (k=0;k<Nz;k++){
for (j=0;j<Ny;j++){ for (j=0;j<Ny;j++){
for (i=0;i<Nx;i++){ for (i=0;i<Nx;i++){
dst = (iproc*(Nx-2)+i-1)*1.0; // Assign the micromodel depth
if ((Nx-2)*nprocx-2-iproc*(Nx-2)-i+1 < dst) dst = 1.0*((Nx-2)*nprocx-2-iproc*(Nx-2)-i+1); dst = 1.0*(i-2);
if (1.0*(depth+2-i) < dst) dst = 1.0*(depth+2-i);
if (dst < SignDist(i,j,k)) SignDist(i,j,k) = dst;
// dst = (iproc*(Nx-2)+i-1)*1.0;
// if ((Nx-2)*nprocx-2-iproc*(Nx-2)-i+1 < dst) dst = 1.0*((Nx-2)*nprocx-2-iproc*(Nx-2)-i+1);
// Add walls at the boundary
if ( (jproc*(Ny-2)+ j-1)*1.0 < dst) dst = (jproc*(Ny-2)+j-2)*1.0; if ( (jproc*(Ny-2)+ j-1)*1.0 < dst) dst = (jproc*(Ny-2)+j-2)*1.0;
if ((Ny-2)*nprocx-(jproc*(Ny-2)+j-2)*1.0 < dst) dst = ((Ny-2)*nprocy-(jproc*(Ny-2)+j-2))*1.0; if ((Ny-2)*nprocx-(jproc*(Ny-2)+j-2)*1.0 < dst) dst = ((Ny-2)*nprocy-(jproc*(Ny-2)+j-2))*1.0;
// Assign the Signed Distance where valid // Assign the Signed Distance where valid

View File

@ -240,7 +240,6 @@ int main(int argc, char **argv)
for (int j=1; j<Ny-1; j++){ for (int j=1; j<Ny-1; j++){
for (int i=1; i<Nx-1; i++){ for (int i=1; i<Nx-1; i++){
n=k*Nx*Ny+j*Nx+i; n=k*Nx*Ny+j*Nx+i;
if (id[n] == 1){ if (id[n] == 1){
count++; count++;
} }