mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
Changed MyMPI_RecvCmd and MyMPI_SendCmd. Disabled USE_BUFFERS for now.
This commit is contained in:
parent
dc1fb0a947
commit
383ced496b
@ -16,35 +16,29 @@ namespace netgen
|
||||
|
||||
void MyMPI_SendCmd (const char * cmd)
|
||||
{
|
||||
char buf[10000];
|
||||
strcpy (buf, cmd);
|
||||
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
||||
int ntasks;
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &ntasks);
|
||||
|
||||
if(ntasks==1)
|
||||
return;
|
||||
|
||||
for (int dest = 1; dest < ntasks; dest++)
|
||||
MPI_Send( &buf, 10000, MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD);
|
||||
MPI_Send( cmd, (strlen(cmd)+1), MPI_CHAR, dest, MPI_TAG_CMD, MPI_COMM_WORLD);
|
||||
}
|
||||
|
||||
string MyMPI_RecvCmd ()
|
||||
{
|
||||
char buf[10000];
|
||||
// MPI_Bcast (&buf, 100, MPI_CHAR, 0, MPI_COMM_WORLD);
|
||||
|
||||
// VT_OFF();
|
||||
MPI_Status status;
|
||||
int flag;
|
||||
do
|
||||
{
|
||||
MPI_Iprobe (0, MPI_TAG_CMD, MPI_COMM_WORLD, &flag, &status);
|
||||
if (!flag)
|
||||
{
|
||||
VT_TRACER ("sleep");
|
||||
usleep (1000);
|
||||
}
|
||||
}
|
||||
while (!flag);
|
||||
// VT_ON();
|
||||
int size_of_msg = -1;
|
||||
|
||||
MPI_Recv( &buf, 10000, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
|
||||
MPI_Probe(0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
|
||||
MPI_Get_count(&status, MPI_CHAR, &size_of_msg);
|
||||
|
||||
//char* buf = (char*)malloc(size_of_msg*sizeof(char));
|
||||
char buf[100000]; //1MB should be enough...
|
||||
|
||||
MPI_Recv( &buf, size_of_msg, MPI_CHAR, 0, MPI_TAG_CMD, MPI_COMM_WORLD, &status);
|
||||
|
||||
return string(buf);
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class DLL_HEADER VisualSceneSolution : public VisualScene
|
||||
Point<3> p;
|
||||
};
|
||||
|
||||
#define USE_BUFFERS
|
||||
// #define USE_BUFFERS
|
||||
#ifdef USE_BUFFERS
|
||||
bool has_surfel_vbo = false;
|
||||
GLuint surfel_vbo[4]; //
|
||||
|
Loading…
Reference in New Issue
Block a user