Merge branch 'master' of github.com:JamesEMcClure/LBPM-WIA
This commit is contained in:
commit
6440222fb5
14
README.visit
14
README.visit
@ -4,9 +4,10 @@ Checkout code and create a cmake script to compile plug-in.
|
||||
Example commands for Rhea:
|
||||
|
||||
Load the proper modules
|
||||
module load visit
|
||||
module load cmake
|
||||
module unload intel gcc
|
||||
module load gcc/4.8.2
|
||||
module load cmake
|
||||
|
||||
|
||||
Configure cmake to build the plug-in
|
||||
cmake \
|
||||
@ -16,20 +17,21 @@ Configure cmake to build the plug-in
|
||||
-D USE_MPI=false \
|
||||
-D USE_CUDA=false \
|
||||
-D USE_VISIT=true \
|
||||
-D VISIT_ROOT_DIR=/sw/rhea/visit \
|
||||
-D VISIT_ROOT_DIR=/sw/redhat6/visit \
|
||||
-D USE_TIMER=false \
|
||||
../../LBPM-WIA
|
||||
|
||||
|
||||
|
||||
Build the visit plug-in
|
||||
make install -j 8
|
||||
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:
|
||||
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
|
||||
|
||||
|
@ -45,7 +45,7 @@ MACRO( VISIT_PLUGIN SRC_DIR TARGET )
|
||||
ENDFOREACH()
|
||||
ADD_CUSTOM_TARGET(
|
||||
${SRC_DIR}
|
||||
COMMAND ${VISIT_XML_CMAKE} ${TARGET}.xml
|
||||
COMMAND ${VISIT_XML_CMAKE} -clobber ${TARGET}.xml
|
||||
COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} .
|
||||
|
@ -162,11 +162,27 @@ int MPI_Waitall( int, MPI_Request[], MPI_Status[] )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
ERROR("Not implimented yet");
|
||||
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,
|
||||
MPI_Comm comm, MPI_Request *request)
|
||||
{
|
||||
@ -185,6 +201,13 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
|
||||
ERROR("Not implimented yet");
|
||||
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 dest, int sendtag,
|
||||
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");
|
||||
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 )
|
||||
{
|
||||
return 0.0;
|
||||
|
@ -18,28 +18,40 @@
|
||||
#define MPI_COMM_WORLD 0
|
||||
#define MPI_COMM_SELF 0
|
||||
#define MPI_STATUS_IGNORE NULL
|
||||
enum MPI_Datatype { MPI_LOGICAL, MPI_CHAR, MPI_INT, MPI_DOUBLE };
|
||||
enum MPI_Op { MPI_SUM };
|
||||
enum MPI_Datatype { MPI_LOGICAL, MPI_CHAR, MPI_UNSIGNED_CHAR, MPI_INT,
|
||||
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
|
||||
int MPI_Init(int*,char***);
|
||||
int MPI_Finalize();
|
||||
int MPI_Comm_size( MPI_Comm, int *size );
|
||||
int MPI_Comm_rank( MPI_Comm, int *rank );
|
||||
int MPI_Barrier(MPI_Comm);
|
||||
int MPI_Wait(MPI_Request*,MPI_Status*);
|
||||
int MPI_Waitall(int,MPI_Request[],MPI_Status[]);
|
||||
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,
|
||||
MPI_Comm comm, MPI_Request *request);
|
||||
int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source,
|
||||
int tag, MPI_Comm comm, MPI_Request *request);
|
||||
int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
|
||||
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 dest, int sendtag,
|
||||
void *recvbuf, int recvcount, MPI_Datatype recvtype,
|
||||
int source, int recvtag,
|
||||
MPI_Comm comm, MPI_Status *status);
|
||||
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
|
||||
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
#include <exception>
|
||||
#include <stdexcept>
|
||||
#include <fstream>
|
||||
#include <mpi.h>
|
||||
|
||||
#include "pmmc.h"
|
||||
#include "Domain.h"
|
||||
#include "Communication.h"
|
||||
#include "MPI_Helpers.h" // This includes mpi.h
|
||||
|
||||
|
||||
/*
|
||||
* Pre-Processor to generate signed distance function from disc packing
|
||||
|
@ -180,7 +180,7 @@ int main(int argc, char **argv)
|
||||
MPI_Bcast(&sizeY,1,MPI_INT,0,MPI_COMM_WORLD);
|
||||
MPI_Bcast(&sizeZ,1,MPI_INT,0,MPI_COMM_WORLD);
|
||||
|
||||
if (rank==0) printf("Broadcast block at %i,%i,%i \n",x,y,z);
|
||||
//if (rank==0) printf("Broadcast block at %i,%i,%i \n",x,y,z);
|
||||
|
||||
for (k=z;k<z+sizeZ;k++){
|
||||
for (j=y;j<y+sizeY;j++){
|
||||
@ -227,12 +227,27 @@ int main(int argc, char **argv)
|
||||
}
|
||||
MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
|
||||
sat = float(countGlobal)/totalGlobal;
|
||||
if (rank==0) printf("New count=%i\n",countGlobal);
|
||||
if (rank==0) printf("New saturation=%f\n",sat);
|
||||
//if (rank==0) printf("New count=%i\n",countGlobal);
|
||||
//if (rank==0) printf("New saturation=%f\n",sat);
|
||||
}
|
||||
|
||||
if (InitialWetting == 1) FlipID(id,nx*ny*nz);
|
||||
|
||||
|
||||
count = 0;
|
||||
for (int k=0; k<nz; k++){
|
||||
for (int j=0; j<ny; j++){
|
||||
for (int i=0; i<nx; i++){
|
||||
if (id[n] == 1){
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD);
|
||||
sat = float(countGlobal)/totalGlobal;
|
||||
if (rank==0) printf("Final saturation=%f\n",sat);
|
||||
|
||||
sprintf(LocalRankFilename,"ID.%05i",rank);
|
||||
FILE *ID = fopen(LocalRankFilename,"wb");
|
||||
fwrite(id,1,N,ID);
|
||||
|
Loading…
Reference in New Issue
Block a user