Commit d8fb0abc authored by Victor Lopez's avatar Victor Lopez

Force main WD to be implicit

The main WD should be implicit to honor the implicit parallel
of size 1 that executes the main program.

As a side effect, the main WD in OmpSs can no longer ignore the
barrier construct and must be explicitly prevented.
parent c333e291
......@@ -65,6 +65,7 @@ namespace nanos {
std::string getDescription( void ) { return _description; }
bool isMalleable( void ) const { return _malleable; }
bool isOmpSs( void ) const { return _malleable; }
virtual int getMaxThreads() const { return 0; }
virtual void setNumThreads( int nthreads ) {}
......
......@@ -483,6 +483,7 @@ void System::start ()
//Setup MainWD
WD &mainWD = *myThread->getCurrentWD();
mainWD._mcontrol.setMainWD();
mainWD.setImplicit(true);
if ( _pmInterface->getInternalDataSize() > 0 ) {
char *data = NEW char[_pmInterface->getInternalDataSize()];
......
......@@ -116,8 +116,11 @@ NANOS_API_DEF(nanos_err_t, nanos_omp_barrier, ( void ))
NANOS_INSTRUMENT( InstrumentStateAndBurst inst("api","omp_barrier",NANOS_SYNCHRONIZATION) );
try {
if ( sys.getPMInterface().isOmpSs() ) {
return NANOS_UNIMPLEMENTED;
}
WD &wd = *myThread->getCurrentWD();
wd.waitCompletion();
if ( wd.isImplicit() ) {
myThread->getTeam()->barrier();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment