资源简介
You must install MPICH2 on all machines that you want to run MPI programs on. Run the installer on each machine individually.
The installer creates the following mpich2 directory structure on your machine:
mpich2\bin
mpich2\include
mpich2\lib
The include and lib directories contain the libraries needed to compile MPI programs. The mpich2 dlls are copied to the Windows\system32 directory. The bin directory contains smpd.exe which is the MPICH2 process manager used to launch MPI programs. mpiexec.exe, also found in the bin directory, is used to start MPICH2 jobs.
代码片段和文件信息
/*
(C) 2001 by Argonne National Laboratory.
See COPYRIGHT in top-level directory.
*/
#include “mpi.h“
#include “mpe.h“
#include
#include
double f( double );
double f( double a )
{
return (4.0 / (1.0 + a*a));
}
int main( int argc char *argv[] )
{
int n myid numprocs ii jj;
double PI25DT = 3.141592653589793238462643;
double mypi pi h sum x;
double startwtime = 0.0 endwtime;
int namelen;
int event1a event1b event2a event2b
event3a event3b event4a event4b;
int event1 event2 event3;
char processor_name[ MPI_MAX_PROCESSOR_NAME ];
MPI_Init( &argc &argv );
MPI_Pcontrol( 0 );
MPI_Comm_size( MPI_COMM_WORLD &numprocs );
MPI_Comm_rank( MPI_COMM_WORLD &myid );
MPI_Get_processor_name( processor_name &namelen );
fprintf( stderr “Process %d running on %s\n“ myid processor_name );
/*
MPE_Init_log() & MPE_Finish_log() are NOT needed when
liblmpe.a is linked with this program. In that case
MPI_Init() would have called MPE_Init_log() already.
*/
#if defined( NO_MPI_LOGGING )
MPE_Init_log();
#endif
/*
user should NOT assign eventIDs directly in MPE_Describe_state()
Get the eventIDs for user-defined STATES(rectangles) from
MPE_Log_get_state_eventIDs() instead of the deprecated function
MPE_Log_get_event_number().
*/
MPE_Log_get_state_eventIDs( &event1a &event1b );
MPE_Log_get_state_eventIDs( &event2a &event2b );
MPE_Log_get_state_eventIDs( &event3a &event3b );
MPE_Log_get_state_eventIDs( &event4a &event4b );
if ( myid == 0 ) {
MPE_Describe_state( event1a event1b “Broadcast“ “red“ );
MPE_Describe_state( event2a event2b “Sync“ “orange“ );
MPE_Describe_state( event3a event3b “Compute“ “blue“ );
MPE_Describe_state( event4a event4b “Reduce“ “green“ );
}
/* Get event ID for Solo-Event(single timestamp object) from MPE */
MPE_Log_get_solo_eventID( &event1 );
MPE_Log_get_solo_eventID( &event2 );
MPE_Log_get_solo_eventID( &event3 );
if ( myid == 0 ) {
MPE_Describe_event( event1 “Broadcast Post“ “white“ );
MPE_Describe_event( event2 “Compute Start“ “purple“ );
MPE_Describe_event( event3 “Compute End“ “navy“ );
}
if ( myid == 0 ) {
n = 1000000;
startwtime = MPI_Wtime();
}
MPI_Barrier( MPI_COMM_WORLD );
MPI_Pcontrol( 1 );
/*
MPE_Start_log();
*/
for ( jj = 0; jj < 5; jj++ ) {
MPE_Log_event( event1a 0 NULL );
MPI_Bcast( &n 1 MPI_INT 0 MPI_COMM_WORLD );
MPE_Log_event( event1b 0 NULL );
MPE_Log_event( event1 0 NULL );
MPE_Log_event( event2a 0 NULL );
MPI_Barrier( MPI_COMM_WORLD );
MPE_Log_event( event2b 0 NULL );
MPE_Log_event( event2 0 NULL );
MPE_Log_event( event3a 0 NULL );
h = 1.0 /
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 183747 2011-06-29 15:38 mpich2安装\bin\clog2TOslog2.jar
文件 94208 2011-09-01 16:01 mpich2安装\bin\irlog2rlog.exe
文件 2449314 2011-06-29 15:38 mpich2安装\bin\jumpshot.jar
文件 7140 2011-06-29 15:38 mpich2安装\bin\jumpshot_launcher.jar
文件 491520 2011-09-01 15:25 mpich2安装\bin\mpiexec.exe
文件 483328 2011-09-01 15:25 mpich2安装\bin\smpd.exe
文件 106496 2011-09-01 16:01 mpich2安装\bin\TraceInput.dll
文件 124160 2011-06-29 15:38 mpich2安装\bin\traceTOslog2.jar
文件 57344 2011-09-01 15:25 mpich2安装\bin\wmpiconfig.exe
文件 65536 2011-09-01 15:25 mpich2安装\bin\wmpiexec.exe
文件 24576 2011-09-01 15:25 mpich2安装\bin\wmpiregister.exe
文件 8076 2009-02-27 16:23 mpich2安装\COPYRIGHT.rtf
文件 86016 2011-09-01 16:02 mpich2安装\examples\cpi.exe
文件 7948 2010-07-02 14:38 mpich2安装\examples\cpi.vcproj
文件 3904 2007-11-02 17:50 mpich2安装\examples\cpilog.c
文件 1497 2007-11-02 17:50 mpich2安装\examples\cxxpi.cxx
文件 8001 2010-07-02 14:38 mpich2安装\examples\cxxpi.vcproj
文件 2709 2010-07-02 14:38 mpich2安装\examples\examples.sln
文件 2422 2007-11-02 17:50 mpich2安装\examples\fpi.f
文件 4769 2010-07-02 14:38 mpich2安装\examples\fpi.vfproj
文件 5063 2007-12-04 17:53 mpich2安装\examples\fpilog.f
文件 1892 2007-11-02 17:50 mpich2安装\examples\icpi.c
文件 4857 2009-11-17 21:46 mpich2安装\include\clog_commset.h
文件 696 2007-11-02 17:50 mpich2安装\include\clog_const.h
文件 731 2011-09-01 14:59 mpich2安装\include\clog_inttypes.h
文件 1353 2009-11-17 21:46 mpich2安装\include\clog_uuid.h
文件 355 2010-10-21 13:20 mpich2安装\include\mpe.h
文件 11102 2009-11-17 21:46 mpich2安装\include\mpe_log.h
文件 1833 2007-11-02 17:50 mpich2安装\include\mpe_logf.h
文件 1322 2009-11-17 21:46 mpich2安装\include\mpe_misc.h
............此处省略31个文件信息
- 上一篇:HTTP测试工具 restclient
- 下一篇:emgucv 人脸识别
评论
共有 条评论