charm AT lists.siebelschool.illinois.edu
Subject: Charm++ parallel programming system
List archive
- From: SAGAR SHEDGE <sagar.shedge92 AT gmail.com>
- To: charm AT cs.uiuc.edu, "Kale, Laxmikant V" <kale AT illinois.edu>
- Subject: [charm] About MSA
- Date: Tue, 24 Jan 2012 18:08:14 +0530
- List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
- List-id: CHARM parallel programming system <charm.cs.uiuc.edu>
Hello,
I have written a small code using MSA library functions.
In that I had put page size as some constant instead of Default size. I created an array which has size larger than that of single page size. Here each chare will going inside write once mode , there it will change array element in fixed amount of range and chare 0 will print it.
I am running application on 4 processor. When I write into an array and then read , it works fine. Now I want to use Prefetch() function so that each chare will fetch data in fixed range. When I am going to Predetch the data it giving me error that
page=0 mode=2 pagestate=1------------- Processor 0 Exiting: Called CmiAbort ------------
Reason: MSA Runtime error: Attempting to access a page that is still in another mode.
page=8 mode=2 pagestate=1------------- Processor 2 Exiting: Called CmiAbort ------------
Reason: MSA Runtime error: Attempting to access a page that is still in another mode.
page=12 mode=2 pagestate=1------------- Processor 3 Exiting: Called CmiAbort ------------
Reason: MSA Runtime error: Attempting to access a page that is still in another mode.
page=4 mode=2 pagestate=1------------- Processor 1 Exiting: Called CmiAbort ------------
Reason: MSA Runtime error: Attempting to access a page that is still in another mode.
I am attaching .ci and .C file , you please go through it. How should I change page mode?
--
Sagar Dilip Shedge,
C-DAC R&D,
Pune.
With Regards.
#include <msa/msa.h> typedef MSA2D<double , DefaultEntry<double> , 2048 , MSA_ROW_MAJOR> MSA2DARRAY; #include "main.decl.h" int row,col; class Main:public CBase_Main { public : Main(CkArgMsg* msg) { delete msg; row = CkNumPes() ; col = CkNumPes() * 2048; MSA2DARRAY arr(row,col,CkNumPes()); CkPrintf("Creating array of (%d , %d) \n",row,col); CProxy_testArray tArray = CProxy_testArray::ckNew(arr,CkNumPes()); tArray.ckSetReductionClient(new CkCallback(CkIndex_Main::done(NULL),thisProxy)); tArray.start(); CkPrintf("Main contructor called with Default value%d\n",MSA_DEFAULT_ENTRIES_PER_PAGE); } Main(CkMigrateMessage* msg) { delete msg; } void done(CkReductionMsg* msg) { CkPrintf("Now exiting...\n"); CkExit(); } }; class testArray:public CBase_testArray { public: int workThread; MSA2DARRAY myarr; testArray(const MSA2DARRAY &arr):myarr(arr) { workThread=CkNumPes(); CkPrintf("In testArray of index %d \n",thisIndex); } testArray(CkMigrateMessage* msg) { } void start() { int r,c; myarr.enroll(workThread); MSA2DARRAY::Write &writer = myarr.getInitialWrite(); CkPrintf("got writer to index %d \n ",thisIndex); myarr.Prefetch(thisIndex,thisIndex ); for(c=0;c<col;c++) { writer(thisIndex,c) = (thisIndex+1) * (c+1); } MSA2DARRAY::Read &Reader = myarr.syncToRead(writer); CkPrintf("get(%d,%d) :- %d\n",thisIndex,col-1,myarr.getIndex(thisIndex,0)); if(thisIndex == 0) { CkPrintf("\nTotal rows : %d\n Total Cols :- %d \n",myarr.getRows(),myarr.getCols()); for(r=0;r<row;r++) { for(c=0;c<col;c++) { // CkPrintf("Index %d showing data (%d,%d) :- %lf \n",thisIndex,r,c,Reader(r,c)); } } } contribute_data(); } void contribute_data() { int myindex=thisIndex; contribute(sizeof(int),&myindex,CkReduction::max_int); } }; #include "main.def.h"
Attachment:
main.ci
Description: Binary data
- [charm] About MSA, SAGAR SHEDGE, 01/24/2012
Archive powered by MHonArc 2.6.16.